为什么此DL查询不返回任何个人? [英] Why is this DL-Query not returning any individuals?

查看:115
本文介绍了为什么此DL查询不返回任何个人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此DL查询不返回任何个人:

This DL-Query is not returning any individuals:

  • 查询(Protégé语法):hasPet exactly 1 DomesticAnimal

这是本体的一部分:

:hasPet a           owl:ObjectProperty;
        rdfs:domain :Human;
        rdfs:range  :DomesticAnimal;
        owl:inverseOf : petOf;


:Joe    a           :Human;
        hasPet      :Lassy.

:Bob    a           :Human;
        hasPet      :Sparkey, Lucky.

查询:

  • petOf value Bob返回SparkeyLucky
  • petOf value Joe返回Lassy
  • hasPet exactly 1不返回任何内容.
  • petOf value Bob returns Sparkey and Lucky
  • petOf value Joe returns Lassy
  • hasPet exactly 1 returns nothing.

为什么最后一个查询不返回Joe? 我已经在Péret,HermiT和FaCT ++的Protégé中进行了尝试,但没有成功.

Why isn't the last query returning Joe? I have tried it with in Protégé with Pellet, HermiT, and FaCT++, and it didn't work.

推荐答案

类表达式hasPet exactly 1 DomesticAnimal作为实例,具有与属性hasPet恰好与一个DomesticAnimal相关的个体. 恰好一个表示至少一个,并且不超过一个.基于三元组

The class expression hasPet exactly 1 DomesticAnimal has as instances exactly those individuals which are related by the property hasPet to exactly one DomesticAnimal. Exactly one means at least one and no more than one. Based on the triples

:Joe :hasPet :Lassy .
:Bob :hasPet :Sparkey ;
     :hasPet :Lucky .

我们知道,乔和鲍勃每个人都有至少一只宠物,但是我们对它们可能有多少只一无所知. Joe可能除了Lassy以外还养宠物,所以我们不知道Joe完全是一只宠物. Sparkey和Lucky可能碰巧是同一个人,因此Bob至少有一只宠物,但是对于Bob拥有的宠物数量我们没有上限.

we know that Joe and Bob each have at least one pet, but we do not know anything about how many they might have. Joe might have pets other than Lassy, so we don't know that Joe has exactly one pet. It is possible that Sparkey and Lucky happen to be the same individual, so Bob has at least one pet, but we do not have an upper bound on the number of pets that Bob has.

OWL和RDF进行开放世界假设,这意味着OWL并不假设所提供的数据是对世界上所有真实情况的详尽列举.如果这样做的话,就没有任何推论的意义.缺少s p o的断言并不表示NOT( s p o ),而是仅表示对s p o尚无判断.

OWL, as well as RDF, makes the open world assumption, which means that OWL does not assume that the data provided is an exhaustive enumeration of everything in the world that is true. If it did, there would be no point in inference. The absence of an assertion of s p o does not imply that NOT( s p o ), but rather just that there is no judgment yet on s p o.

不过,您可以在数据中添加更多知识以获得所需的结论.您用以下内容描述Joe:

You can add some more knowledge to your data to get the conclusions that you want, though. You describe Joe with the following:

Joe a Human ;
    hasPet Lassy ;
    hasPet only { Lassy } .

Lassy a DomesticAnimal .

由此您可以推断出

Joe a (hasPet exactly 1 DomesticAnimal) .

对于Bob来说,您似乎希望Sparkey和Lucky是不同的动物,所以您需要owl:differentFrom:

For Bob, it looks like you expect that Sparkey and Lucky are different animals, so you'll need owl:differentFrom:

Bob a Human ;
    hasPet Sparkey, Lucky .

Sparkey a DomesticAnimal .

Lucky a DomesticAnimal ; 
      owl:differentFrom Sparkey .

我没有在这些公理中包含Bob hasPet only { Sparkey, Lucky },因为它们不必推断鲍勃有多个宠物,但是您可以包括它.我还只包括了可能已经提出的owl:differentFrom断言之一.现在,已知鲍勃有两只与众不同的宠物,因此众所周知 not 不是hasPet exactly 1 DomesticAnimal.将此数据加载到Protégé中后,DL查询hasPet exactly 1 DomesticAnimal会按预期工作:

I did not include Bob hasPet only { Sparkey, Lucky } in these axioms, because they are not necessary to infer that Bob has more than one pet, but you could include it. I also included just one of the owl:differentFrom assertions that could have been made. Now Bob is known to have two distinct pets, and thus known to not be a hasPet exactly 1 DomesticAnimal. With this data loaded into Protégé, the DL query hasPet exactly 1 DomesticAnimal works as expected:

如果您希望能够将此结构快速加载到Protégé中,则这是一个如上所述的包含个人,财产和公理的本体.我没有定义petOf属性,但是您仍然可以将前两个查询分别作为inverse hasPet value Joeinverse hasPet value Bob运行,并获得预期的结果.

In case you want to be able to quickly load this structure into Protégé, here's an ontology with individuals, property, and axioms as described above. I did not define the petOf property, but you can still run your first two queries as inverse hasPet value Joe and inverse hasPet value Bob and get the expected results.

@prefix :        <http://www.example.com/owa#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owa:     <http://www.example.com/owa#> .

owa:Bob
      a       owl:NamedIndividual , owa:Human ;
      owa:hasPet owa:Sparkey , owa:Lucky .

owa:Sparkey
      a       owl:NamedIndividual , owa:DomesticAnimal .

owa:Lassy
      a       owl:NamedIndividual , owa:DomesticAnimal .

[]    a       owl:AllDifferent ;
      owl:distinctMembers (owa:Lucky owa:Sparkey) .

owa:Joe
      a       owl:NamedIndividual , owa:Human ;
      a       [ a       owl:Restriction ;
                owl:allValuesFrom
                        [ a       owl:Class ;
                          owl:oneOf (owa:Lassy)
                        ] ;
                owl:onProperty owa:hasPet
              ] ;
      owa:hasPet owa:Lassy .

<http://www.example.com/owa>
      a       owl:Ontology .

owa:Lucky
      a       owl:NamedIndividual , owa:DomesticAnimal .

owa:Human
      a       owl:Class .

owa:hasPet
      a       owl:ObjectProperty .

owa:DomesticAnimal
      a       owl:Class .

这篇关于为什么此DL查询不返回任何个人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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