I want to extend the Hand class defined in SOMA in my own Ontology defined with namespace http://example.org/test.owl
<owl:Class rdf:about="http://www.ease-crc.org/ont/SOMA.owl#Hand">
<rdfs:subClassOf rdf:resource="http://www.ease-crc.org/ont/SOMA.owl#PrehensileEffector"/>
<rdfs:comment>A prehensile effector including palm, fingers, and thumb.</rdfs:comment>
<rdfs:isDefinedBy rdf:resource="http://www.ease-crc.org/ont/SOMA-OBJ.owl"/>
</owl:Class>
which would look something like
<rdf:Description rdf:about="http://www.ease-crc.org/ont/SOMA.owl#Hand">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#isRegionFor"/>
<owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
<owl:allValuesFrom rdf:resource="http://example.org/test.owl#Span"/>
</owl:Restriction>
</rdfs:subClassOf>
</rdf:Description>
Firstly, does this correctly define that every instance of Hand has to have at least one association with Span through isRegionFor property?
Now to test it, I created an instance of Hand (with SOMA namespace) without any association to Span and ran the Pellet reasoner, but the reasoner did not complain. Is this something to do with namespace of Hand (because I have extended it in an Ontology with new namespace) or some configuration of Pellet?
OWL follows the open-world assumption ‒ in order to report inconsistency, it is not enough that the graph is missing facts ‒ you have to disprove them explicitly; in other words, removing triples can never create a contradiction. Your ontology tells the reasoner that a
Handis in a relation with at least oneSpan, and there is no triple that would contradict that.There are no satisfactory ways to do this with OWL ‒ you could remove the
rdfs:subClassOfin your ontology and then check with the reasoner that every member ofHandis also a member of yourowl:Restriction. However, that does not require a "direct" proof, since you could assert this membership explicitly, i.e. a "malicious" graph could imply that a particularHandis linked to someSpan, but it has no obligation to identify that particular individual explicitly.OWL is not the right tool for the job, if you wish to validate graphs ‒ SHACL is better.