【问题标题】:How to infer individual with more than 2 property in owl如何推断猫头鹰中具有超过2个属性的个体
【发布时间】:2018-09-05 17:18:35
【问题描述】:

我有一个包含 Person 和 Animal_Lover 类的本体。如果人们拥有超过 2 只宠物,则他们是 Animal_Lover。如何在我的本体中做到这一点?

<?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>

我希望史密斯被推断并成为 Animal_Lover。 但是这段代码在owl(或GraphDB)中不起作用。 有什么问题?

感谢您的帮助。

【问题讨论】:

  • OWL -> 开放世界假设no 唯一名称假设

标签: owl ontology protege graphdb


【解决方案1】:

存在三个问题:

  1. 首先,“娜拉”和“坦克”很可能是宠物璐璐的两个昵称。因此,也许史密斯只有一只宠物,它的名字叫 Lulu,出于某些原因,人们喜欢叫它 Nala 或 Tank。
  2. 其次,只有使用hasOnwer 属性才能进行推理。您使用的是hasPet
  3. 第三,你没有说卢拉、娜拉和坦克是哺乳动物。如果它们是鱼,那么你不能推断史密斯是动物爱好者(!)

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-05-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-08
相关资源
最近更新 更多