Thursday, December 24, 2009

UML Associations in ODM

One of the major differences between the Ontology Definition Metamodel (ODM) and my UML profile for OWL is how associations are modeled. ODM treats the name of an association and its reading-order arrow as a property rather than the association ends. I find this rather odd. Not only are such models unusual, the UML specification itself uses no association names in its diagrams, except for the examples of that notation.

The way I have been modeling things at the business level for many years does not use the association name at all; it uses the association end names. These association ends are properties in the UML metamodel, so why shouldn't they represent properties in an ontology? One might argue that in UML, classes own their properties and in an ontology, properties are global, not owned by anything. I've made one simple change in interpretation of the UML specification to make this work: ownership does not convey into OWL. A property's domain corresponds to its owning class, and its range corresponds to its its type. Because the unspecified domain and range of a property is interpreted as having Thing as the domain and range, and because, practically speaking, every class in an ontology is a specialization of Thing, this interpretation works for all properties. When the association is bidirectional, the other end is an inverse in OWL, which is very convenient. Therefore, I can model in my usual way, sprinkle on a few stereotypes, and generate OWL.

There are three ways to name association ends. Many metamodelers from the OMG prefer noun phrases. Ontologists prefer verb phrases. Data modelers prefer prepositional phrases. Transforming these styles into an ontology is a matter of prepending the word "has" for noun phrases, leaving verb phrases alone, or prepending the word "is" to prepositional phrases.

Here is an example of an association with its ends named as verb phrases:

Here is an example of an association with its ends named as noun phrases:

Here is an example of an association with its ends named as prepositional phrases:

Reblog this post [with Zemanta]

No comments: