I am working in an ontology, and I have the following swrl rule:
User(?u) ^ Project(?p) ^ isRelatedTo(?u, ?p) ^ isMemberOf(?u, ?p) -> verifiedAssociation(?u, ?p)
And I would like to know when a Negative Object Property Assertion happens (when verifiedAssociation is not true).
I found on Protégé the tab Property Assertions, but I would like this to be inferred (by the reasoner). And I don't know how to create a rule to make this happen.
Could someone please help me?
There is no way to achieve that inference through a rule. Reason being that what you need sort of is to be able to say that
User(?u) ^ Project(?p) ^ isNotRelatedTo(?u, ?p) ^ isNotMemberOf(?u, ?p)
-> unverifiedAssociation(?u, ?p)
but you need to say that ?u
is not related to any ?p
, not only as specific ?p. This falls outside to scope of rules and outside the scope of OWL/DLs because it requires a form of closed world reasoning rather open world reasoning.
To achieve your desired result you need to close your world in some way. So you have users that are either assigned to a project or they are not assigned as yet. Let us introduce NoProject
class which is disjoint with Project
. You then add a rule
User(?u) ^ NoProject(?p)
-> unverifiedAssociation(?u, ?p)
where unverifiedAssociation
is disjoint with verifiedAssociation
.
You may also want to look at the Individual with “null” object property Stack Overflow question.
Update
SWRL does not support negation according to the SWRL FAQ. The only way is to define duals of your object properties that are disjoint. I.e.,
ObjectProperty: isMemberOf
ObjectProperty: isNotMemberOf
DisjointWith: isMemberOf
Do similar for VerifiedAssociation
and NotVerifiedAssociation
. Then you define your rule in a positive form:
User(?u) ^ Project(?p) ^ isRelatedTo(?u, ?p) ^ isNotMemberOf(?u, ?p)
-> NotVerifiedAssociation(?u, ?p)