Defining a complex SWRL rule in OWL 2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Defining a complex SWRL rule in OWL 2

moodamultani

Hello colleagues,

 

In my Faculty ontology, I have a Concept C which has an instance direct_entrant whose annotation property is set to a Literal 'type of student' as written in OWL 2 below:

 

<AnnotationAssertion>

<AnnotationProperty abbreviatedIRI="rdfs:comment"/>

<IRI>#direct_entrant</IRI>

<Literal datatypeIRI="&rdfs;Literal">type of student</Literal>

</AnnotationAssertion>

 

Also, the Concept C has another individual called student and an object property isEntitySubClassOf with Domain and Range of this property set to Concept C.

 

My ontology also conceptualises relationships (taxonomic and non-taxonomic) within individuals. The relationship concept is CRelationship having its sub-concepts as IsARelationship and NonTaxonomicRelationship.

 

My aim is to infer with the help of SWRL rule that direct_entrant has an IsARelationship with student at individual level. In other words, my SWRL Rule first needs to obtain the substring AFTER 'type of' in annotation literal (if it exists) of the individual x which is the name of another individual y. Then, the rule should look for an individual of concept C which has the same name as y. If found, the property isEntitySubClassOf should bind x and y such that isEntitySubClassOf(?x, ?y).

 

C(?x), swrlb:matches(
         swrlb:substringAfter((?x).hasAnnotation(not null), 'type of '), C(?y))

-> isEntitySubClassOf(?x, ?y)

 

I have written it similar to how rules are written in Protégé 4.3, but there is a problem (please see in red).

I need to find a way to write the value in annotation assertion for this individual. The above seems to be absurd but I have just written something not knowing how to access annotation literals for individuals. I think I can write some OWL way to access annotation literal here...but what would that be?

 

Could you please help me try understand the correct way of accessing annotation literal?

 

Very grateful for your response,

 

Mahmood


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback