OWL:基于值的属性限制:有可能吗?
我寻找一个清晰的 OWL 解决方案来定义一个属性,该属性是另一个属性的限制,类似于等效的类。限制基于域或范围的数据属性。受限制的财产肯定是子财产,并且,必须推断。
“孩子”、“母亲”、“父亲”是 Person s father.gender = "男" 数据属性 mother.gender = "female"
(Male subclassOf Person = 等价类"性别值"male")
父亲parentOf child '对象关系 motherparentOfchild'对象关系
如何根据parentOf和父亲的性别定义fatherOf属性? 显然它是parentOf 的子属性。
然而,Protégé 中的等效对象属性编辑器不允许设置属性查询,即使我真的不知道这是否可以通过属性链来解决。
将fatherOf 定义为子属性并(手动)设置fatherOf 而不是parentOf 不是一个选项,因为此族示例是更复杂场景的过于简单化的情况。
<Declaration>
<Class IRI="#Person"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#fatherOf"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#parentOf"/>
</Declaration>
<Declaration>
<DataProperty IRI="#gender"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#father"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#kid"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#mother"/>
</Declaration>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#father"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#kid"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#mother"/>
</ClassAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#parentOf"/>
<NamedIndividual IRI="#father"/>
<NamedIndividual IRI="#kid"/>
</ObjectPropertyAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#parentOf"/>
<NamedIndividual IRI="#mother"/>
<NamedIndividual IRI="#kid"/>
</ObjectPropertyAssertion>
<DataPropertyAssertion>
<DataProperty IRI="#gender"/>
<NamedIndividual IRI="#father"/>
<Literal datatypeIRI="&rdf;PlainLiteral">male</Literal>
</DataPropertyAssertion>
<DataPropertyAssertion>
<DataProperty IRI="#gender"/>
<NamedIndividual IRI="#mother"/>
<Literal datatypeIRI="&rdf;PlainLiteral">female</Literal>
</DataPropertyAssertion>
<SubObjectPropertyOf>
<ObjectProperty IRI="#fatherOf"/>
<ObjectProperty IRI="#parentOf"/>
</SubObjectPropertyOf>
<DataPropertyDomain>
<DataProperty IRI="#gender"/>
<Class IRI="#Person"/>
</DataPropertyDomain>
<DataPropertyRange>
<DataProperty IRI="#gender"/>
<Datatype abbreviatedIRI="xsd:string"/>
</DataPropertyRange>
I look for a clearly OWL solution to define a property that is a restriction of another property, similar to an equivalent class. Restriction is based on data properties of either the domain or the range. The restricted property is definitely a subproperty, and, must be inferred.
"kid","mother","father" are Person s
father.gender = "male" data property
mother.gender = "female"
(a Male subclassOf Person = equivalent class "gender value "male")
father parentOf child ' object relation
mother parentOf child ' object relation
How to defined fatherOf property, based on parentOf and gender of father?
Clearly it is a subproperty of parentOf.
However, equivalent object property editor in Protégé does not allow setting a property query, even I do not really see if this can be solved with a property chain.
Defining fatherOf as subproperty and (manually) setting fatherOf instead of parentOf is not an option, since this family example is an oversimplified situation of a more complex scenario.
<Declaration>
<Class IRI="#Person"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#fatherOf"/>
</Declaration>
<Declaration>
<ObjectProperty IRI="#parentOf"/>
</Declaration>
<Declaration>
<DataProperty IRI="#gender"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#father"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#kid"/>
</Declaration>
<Declaration>
<NamedIndividual IRI="#mother"/>
</Declaration>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#father"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#kid"/>
</ClassAssertion>
<ClassAssertion>
<Class IRI="#Person"/>
<NamedIndividual IRI="#mother"/>
</ClassAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#parentOf"/>
<NamedIndividual IRI="#father"/>
<NamedIndividual IRI="#kid"/>
</ObjectPropertyAssertion>
<ObjectPropertyAssertion>
<ObjectProperty IRI="#parentOf"/>
<NamedIndividual IRI="#mother"/>
<NamedIndividual IRI="#kid"/>
</ObjectPropertyAssertion>
<DataPropertyAssertion>
<DataProperty IRI="#gender"/>
<NamedIndividual IRI="#father"/>
<Literal datatypeIRI="&rdf;PlainLiteral">male</Literal>
</DataPropertyAssertion>
<DataPropertyAssertion>
<DataProperty IRI="#gender"/>
<NamedIndividual IRI="#mother"/>
<Literal datatypeIRI="&rdf;PlainLiteral">female</Literal>
</DataPropertyAssertion>
<SubObjectPropertyOf>
<ObjectProperty IRI="#fatherOf"/>
<ObjectProperty IRI="#parentOf"/>
</SubObjectPropertyOf>
<DataPropertyDomain>
<DataProperty IRI="#gender"/>
<Class IRI="#Person"/>
</DataPropertyDomain>
<DataPropertyRange>
<DataProperty IRI="#gender"/>
<Datatype abbreviatedIRI="xsd:string"/>
</DataPropertyRange>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,您的数据中有类似以下内容:
并且您想推断:
恐怕您无法在 OWL 中执行此操作。对于像这样的情况,您可能需要依赖 SWRL、SPIN 等规则语言。但是,对于父亲、母亲等的特定情况,您可以执行以下操作:
:hasParent
作为:parentOf
的逆;:hasParent
的基数限制为 2;:hasFather
定义为:fatherOf
的逆;:hasFather
设为owl:FunctionalProperty
;:hasMother
定义为:motherOf
的逆;:hasMother
设为owl:FunctionalProperty
;:Man
;:Woman
;:Man
与:Woman
分离;:hasFather
的范围设置为:Man
;:hasMother
的范围设置为:Woman
。所以本体看起来像这样(在 Turtle 中,因为我不熟悉 OWL/XML):
这应该可以解决问题,但它是一个非常复杂的本体,用它进行推理可能会很慢。
编辑:我补充说
:gender
必须是功能性的,否则可能会有一个母亲同时也是一个父亲,这是行不通的!So, you have something like the following in your data:
and you would like to infer that:
I'm afraid you cannot do this in OWL. For cases like this one, you may want to rely on a rule language like SWRL, SPIN, etc. However, for the particular case of father, mother, etc, you could do the following:
:hasParent
as the inverse of:parentOf
;:hasParent
to 2;:hasFather
as the inverse of:fatherOf
;:hasFather
aowl:FunctionalProperty
;:hasMother
as the inverse of:motherOf
;:hasMother
aowl:FunctionalProperty
;:Man
of male people;:Woman
of female people;:Man
disjointWith:Woman
;:hasFather
to:Man
;:hasMother
to:Woman
.So the ontology looks like this (in Turtle because I'm not familiar with OWL/XML):
This should do the trick, but it's a very complicated ontology and reasoning with it may be very slow.
Edit: I added that
:gender
must be functional, otherwise there could be a mother who is at the same time a father and that would not work!