Reputation: 3281
Say I have a class "Adult" and a class "Child" and two object properties "isFatherOf " and "playsMonopolyWith". Suppose I want all fathers who play monopoly with their children. Now I could do a subclass like:
Adult
isFatherOf some Child
playsMonopolyWith some Child
But this isn't quite right since a father who plays monopoly only with other people's children would be included here. What a really want is:
Adult
(isFatherOf and PlaysMonopolyWith) some child
The child that the father plays monopoly with must be the same child that he is the father of.
This gives syntax error. So I'm guessing the description logic doesn't allow this sort of construct? Is there a work around?
Upvotes: 1
Views: 319
Reputation: 2949
In order to describe business logic, it is often preferable to use inference rules instead of OWL logic.
From your example, if you want a class NiceFather
for Father
s who playsMonopolyWith
their own Child
, here is what to do.
Go to "Window" > "Tabs", and check "SWRLTab", then go to the newly created "SWRLTab". Click on the "New" button.
Write the rule you described in your question. The syntax is pretty straightforward.
isFatherOf(?father, ?child) ^ playsMonopolyWith(?father, ?child) -> NiceFather(?father)
Click "Ok" to create the rule, and run the reasoner.
Here is a Gist that you can download and open in Protégé. As you can see Albert is a nice father because he plays Monopoly with his son Albert Jr. Bob, on the other hand, is not a nice father because he plays Monopoly with Albert Jr. instead of his own son Bob Jr. :)
Upvotes: 1