I am trying to convert a UML Class Diagram into an Ontoloy and I have a Question.
Let's say I have the following setup:
rel1
ClassA ------> ClassB
rel1
ClassC ------> ClassD
For the first case I converted the Relation "rel1" to an Object Property as follows:
_x:rel1 rdf:type owl:ObjectProperty ;
rdfs:domain _x:ClassA ;
rdfs:range _x:ClassB .
But I don't know how to go about the Second one. What I want to have is: rel1 has the domain-range pair (ClassA,ClassB) OR (ClassC, ClassD). First I thought about using a union, but it doesn't model it in an appropriate way, because combinations like (ClassA, ClassD) or (ClassC, ClassB) could be possible.
I hope somebody can help.
Thank you, John
What your
rel1
association is saying is that it has as domain the union ofClassA
andClassC
with the range the union ofClassB
andClassD
, which you can specify as follows:The main benefit of specifying domain and range restrictions for a property is that if 2 individuals are linked via that property, the reasoner can infer the types of the individuals. Specifying the domain and range as stated above will not allow this because
ClassA or ClassC
is an anonymous class and reasoners typically only give inferences on named classes, not anonymous classes. To get around this you can do the following: