Reputation: 6462
owl:inverseOf
is often used to define inverse relations between properties. An axiom of the form P1 owl:inverseOf P2
asserts that for every pair (x,y) in the property extension of P1, there is a pair (y,x) in the property extension of P2, and vice versa for example hasChild
and hasParent
.
How can I define such inverse relationships between object properties with multiple domains and ranges, such as:
hasOwner owl:inverseOf hasDog
hasOwner owl:inverseOf hasCat
Classes: Person, Dog, Cat
ObjectProperties: hasOwner, hasDog, hasCat
hasOwner:
Domains: Dog or Cat
Ranges: Person
hasDog:
Domains: Person
Ranges: Dog
hasCat:
Domains: Person
Ranges: Cat
If I known Mammy hasDog Spike
and Mammy hasCat Tom
, how can I model the ontology so that the reasoner can infer Spike hasOwner Mammy
and Tom hasOwner Mammy
?
Upvotes: 1
Views: 1143
Reputation: 5515
Forgetting about the incomprehensible restriction that anything that has an owner is either a cat or a dog, you can get closer to a reasonable model with (in Turtle syntax):
hasDog rdfs:subPropertyOf [ owl:inverseOf hasOwner ] .
hasCat rdfs:subPropertyOf [ owl:inverseOf hasOwner ] .
This has the non-advantage of not creating a new class name or a new property name.
PS: I do know things that have an owner and are neither cats nor dogs.
Upvotes: 4
Reputation: 4113
I think there is a flaw in your logic.
hasOwner owl:inverseOf hasDog
hasOwner owl:inverseOf hasCat
These two statements can only be true if hasCat
and hasDog
are identical. Think about it, if P1
is the inverse of P2
and the inverse of P3
, then by transitivity P2
must be the same as P3
.
You should rather have a predicate hasPet
as the inverse of hasOwner
, create a class Pet
and make Dog
and Cat
subclasses of it.
You could then make a rule to infer that from P1 hasPet P2
and P2 isA Cat
follows P1 hasCat P2
.
Upvotes: 1