Search code examples
rdfsemantic-webowlrdfs

why inference is not working well


I have two ontologies which i join them together in one big ontology

This is in the big ontology

  <!-- http://www.MusicSemanticOntology/mso#r1 -->

    <owl:NamedIndividual rdf:about="http://www.MusicSemanticOntology/mso#r1">
        <rdf:type rdf:resource="http://semanticrecommender.com/rs#Rates"/>
        <rs:about rdf:resource="http://music.org/musicontology/mo#5th_Symphony"/>
        <rs:createdOn rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">1956-06-25T04:00:00-05:00</rs:createdOn>
        <rs:ratesBy rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1.0</rs:ratesBy>
    </owl:NamedIndividual>
</rdf:RDF>

as you see, the instance r1 is from Rangs and it has createdOn and has ratesBy predicate

I have this class:

<!-- http://semanticrecommender.com/rs#Likes -->

<owl:Class rdf:about="http://semanticrecommender.com/rs#Likes">
    <rdfs:subClassOf>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://semanticrecommender.com/rs#Rates"/>
                <owl:Class>
                    <owl:unionOf rdf:parseType="Collection">
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="http://semanticrecommender.com/rs#ratesBy"/>
                            <owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">0.8</owl:hasValue>
                        </owl:Restriction>
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="http://semanticrecommender.com/rs#ratesBy"/>
                            <owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">0.9</owl:hasValue>
                        </owl:Restriction>
                        <owl:Restriction>
                            <owl:onProperty rdf:resource="http://semanticrecommender.com/rs#ratesBy"/>
                            <owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1.0</owl:hasValue>
                        </owl:Restriction>
                    </owl:unionOf>
                </owl:Class>
            </owl:intersectionOf>
        </owl:Class>
    </rdfs:subClassOf>
</owl:Class>

why the r1 is not being form class likes when i run the reaonsoner? though the value of its rangeBy is 1 and it has the relattion about, and it has the un mandatory createdOn predicate and the value of about (which is the 5th_syphony) is from type Recommendable


Solution

  • It doesn't infer that r1 is of type Likes because it does not have sufficient information to do so.

    You have defined your class Likes as a subclass of your restrictions. This means that you have defined necessary conditions for class membership (that is, if something is an instance of Likes, then it must have the necessary property values), but you haven't defined that these conditions are also sufficient (that is, if something has these property values, then it must be an instance of Likes). It is perfectly valid for something to have the specified ratesBy values and yet not be an instance of the Likes class. A fix for this is to define it as an owl:equivalentClass instead of a rdfs:subClassOf.