2014-02-18 2 views
0

Я новичок в этой онтологии. Теперь я использую протеже. У меня есть 2 класса BT и Document. Я создал 2 Object Property 1. topic (Domain: Document, Range: BT) 2. hasDocument (Обратное свойство темы).Вывод данных Свойства типа данных

Я создал 1 свойство DataType, называемое названием (домен: диапазон документов: буквенный).

Ниже приведены образцы для свойств, которые я создал

  1. BT hasDocument документа
  2. темы
  3. документа BT
  4. Название документа "TestingName"

Я не знаю, как создать имущество, которое имеет следующий результат:

BT newProperty "Test ingName»

+0

Дублированный на HTTP: //answers.semantic web.com как [Inference OWL] (http://answers.semanticweb.com/questions/26526/inference-owl). –

ответ

0

Если я правильно понял ваш вопрос, вы хотите, чтобы быть в состоянии вывести из

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

Вы могли почти сделать это с цепи собственности, утверждая, что hasDocumentWithTitle имеет как Подствойство по цепочке (inverse topic) o title , К сожалению, в цепочках свойств OWL не могут заканчиваться свойства типа данных, поэтому вы не можете этого сделать. Тем не менее, вы можете использовать правила SWRL, и многие разработчики OWL2 обрабатывают правила SWRL. Вы бы использовать правило вида: (? Док, тему)

тему ∧ название (? Документ, название) → hasDocumentWithTitle (? Тема, название)

Например мы можем получить следующий результат в 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> 
Смежные вопросы