推理数据类型属性

时间:2014-02-18 15:45:38

标签: owl ontology protege

我是这个本体论的新手。我现在正在使用protege。我有2个BT和Document课程。我创建了2个对象属性1.主题(域:文档,范围:BT)2。hasDocument(主题的反向属性)。

我创建了一个名为title的DataType属性(Domain:Document Range:Literal)。

以下是我创建的属性的样本

  1. BT hasDocument Document
  2. 文档主题BT
  3. 文件标题“TestingName”
  4. 我不知道如何创建一个推断出以下结果的属性

    BT newProperty“TestingName”

1 个答案:

答案 0 :(得分:0)

如果我理解你的问题,你希望能够从

推断出来
docX topic someTopic 
docX title "SampleTitle"
someTopic hasDocumentWithTitle "SampleTitle"

你几乎可以通过一个属性链来做这件事,声称hasDocumentWithTitle具有链(inverse topic) o title的子属性。不幸的是,在OWL中,属性链不能以数据类型属性结束,因此您无法执行此操作。但是,您可以使用SWRL规则,许多OWL2 reasoners处理SWRL规则。您将使用以下形式的规则:

  

主题(?doc,?topic)∧title(?doc,?title)→hasDocumentWithTitle(?topic,?title)

例如,我们可以使用以下本体在Protege中获得以下结果:

result in Protege

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rule-example="http://www.example.org/rule-example#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:swrl="http://www.w3.org/2003/11/swrl#"
    xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <owl:Ontology rdf:about="http://www.example.org/rule-example"/>
  <owl:Class rdf:about="http://www.example.org/rule-example#Document"/>
  <owl:Class rdf:about="http://www.example.org/rule-example#Topic"/>
  <owl:ObjectProperty rdf:about="http://www.example.org/rule-example#hasTopic"/>
  <owl:DatatypeProperty rdf:about="http://www.example.org/rule-example#hasTitle"/>
  <owl:DatatypeProperty rdf:about="http://www.example.org/rule-example#hasDocumentWithTitle"/>
  <owl:NamedIndividual rdf:about="http://www.example.org/rule-example#doc42">
    <rdf:type rdf:resource="http://www.example.org/rule-example#Document"/>
    <rule-example:hasTitle>Document Number Forty-Two</rule-example:hasTitle>
    <rule-example:hasTopic>
      <owl:NamedIndividual rdf:about="http://www.example.org/rule-example#topic101">
        <rdf:type rdf:resource="http://www.example.org/rule-example#Topic"/>
        <rule-example:hasTopic rdf:resource="http://www.example.org/rule-example#topic101"/>
      </owl:NamedIndividual>
    </rule-example:hasTopic>
  </owl:NamedIndividual>
  <swrl:Imp>
    <swrl:head>
      <swrl:AtomList>
        <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
        <rdf:first>
          <swrl:DatavaluedPropertyAtom>
            <swrl:propertyPredicate rdf:resource="http://www.example.org/rule-example#hasDocumentWithTitle"/>
            <swrl:argument2>
              <swrl:Variable rdf:about="urn:swrl#title"/>
            </swrl:argument2>
            <swrl:argument1>
              <swrl:Variable rdf:about="urn:swrl#topic"/>
            </swrl:argument1>
          </swrl:DatavaluedPropertyAtom>
        </rdf:first>
      </swrl:AtomList>
    </swrl:head>
    <swrl:body>
      <swrl:AtomList>
        <rdf:rest>
          <swrl:AtomList>
            <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
            <rdf:first>
              <swrl:DatavaluedPropertyAtom>
                <swrl:propertyPredicate rdf:resource="http://www.example.org/rule-example#hasTitle"/>
                <swrl:argument1>
                  <swrl:Variable rdf:about="urn:swrl#doc"/>
                </swrl:argument1>
                <swrl:argument2 rdf:resource="urn:swrl#title"/>
              </swrl:DatavaluedPropertyAtom>
            </rdf:first>
          </swrl:AtomList>
        </rdf:rest>
        <rdf:first>
          <swrl:IndividualPropertyAtom>
            <swrl:propertyPredicate rdf:resource="http://www.example.org/rule-example#hasTopic"/>
            <swrl:argument1 rdf:resource="urn:swrl#doc"/>
            <swrl:argument2 rdf:resource="urn:swrl#topic"/>
          </swrl:IndividualPropertyAtom>
        </rdf:first>
      </swrl:AtomList>
    </swrl:body>
  </swrl:Imp>
</rdf:RDF>
相关问题