2

我寻找一个明确的 OWL 解决方案来定义一个属性,该属性是另一个属性的限制,类似于等效类。限制基于域或范围的数据属性。受限属性绝对是子属性,并且必须推断。

"kid","mother","father" 是 Person 的父亲.gender = "male" 数据属性 mother.gender = "female"

(男性 subclassOf Person = 等效类“性别值“男性”)

父亲 parentOf child ' 对象关系 母亲 parentOf child ' 对象关系

如何根据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>
4

1 回答 1

7

因此,您的数据中有以下内容:

:x  :parentOf  :y .
:x  :gender  "male" .

你想推断:

:x  :fatherOf  :y .

恐怕你不能在 OWL 中做到这一点。对于这种情况,您可能希望依赖于规则语言,如 SWRL、SPIN 等。但是,对于父亲、母亲等特定情况,您可以执行以下操作:

  • 定义:hasParent为 的倒数:parentOf
  • 将基数限制:hasParent为 2;
  • 定义:hasFather为 的倒数:fatherOf
  • :hasFather一个owl:FunctionalProperty
  • 定义:hasMother为 的倒数:motherOf
  • :hasMother一个owl:FunctionalProperty
  • 定义:Man男性阶层;
  • 定义:Woman女性阶层;
  • 使:MandisjointWith :Woman;
  • 将范围设置:hasFather:Man;
  • 将范围设置:hasMother:Woman

所以本体看起来像这样(在 Turtle 中,因为我不熟悉 OWL/XML):

:Person  a  owl:Class;
  rdfs:subClassOf  [
    a  owl:Restriction;
    owl:onProperty  :hasParent;
    owl:cardinality  2
  ] .
:Man  a  owl:Class;
  owl:equivalentclass  [
    a  owl:Class;
    owl:intersectionOf (
      :Person
      [
         a  owl:Restriction;
         owl:onProperty  :gender;
         owl:hasValue  "male";
      ]
    )
  ] .
:Woman  a  owl:Class;
  owl:equivalentclass  [
    a  owl:Class;
    owl:intersectionOf (
      :Person
      [
         a  owl:Restriction;
         owl:onProperty  :gender;
         owl:hasValue  "female";
      ]
    )
  ] .
:gender  a  owl:DatatypeProperty, owl:FunctionalProperty .
:hasParent  a  owl:ObjectProperty;
  owl:inverseOf  :parentOf;
  rdfs:domain  :Person;
  rdfs:range  :Person .
:hasFather  a  owl:ObjectProperty, owl:FunctionalProperty;
  rdfs:subPropertyOf  :hasParent;
  rdfs:range  :Man .
:hasMother  a  owl:ObjectProperty, owl:FunctionalProperty;
  rdfs:subPropertyOf  :hasParent;
  rdfs:range  :Woman .

这应该可以解决问题,但它是一个非常复杂的本体,使用它进行推理可能非常缓慢。

编辑:我补充说:gender必须是功能性的,否则可能会有一个母亲同时是父亲,这将不起作用!

于 2012-03-10T21:25:43.650 回答