简体   繁体   中英

How to infer a restriction in a class based on the restrictions of that class's subclasses, in owl?

So, for example, I have a ontology with the classes Fruit and Vitamin. The class Fruit has only Orange and Banana as subclasses, and the class Vitamin has only VitaminC and VitaminB as subclasses. These subclasses are all disjoint from each other.

I also have a object property Provide, with the class Fruit as domain and Vitamin as range.

Then, I defined the restrictions: "Orange Provide some VitaminC" and "Banana Provide some VitaminB".

Is there a way so I can make a reasoner infer that "Fruit Provide some Vitamin" in this situation?

I'm using the owlapi to do this, but I also use Protege, so answers using any of those would be nice.

If this is not enough information, please let me know. Thanks!

<?xml version="1.0"?>


<!DOCTYPE rdf:RDF [
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>


<rdf:RDF xmlns="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#"
     xml:base="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <owl:Ontology rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5"/>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Object Properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->




    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provide -->

    <owl:ObjectProperty rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provide"/>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideB -->

    <owl:ObjectProperty rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideB">
        <rdfs:subPropertyOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provide"/>
        <owl:propertyDisjointWith rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideC"/>
        <rdfs:domain>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideB"/>
                <owl:allValuesFrom rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Banana"/>
            </owl:Restriction>
        </rdfs:domain>
        <rdfs:range>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideB"/>
                <owl:allValuesFrom rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#B"/>
            </owl:Restriction>
        </rdfs:range>
    </owl:ObjectProperty>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideC -->

    <owl:ObjectProperty rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideC">
        <rdfs:subPropertyOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provide"/>
        <rdfs:domain>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideC"/>
                <owl:allValuesFrom rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Orange"/>
            </owl:Restriction>
        </rdfs:domain>
        <rdfs:range>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#provideC"/>
                <owl:allValuesFrom rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#C"/>
            </owl:Restriction>
        </rdfs:range>
    </owl:ObjectProperty>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->




    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#A -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#A">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Vitamin"/>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#B -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#B">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Vitamin"/>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Banana -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Banana">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Fruit"/>
        <owl:disjointWith rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Orange"/>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#C -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#C">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Vitamin"/>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Fruit -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Fruit">
        <owl:equivalentClass>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Banana"/>
                    <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Orange"/>
                </owl:unionOf>
            </owl:Class>
        </owl:equivalentClass>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Orange -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Orange">
        <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Fruit"/>
    </owl:Class>



    <!-- http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Vitamin -->

    <owl:Class rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#Vitamin">
        <owl:equivalentClass>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#A"/>
                    <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#B"/>
                    <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#C"/>
                </owl:unionOf>
            </owl:Class>
        </owl:equivalentClass>
    </owl:Class>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // General axioms
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

    <rdf:Description>
        <rdf:type rdf:resource="&owl;AllDisjointClasses"/>
        <owl:members rdf:parseType="Collection">
            <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#A"/>
            <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#B"/>
            <rdf:Description rdf:about="http://www.semanticweb.org/i.gurjanov/ontologies/2014/8/untitled-ontology-5#C"/>
        </owl:members>
    </rdf:Description>
</rdf:RDF>



<!-- Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net -->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM