I am using Protege 4.3 to make some SWRL rules.
I have one class called "Person" with one property called "name".
I created individuals from the class with different names, and some names are the same.
I want to write a rule that creates instances of Property called "sameName" to bind people who have the same name. So I wrote the following rule :
Person(?p1), Person(?p2), name(?p1, ?n1), name(?p2, ?n2), equal(?n1, ?n2) -> sameName(?p1, ?p2)
The rule gave the right result but includes every person with himself, means compares also every person with himself, so I added notEqual(?p1,?p2) to force the reasoner to not compare a person with himself like this:
Person(?p1), Person(?p2), name(?p1, ?n1), name(?p2, ?n2), equal(?n1, ?n2), notEqual(?p1, ?p2) -> sameName(?p1, ?p2)
The result was empty. Did I miss something?