简体   繁体   English

owl:allValuesFrom和rdfs:范围差异

[英]owl:allValuesFrom and rdfs:range difference

I'm working on semantic webs and I'm wondering: is there any difference in a semanitc of writing a restriction like: 我正在研究语义网,我想知道:写一个限制的语义是否有任何区别:

:Person
  a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty :hasParent ;
      owl:allValuesFrom :Person
   ] .

and writing a range restriction like: 并编写范围限制,如:

:hasParent rdfs:range :Person.

It seems to me that it means the same: a parent has to have a type of Person. 在我看来,它意味着相同:父母必须有一种人。 Isn't there any difference? 没有任何区别吗?

The first snippet means that a :Person who has a parent necessarily have a :Person -parent. 第一个片段意味着a :Person拥有父母的人必须具有:Person -parent。 However, a :Dog may have a parent who is not a :Person , for instance. 但是,a :Dog可能有父母不是:Person ,例如。 The second snippet says that anything who has a parent necessarily has a :Person -parent, regardless of what this thing is. 第二个片段说任何拥有父母的人都必须拥有:Person -parent,无论这是什么东西。

Edit after krajol's comment: 在krajol的评论之后编辑:

The allValuesFrom restriction of the first snippet is not equivalent to: 第一个代码段的allValuesFrom限制不等同于:

:hasParent  rdfs:domain  :Person;
            rdfs:range   :Person .

In the case of the allValuesFrom restriction, it is still possible that there are parents that are not persons. allValuesFrom限制的情况下,仍然可能有父母不是人。 In the case of the rdfs:domain / rdfs:range combination, it is not possible. 对于rdfs:domain / rdfs:range组合,它是不可能的。 With allValuesFrom restrictions, it's possible to say that persons have person-parents and that dogs have dog-parents, etc. With domain/range, you cannot. 有了allValuesFrom限制,可以说人有父母,狗有狗父母等。有域/范围,你不能。

There's another difference worth noting. 还有另一个值得注意的区别。 When there are more than one rdfs:range (or rdfs:domain) triple on a class, the range or domain is the conjunction (intersection) of the stated ranges/domains. 当类上有多个rdfs:range(或rdfs:domain)三元组时,范围或域是所述范围/域的连接 (交集)。 See the RDFS spec , though the wording is ambiguous, and this post . 请参阅RDFS规范 ,虽然措辞含糊不清, 这篇文章

If inferencing is performed on the ontology, you'll find that rdfs:range/domain triples are inferred for all of the superclasses of the stated range/domain class(es). 如果在本体上执行推理,您将发现rdfs:range / domain三元组是针对所述范围/域类的所有超类推断的。 While semantically correct, this may be confusing or difficult to work with. 虽然在语义上是正确的,但这可能会令人困惑或难以使用。 This won't happen with allValuesFrom . allValuesFrom不会发生这种情况。

(Adding an answer to an already answered question since I found the essence of the accepted answer lacking.) (添加已经回答的问题的答案,因为我发现接受的答案的本质缺乏。)

[ a owl:Restriction ;
    owl:onProperty :hasParent ;
    owl:allValuesFrom :Person
]

can be read as "the class of all things for which any value for the hasParent predicate (potentially none) is of the type Person ". 可以读作“ hasParent谓词的任何值(可能没有)属于Person类型的所有事物的类”。

By saying that Person is a subclass of this class, we say that it is a more specialised version of this class. 通过说Person是这个类的子类,我们说它是这个类的一个更专业的版本。 So, Person still can only have other Person s as value for hasParent . 因此, Person仍然只能将其他Person作为hasParent值。

This differs from rdfs:range because we make no statement about the valid domain/range for hasParent itself. 这与rdfs:range不同,因为我们没有声明hasParent本身的有效域/范围。 To recycle Antoine's example , we can still say: 为了回收Antoine的例子 ,我们仍然可以说:

:dog1 a :Dog.
:dog2 a :Dog.
:dog1 :hasParent :dog2.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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