0

I have a questioin about how to define two different idividuals in SWRQL. Here is an example. If B isSonOf A; If C isSonOf A; Then B and C are brothers. Here is the SWRL rule: isSunOf(?BB, ?AA) ^ isSunOf(?CC, ?AA) -> isBrotherOf(?BB, ?CC)

I found in the reasoned results, B is isBrotherOf B himself. How to avoid this problem?

Thank you! Best regards, Yang

yangz
  • 53
  • 5

1 Answers1

0

Use differentFrom(?a, ?b) i.e.:

isSonOf(?a, ?c) ^ isSonOf(?b, ?c) ^ differentFrom(?a, ?b) -> isBrotherOf(?a, ?b)

Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22
  • it should be mentioned that it works only if `owl:differentFrom` is set explicitly in the ontology given that there is no Unique Names Assumption in OWL and the rule won't match otherwise – UninformedUser May 20 '18 at 10:13