2016-05-26 6 views
1

私は門徒で作成されたいくつかのオントロジーを持っており、いくつかのオブジェクトのプロパティを持つクラスのインスタンス、およびオブジェクトのプロパティの一覧については、次の写真に示されているがあることを言う:ゲット推測されるオブジェクトのプロパティのアサーション隠者のReasoner

は、

Object Property Hierarchy

を今、私は上のReasoner(仙人)の電源を入れたときに、私は次のアサートオブジェクトのPRを取得し、次のようAn individual of the class Device, "Email_Server", with the object property "realizes"

オブジェクトプロパティの階層がありますこの同じ個体のためのoperties:

Inferred Object Properties for the individual Email_server

推測されたオブジェクトのプロパティ「dependsUp」顧客のための説明で私をクリックすると、私が手:

Explanation for the inferred Object Property "dependsUp" customer

私の質問は、私が生成する方法でありますこれはJavaを使っていますか?私はすでに次のようにいくつかの個々のための推論されたオブジェクトのプロパティを取得することができます(abrevietyのために不完全ここで、私はテストしてきたようにそれが動作します):

for (OWLNamedIndividual namedIndividual : this.ontology.getIndividualsInSignature()) { 
      if (subjectName.equals(namedIndividual.getIRI().getFragment())) { 
       OWLObjectProperty objectProperty = fac.getOWLObjectProperty(IRI.create(propertyIRI)); 
       NodeSet<OWLNamedIndividual> namedIndividualSet = reasoner.getObjectPropertyValues(namedIndividual ,objectProperty); 

       for (Node<OWLNamedIndividual> namedIndividualsInObjectPropertySet : namedIndividualSet) { 
        for (OWLNamedIndividual namedIndividualForObjectPropertySet : namedIndividualsInObjectPropertySet) { 
         for (OWLClassExpression owlClass : namedIndividualForObjectPropertySet.getTypes(this.ontology)){ 
          if (owlClass.toString().split("#")[1].replace(">", "").equals(archiClass)) { 
           result.add(OWLOntologyUtils.getHumanInstanceName(this.ontology, namedIndividualForObjectPropertySet.getIRI().getFragment())); 
// Result contains all the inferred object properties shown in the above pictures, so this code works. How can I access the explanation for one of the inferred object properties by the reasoner here? 
          } 
         } 
        } 
       } 

      } 
     } 

答えて

1

あなたはInferredObjectPropertyAxiomGeneratorを使用することができます。

InferredObjectPropertyAxiomGenerator generator = new InferredObjectPropertyAxiomGenerator(); 
generator.createAxioms(owldatafactory, reasoner); 
+0

は面白いですね、実際にそれを使って個人の推論オブジェクトプロパティを取得する方法はわかりません。 OWLAPIの中心的な貢献者であることがわかります。このクラスを使用している人のために推論オブジェクトプロパティを取得するにはどうすればいいのでしょうか? – luispcosta

関連する問題