问题描述
的EquivalentClass和SubClass有什么区别?在阅读OWL入门时,我发现本教程大量使用SubClassOf来声明一个新类,如下所示:
What is the difference between EquivalentClass and SubClass of? While reading through OWL primer, i find the tutorial uses SubClassOf a lot to declare a new class, as follows
SubClassOf(
:Teenager
DataSomeValuesFrom( :hasAge
DatatypeRestriction( xsd:integer
xsd:minExclusive "12"^^xsd:integer
xsd:maxInclusive "19"^^xsd:integer
)
)
)
我可以写
EquivalentClass(
:Teenager
DataSomeValuesFrom( :hasAge
DatatypeRestriction( xsd:integer
xsd:minExclusive "12"^^xsd:integer
xsd:maxInclusive "19"^^xsd:integer
)
)
)
相反?
推荐答案
在声明A
是 B
的子类时,这限制了A
必然继承B
,,反之亦然.在您的示例中,A
= Teenager
和B
= hasAge [12:19]
(我自己的符号,但是您知道了).
When stating that A
is a subclass of B
, this restricts A
to necessarily inherit all characteristics of B
, but not the other way around. In your example, A
= Teenager
, and B
= hasAge [12:19]
(my own notation, but you get the idea).
这意味着OWL本体中的Teenager
的任何实例还必须具有hasAge
属性,其值在[12:19]
范围内,但 不是 .具体来说,这并不意味着具有属性hasAge
且值在[12:19]
范围内的任何事物的实例也是Teenager
的实例.为了清楚起见,请考虑类Car
的实例(称为c
).我们也可以这样说:
This means that any instance of Teenager
in the OWL ontology must necessarily also have the property hasAge
with a value in the range [12:19]
, but not the other way around. Specifically, this does not mean that any instance of something with the property hasAge
with a value in the range [12:19]
is also an instance of Teenager
. To make this clear, consider an instance (called c
) of class Car
. We might also say that:
c . hasAge 13
这表示Car
的实例c
已经13岁了.但是,在上面定义Teenager
的子类公理中, reasoner 不会 推断c
也是Teenager
的实例(也许是我们想要的) ,如果青少年是人,而不是汽车).
This says that instance c
of Car
is 13 years old. However, with the subclass axiom defining Teenager
above, a reasoner would not infer that c
is also an instance of Teenager
(perhaps as we'd want, if teenagers are people, not cars).
使用对等关系时的区别在于,子类关系隐含在两个方向上.因此,如果我们改为包含第二个公理,该公理将Teenager
定义为等价到任何具有hasAge
属性且值在[12:19]
范围内的东西,则推理程序会推断出汽车c
也是Teenager
的实例.
The difference when using equivalence is that the subclass relationship is implied to go in both directions. So, if we were to instead include the second axiom that defined Teenager
to be equivalent to anything with the property hasAge
with a value in the range [12:19]
, then a reasoner would infer that the car c
is also an instance of Teenager
.
这篇关于OWL的EquivalentClass与SubClassOf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!