【问题标题】:OWL: property restriction based on values: is it possible at all?OWL:基于价值的财产限制:有可能吗?
【发布时间】:2012-03-12 20:42:31
【问题描述】:

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

"kid","mother","father" 是 Person 的 父亲.性别=“男性”数据属性 mother.gender = "女性"

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

father parentOf child ' 对象关系 mom 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>

【问题讨论】:

    标签: semantic-web owl protege4


    【解决方案1】:

    所以,您的数据中有如下内容:

    :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
    • make :Man disjointWith :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必须是功能性的,否则可能有一个母亲同时是父亲,这将不起作用!

    【讨论】:

    • 谢谢,Antoine,诀窍是让 parentOf 和 motherOf 子属性成为 parentOf 并限制它们的范围!剩下的留给推理者 - 尽管时间在一组 60.000 个节点中并不是无关紧要的......
    猜你喜欢
    • 2017-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-22
    • 2022-01-15
    • 1970-01-01
    相关资源
    最近更新 更多