OWL 的 EquivalentClass 与 SubClassOf
等效类和子类有什么区别?在阅读 OWL Primer 时,我发现教程大量使用 SubClassOf 来声明新类,如下所示
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
)
)
)
吗?
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
)
)
)
Can I write
EquivalentClass(
:Teenager
DataSomeValuesFrom( :hasAge
DatatypeRestriction( xsd:integer
xsd:minExclusive "12"^^xsd:integer
xsd:maxInclusive "19"^^xsd:integer
)
)
)
instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当声明
A
是B
的子类时,这限制A
必须继承的所有特征B
,但反之则不然。在您的示例中,A
=Teenager
和B
=hasAge [12:19]
(我自己的符号,但你明白了)。这意味着 OWL 本体中
Teenager
的任何实例也必须具有属性hasAge
,其值在[12:19]
范围内,但不是相反。具体来说,这并不意味着任何具有属性hasAge
且值在[12:19]
范围内的实例也是Teenager< 的实例/代码>。为了清楚地说明这一点,请考虑类
Car
的一个实例(称为c
)。我们也可以这样说:c。 hasAge 13
这表示
Car
的实例c
已有 13 岁了。然而,通过上面定义Teenager
的子类公理,推理者将不会推断出c
也是青少年
(也许正如我们所希望的,如果青少年是人,而不是汽车)。使用等价时的区别在于,子类关系隐含双向。因此,如果我们改为包含第二个公理,将
Teenager
定义为 等价 具有属性hasAge
且值在范围内的任何内容[12:19]
,那么推理机就会推断出汽车c
也是Teenager
的实例。When stating that
A
is a subclass ofB
, this restrictsA
to necessarily inherit all characteristics ofB
, but not the other way around. In your example,A
=Teenager
, andB
=hasAge [12:19]
(my own notation, but you get the idea).This means that any instance of
Teenager
in the OWL ontology must necessarily also have the propertyhasAge
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 propertyhasAge
with a value in the range[12:19]
is also an instance ofTeenager
. To make this clear, consider an instance (calledc
) of classCar
. We might also say that:c . hasAge 13
This says that instance
c
ofCar
is 13 years old. However, with the subclass axiom definingTeenager
above, a reasoner would not infer thatc
is also an instance ofTeenager
(perhaps as we'd want, if teenagers are people, not cars).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 propertyhasAge
with a value in the range[12:19]
, then a reasoner would infer that the carc
is also an instance ofTeenager
.同等类别可能具有相同的成员,例如,
都具有相同的个人(全部或部分美国总统)。因此,如果我们断言约翰·亚当斯是美国三军总司令,则可以推断约翰·亚当斯也是美国总统。
对于子类,我们表示层次结构。例如,GrannySmithApple 是 Apple 的一种。
Equivalent classes might have the same members, e.g.,
will both have the same individuals (all or some of the US presidents). So if we assert that John Adams was a USCommanderInChief it can be inferred that John Adams was also a US President.
With subclass, we're indicating a hierarchy. e.g., GrannySmithApple is a type of Apple.
是一样的
is the same as