Search code examples
protegeswrl

How to define DifferentIndividuals in SWRL rule in protege


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


Solution

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

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