Extend OWL class and check for inconsistencies

71 Views Asked by At

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?

2

There are 2 best solutions below

0
IS4 On

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 Hand is in a relation with at least one Span, and there is no triple that would contradict that.

There are no satisfactory ways to do this with OWL ‒ you could remove the rdfs:subClassOf in your ontology and then check with the reasoner that every member of Hand is also a member of your owl: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 particular Hand is linked to some Span, 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.

0
Henriette Harmse On

There are a number of issues here:

(1) I think how you specified the restriction is incorrect (or at least it is not read correctly by Protege - maybe a different ontology editor can make sense of this). The correct way to specify it is:

<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:allValuesFrom rdf:resource="http://example.org/test.owl#Span"/>
        </owl:Restriction>
    </rdfs:subClassOf>
    <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:maxCardinality>
        </owl:Restriction>
    </rdfs:subClassOf>
</rdf:Description>

(2) Due to the open world assumption, an OWL reasoner will only make inferences based on explicitly stated information or other inferences - not on the absence of information. Absence of information is assumed to be merely be unknown rather than to not exist. Thus, in your test it will not give an inconsistency because it is merely unknown whether your Hand instance is related to an instance of Span via isRegionFor. To test this, you need to make explicit that your hand instance does not have any relations via isRegionFor. I.e

<owl:NamedIndividual rdf:about="http://example.org/test.owl#hand">
    <rdf:type rdf:resource="http://www.ease-crc.org/ont/SOMA.owl#Hand"/>
    <rdf:type>
        <owl:Restriction>
            <owl:onProperty rdf:resource="http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#isRegionFor"/>
            <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:maxCardinality>
        </owl:Restriction>
    </rdf:type>
</owl:NamedIndividual>

With this test the reasoner will now complain.

(3) Namespaces are not the issue here at all. In reasoning namespaces will only be an issue if you use the same class/property name in different namespaces which have different axioms. From a reasoning perspective these classes/properties are in fact different (except when equivalence of the class/property is explicitly stated).

(4) owl:allValuesFrom may not the appropriate restriction to be used here. Assuming you want also state that your hand instance is related via isRegionFor to an instance of Arm, where Arm is disjoint with Span, it will result in an inconsistency. This is because owl:allValuesFrom force individuals only to be of type Hand. To cater for the possibility for a hand to be linked to an Arm or Span you may want to change your Hand definition to:

 <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:someValuesFrom rdf:resource="http://example.org/test.owl#Span"/>
        </owl:Restriction>
    </rdfs:subClassOf>
  </rdf:Description>