ontologyprotege4swrl

How to keep rule head as null using Protege swrl tab


I am trying to capture a conflict using SWRL rules. I learned that SWRL do support rules with empty head(consequent). But the Protege does not allow defining such rules. A dummy example of what I am trying to achieve is

Person(?x)^hasSon(?x,?y)^hasDaughter(?x,?y)->

Meaning that it is not possible that a person can be linked with a same individual both by hasSon and hasDaughter properties. If it is not possible in protege, please guide me on how to achieve this alternatively.


Solution

  • The rule body can be empty, but it does not imply a contradiction, as in your intentions; it is interpreted as the rule not applying. The specs are here.

    If I understand your intent correctly, what you are after can be achieved by creating two classes: define an exact cardinality restriction of 0 for hasSon and an exact cardinality restriction of 0 for hasDaughter, then assign these classes as range of hasDaughter and hasSon respectively.

    This way, stating that A hasSon B and A hasDaughter B will cause an inconsistency.