How to infer individual with more than 2 property in owl

蹲街弑〆低调 提交于 2019-12-11 10:46:20

问题


I have an ontology with Person and Animal_Lover classes. People are Animal_Lover if they have more than 2 pet. How can I do this in my ontology?

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.example.com/test"
 xml:base="http://www.example.com/test"
 xmlns:test="http://www.example.com/test#"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:owl="http://www.w3.org/2002/07/owl#"
 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#">
 <owl:Ontology rdf:about="http://www.example.com/test"/>

 <owl:ObjectProperty rdf:about="http://www.example.com/test#hasPet"/>

    <owl:Class rdf:about="http://www.example.com/test#Animal_Lover">
    <owl:equivalentClass>
        <owl:Restriction>
            <owl:onProperty rdf:resource="http://www.example.com/test#hasOwner"/>
            <owl:minQualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">2</owl:minQualifiedCardinality>
            <owl:onClass rdf:resource="http://www.example.com/test#Mammal"/>
        </owl:Restriction>
    </owl:equivalentClass>
    <rdfs:subClassOf rdf:resource="http://www.example.com/test#Person"/>
 </owl:Class>

 <!-- http://www.example.com/test#Mammal -->

 <owl:Class rdf:about="http://www.example.com/test#Mammal"/>

 <!-- http://www.example.com/test#Person -->

 <owl:Class rdf:about="http://www.example.com/test#Person">
    <rdfs:subClassOf rdf:resource="http://www.example.com/test#Mammal"/>
 </owl:Class>
    <!-- http://www.example.com/test#Smith -->

 <owl:NamedIndividual rdf:about="http://www.example.com/test#Smith">
    <rdf:type rdf:resource="http://www.example.com/test#Person"/>
    <test:hasPet rdf:resource="http://www.example.com/test#Lulu"/>
    <test:hasPet rdf:resource="http://www.example.com/test#Nala"/>
    <test:hasPet rdf:resource="http://www.example.com/test#Tank"/>
 </owl:NamedIndividual>

</rdf:RDF>

I want Smith to be inferred and become Animal_Lover. But This code does not work in owl( or GraphDB). What is the problem?

Thanks for your help.


回答1:


There are three problems:

  1. First, it is quite possible that "Nala" and "Tank" are two nicknames of the pet Lulu. So perhaps Smith only has one pet, whose name is Lulu and that people like to call Nala, or Tank, for some reasons.
  2. Second, the inference can only happen if you use the hasOnwer property. You are using hasPet instead.
  3. Third, you did not say that Lula, Nala, and Tank are mammals. If they are fishes, then you can't infer that Smith is an animal lover (!)


来源:https://stackoverflow.com/questions/52190422/how-to-infer-individual-with-more-than-2-property-in-owl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!