2014-02-18 43 views
0

我对这个本体论很陌生。我现在正在使用门卫。我有2类BT和文档。我创建了2个对象属性1.主题(域:文档,范围:BT)2. hasDocument(主题的逆属性)。推理数据类型属性

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

以下是我所创建

  1. BT hasDocument文件属性中的样品
  2. 文档主题BT
  3. 文件标题 “TestingName”

我不知道如何创建属性推断以下结果

BT newProperty“Test ingName”

+0

重复的在http://answers.semantic web.com作为[Inference OWL](http://answers.semanticweb.com/questions/26526/inference-owl)。 –

回答

0

如果我理解你的问题,你希望能够通过声称hasDocumentWithTitle具有作为子属性链从

docX topic someTopic 
docX title "SampleTitle" 
someRopic hasDocumentWithTitle "SampleTitle" 

你几乎可以做到这一点与产业链,来推断(inverse topic) o title 。不幸的是,在OWL属性链中不能以数据类型属性结束,所以你不能这样做。但是,您可以使用SWRL规则,并且许多OWL2 reasoners处理SWRL规则。你会使用形式的规则:(?DOC,话题)

话题∧标题(?DOC,标题)→hasDocumentWithTitle(?话题,标题)

例如我们可以用下面的本体得到以下结果门生:

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>