I am using Protege5.0, and i want to implement SWRL rule ie
User(?u), isInActivity(?u, ?cm), ContextMeeting(?cm) -> FamilyContact(?f), hasStatus(?f, "Reject")
which means "if user is in meeting then familycontact has status "reject".
This syntax should work and protege doesn't show any error. However, its not working. And when i write
User(?u), isInActivity(?u, ?cm), ContextMeeting(?cm), FamilyContact(?f) -> hasStatus(?f, "Reject")
This syntax works perfectly but its useless when i write complex rules in such format. Can anyone explain me the difference between the two formats and also give me a perfect solution?
More explanation:
i have a main class People & subclasses of People are Contact & User. The subclasses of Contact are FamilyContact, EmployeeContact etc. **The User and Contact are related by an object property isContactOf(People,Contact).In my ontology there should be only one individual of class User. Now, i want to implement SWRL rules, ie If **user is in meeting then FamilyContact hasStatus "Reject".** This reject simply means that Family members can not call the user. Other rule is If user is in meeting then EmployeeContact hasStatus "Pass". hasStatus(Contact,String) is a functional property.
the second rule syntax works perfectly, however when I want to implement a rule for those instances which are both EmployeeContact and FamilyContact then i get problem. eg if i write a rule i.e
User(?u), isInActivity(?u, ?cm), ContextMeeting(?cm), FamilyContact(?f), EmployeeContact(?e), DifferentFrom(?f,?e)-> hasStatus(?f, "Reject").
It works somehow but i get a problem. It makes the other instances of EmployeeContact also the Instances of FamilyContact and vice versa.
The rule
uses ?f in the right hand side (the consequent) of the rule, but not on the left (the antecedent). That's not allowed in the language (emphasis added):
If it were legal, then your rule would mean:
But since there are no constraints on ?f, this says that any user is in any context meeting, then everything is a family contact with status "reject", and that's probably not what you want. Shouldn't ?f be related to ?u somehow? The proposed alternative:
has a similar problem. It would mean:
There's still no connection between u and f, so this says that if any user is in any context meeting, then every family contact has status "reject". That doesn't seem like what you'd want either.