带限制的OWL类型推断 [英] OWL type inference with a restriction
问题描述
我正在使用FaCT ++和琐碎的本体研究Protege 4中OWL限制的概念.假设我有一个Something
类的单独的foo
:
I am studying the notion of OWL restrictions with Protege 4 using FaCT++ and a trivial ontology. Suppose I have an individual foo
of class Something
:
:Something a owl:Class.
:foo a :Something, owl:NamedIndividual.
和根据对hasBar
属性的限制定义的另一个类:
and another class defined from a restriction on the hasBar
property:
:hasBar a owl:ObjectProperty.
:SomethingElse owl:equivalentClass [a owl:Restriction;
owl:onProperty :hasBar;
owl:allValuesFrom :Something].
如果我断言:
:x :hasBar :foo.
为什么不能从中推断出x
是SomethingElse
(通过foo
是Something
的事实)?使它起作用的唯一方法是,如果定义了hasBar
的range
:
why can't I infer from it that x
is a SomethingElse
(via the fact that foo
is a Something
)? The only way I can make it work is if the range
of hasBar
is defined:
:hasBar a owl:ObjectProperty;
rdfs:range :Something.
但是我想避免这种情况,因为它限制了hasBar
的主题(这给我带来了进一步的麻烦).
But I'd like to avoid that, because it puts a constraint on what can be the subject of hasBar
(which causes me further trouble).
推荐答案
我认为对实际示例进行推理更简单,让我们考虑以下知识库:
I think it is simpler to reason over real examples, let's consider the following knowledge base:
:eats rdf:type owl:ObjectProperty .
:Vegetable rdf:type owl:Class ;
rdfs:subClassOf owl:Thing .
:Vegetarian rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :eats ;
owl:allValuesFrom :Vegetable
] .
:Carrot rdf:type :Vegetable ,
owl:NamedIndividual .
:John rdf:type owl:NamedIndividual , owl:Thing ;
:eats :carrot .
与您的示例等效:hasBar
是eats
,Vegetarian
是SomethingElse
,Vegetable
是Something
,foo
是carrot
,最后x
是
You have some equivalences with your example: hasBar
is eats
, Vegetarian
is SomethingElse
, Vegetable
is Something
, foo
is carrot
and finally x
is John
.
现在,您想推断出John
是Vegetarian
(= x
是SomethingElse
).
Now you would like to infer that John
is a Vegetarian
(= x
is SomethingElse
).
在owl:allValuesFrom
下不起作用是有道理的.您在这里所说的是所有素食主义者,如果有一个属性,则必须有蔬菜.因此,您可以推断出carrot
是一种蔬菜,假设您首先我会知道约翰是素食主义者.
It makes sense that it doesn't work with an owl:allValuesFrom
. What you are saying here is that all instances of vegetarian, if they have a property, they must have Vegetable in range. So from that you could deduce that carrot
is a vegetable for example, assuming you would know that John is a vegetarian in the first place.
这在自然语言中也是有道理的:在您的本体论中,您只知道约翰吃胡萝卜,但这并不能自动使他成为素食主义者(非素食人士也吃胡萝卜).
It makes sense in natural language too: In your ontology you only know that John eats a carrot, this doesn't automatically make him a vegetarian (non-vegetarian people eat also carrots).
您可以使用owl:someValuesFrom
代替owl:allValuesFrom
.这样,您就可以定义每个素食者都有一个吃蔬菜的人.在这种情况下,如果我们知道John吃了胡萝卜,那么根据您对素食主义者概念的定义,推理机会将他归类为素食主义者.
You could use a owl:someValuesFrom
instead of a owl:allValuesFrom
. This way, you would define every vegetarian has someone that eats some vegetable. In this case if we know that John eats a carrot, therefore he would be classified as vegetarian by the reasoner, based on your definition of the concept vegetarian.
通用(allValuesFrom
)和存在(someValuesFrom
)限制很难理解,通常没有对或错的解决方案,这主要取决于您要实现的目标.
Universal (allValuesFrom
) and existential (someValuesFrom
) restrictions are complicated to understand, there is often no right or wrong solution, it mostly depends to what you want to achieve.
这篇关于带限制的OWL类型推断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!