如何推断猫头鹰中具有2个以上属性的个人 [英] How to infer individual with more than 2 property in owl

查看:88
本文介绍了如何推断猫头鹰中具有2个以上属性的个人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Person和Animal_Lover类的本体.如果他们拥有2个以上的宠物,则它们是Animal_Lover.我该如何在本体中做到这一点?

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>

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

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

感谢您的帮助.

推荐答案

存在三个问题:

  1. 首先,"Nala"和"Tank"很有可能是宠物露露的两个昵称.因此,也许史密斯只有一只宠物,名字叫露露(Lulu),出于某种原因,人们喜欢叫纳拉(Nala),也就是坦克.
  2. 第二,仅当使用hasOnwer属性时,才能进行推断.您使用的是hasPet.
  3. 第三,您不是说卢拉(Lula),纳拉(Nala)和坦克(Tank)是哺乳动物.如果它们是鱼,那么您无法推断史密斯是动物爱好者(!)
  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 (!)

这篇关于如何推断猫头鹰中具有2个以上属性的个人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆