Search code examples
owlontologyprotege

OWL Ontology: Individuals are not inferred as members of classes that use Data property in their class expression


The problem I am facing is that reasoners (e.g. Pellet) do not categorise individuals into classes whose definitions make use of a data property restriction.

I have created a minimal OWL ontology example (based on the famous pizza example) in protege 5 to illustrate this problem.

There are three classes: MarghartiaPizza, LowCaloriePizza, HighCaloriePizza. There is a hasCalorificContentValue data property. There are two individuals of the MarghartiaPizza class, ExampleMarghartiaPizza and QuattroFormaggio, with 263 and 723 values respectively as their hasCalorificContentValue.

The HighCaloriePizza and LowCaloriePizza classes are defined as those with >=400, respectively <400, value along hasCalorificContentValue.

The question is, why doesn't the reasoner infer that the two individuals belong to the HighCaloriePizza and LowCaloriePizza classes based on their values?

is there anything wrong with syntax of my class expressions in High/LowCaloriePizza or the hasCalorificContentValue?

You should be able to copy/paste the code into a file, open it with protege 5, and try running the Pellet reasoner.

<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
 xml:base="http://www.pizza.com/ontologies/pizza.owl"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:xml="http://www.w3.org/XML/1998/namespace"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 ontologyIRI="http://www.pizza.com/ontologies/pizza.owl"
 versionIRI="http://www.pizza.com/ontologies/pizza.owl/v1.0">
<Prefix name="" IRI="http://www.pizza.com/ontologies/pizza.owl"/>
<Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
<Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
<Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
<Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
<Declaration>
    <Class IRI="#HighCaloriePizza"/>
</Declaration>
<Declaration>
    <Class IRI="#LowCaloriePizza"/>
</Declaration>
<Declaration>
    <Class IRI="#MargheritaPizza"/>
</Declaration>
<Declaration>
    <DataProperty IRI="#hasCalorificContentValue"/>
</Declaration>
<Declaration>
    <NamedIndividual IRI="#ExampleMargherita"/>
</Declaration>
<Declaration>
    <NamedIndividual IRI="#QuattroFormaggio"/>
</Declaration>
<EquivalentClasses>
    <Class IRI="#HighCaloriePizza"/>
    <DataSomeValuesFrom>
        <DataProperty IRI="#hasCalorificContentValue"/>
        <DatatypeRestriction>
            <Datatype abbreviatedIRI="xsd:integer"/>
            <FacetRestriction facet="http://www.w3.org/2001/XMLSchema#minInclusive">
                <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#integer">400</Literal>
            </FacetRestriction>
        </DatatypeRestriction>
    </DataSomeValuesFrom>
</EquivalentClasses>
<EquivalentClasses>
    <Class IRI="#LowCaloriePizza"/>
    <DataSomeValuesFrom>
        <DataProperty IRI="#hasCalorificContentValue"/>
        <DatatypeRestriction>
            <Datatype abbreviatedIRI="xsd:integer"/>
            <FacetRestriction facet="http://www.w3.org/2001/XMLSchema#maxExclusive">
                <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#integer">400</Literal>
            </FacetRestriction>
        </DatatypeRestriction>
    </DataSomeValuesFrom>
</EquivalentClasses>
<ClassAssertion>
    <Class IRI="#MargheritaPizza"/>
    <NamedIndividual IRI="#ExampleMargherita"/>
</ClassAssertion>
<ClassAssertion>
    <Class IRI="#MargheritaPizza"/>
    <NamedIndividual IRI="#QuattroFormaggio"/>
</ClassAssertion>
<DataPropertyAssertion>
    <DataProperty IRI="#hasCalorificContentValue"/>
    <NamedIndividual IRI="#ExampleMargherita"/>
    <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#integer">263</Literal>
</DataPropertyAssertion>
<DataPropertyAssertion>
    <DataProperty IRI="#hasCalorificContentValue"/>
    <NamedIndividual IRI="#QuattroFormaggio"/>
    <Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#integer">723</Literal>
</DataPropertyAssertion>
<FunctionalDataProperty>
    <DataProperty IRI="#hasCalorificContentValue"/>
</FunctionalDataProperty>
</Ontology>

Here is a screenshot of the protege application with Pellet running. As you can see, the HighCaloriePizza is selected but QuattroFormaggio is not present under 'instances'.

enter image description here


Solution

  • Make sure the "Show Inferences" checkbox at the bottom right is checked!

    P.S. The screen shot does not correspond with the minimal example sent above, but checking the box will make the minimal example work too.

    enter image description here