2017-05-16 8 views
1

OWL APIを直接使用する場合と比較して、Protégéのサブクラス処理について少し混乱します。(Un)継承サブクラスの規則とOWL API

私は「男性」または「女性」が男性または女性の人間であることを論理的に定義する単純なオントロジーを構築しました。

クラスは

Human 
Woman 
Man 
Gender 
    Female 
    Male 

プロパティです:

hasSex (Human -> Gender) 

だから、女は 人間とhasGenderいくつかの女性

私の問題です:私は、自動的に、プロテジェでそれをこのオントロジーを表示すると人と女性を人間のサブクラスとして構成し、推論を使用することはありません。私はそれらのサブクラスをOWLのAPIのすべてのクラスを反復して印刷するとき しかし、唯一のアサートサブクラスが発見された:

Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female> 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Woman> 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male> 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human> 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender> 
    <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female> 
    <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male> 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Man> 

私はプロテジェは、1を使用せずに示していることを、期待される結果を得るために推論を使用する必要があります:

Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female> 
    Node(owl:Nothing) 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Woman> 
    Node(owl:Nothing) 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male> 
    Node(owl:Nothing) 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human> 
    Node(<http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Man>) 
    Node(<http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Woman>) 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender> 
    Node(<http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female>) 
    Node(<http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male>) 
Subclasses of <http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Man> 
    Node(owl:Nothing) 

私はここで間違っていますか? Protégéにはサブクラスの「明確な」ケースの組み込みルールがいくつかありますか?どこで見つけることができますか?参考のため

、例えば、オントロジとOWL APIコードのフォロー:

<!-- 
/////////////////////////////////////////////////////////////////////////////////////// 
// 
// Object Properties 
// 
/////////////////////////////////////////////////////////////////////////////////////// 
--> 




<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasAge --> 

<owl:ObjectProperty rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasAge"> 
    <rdfs:domain rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human"/> 
</owl:ObjectProperty> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasSex --> 

<owl:ObjectProperty rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasSex"> 
    <rdfs:domain rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human"/> 
    <rdfs:range rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender"/> 
</owl:ObjectProperty> 



<!-- 
/////////////////////////////////////////////////////////////////////////////////////// 
// 
// Classes 
// 
/////////////////////////////////////////////////////////////////////////////////////// 
--> 




<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female"> 
    <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender"/> 
</owl:Class> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender"/> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human"/> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male"> 
    <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Gender"/> 
</owl:Class> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Man --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Man"> 
    <owl:equivalentClass> 
     <owl:Class> 
      <owl:intersectionOf rdf:parseType="Collection"> 
       <rdf:Description rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human"/> 
       <owl:Restriction> 
        <owl:onProperty rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasSex"/> 
        <owl:someValuesFrom rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Male"/> 
       </owl:Restriction> 
      </owl:intersectionOf> 
     </owl:Class> 
    </owl:equivalentClass> 
</owl:Class> 



<!-- http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Woman --> 

<owl:Class rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Woman"> 
    <owl:equivalentClass> 
     <owl:Class> 
      <owl:intersectionOf rdf:parseType="Collection"> 
       <rdf:Description rdf:about="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Human"/> 
       <owl:Restriction> 
        <owl:onProperty rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#hasSex"/> 
        <owl:someValuesFrom rdf:resource="http://www.semanticweb.org/user/ontologies/2017/4/untitled-ontology-222#Female"/> 
       </owl:Restriction> 
      </owl:intersectionOf> 
     </owl:Class> 
    </owl:equivalentClass> 
</owl:Class> 

public static void main(String[] args) throws OWLOntologyCreationException { 
    OWLOntologyManager m = OWLManager.createOWLOntologyManager(); 
    OWLOntology o = m.loadOntologyFromOntologyDocument(new File("testonto/Untitled.owl")); 
    OWLReasonerFactory reasonerFactory = new JFactFactory(); 
    OWLReasoner reasoner = reasonerFactory.createReasoner(o); 
    o.classesInSignature().forEach(c -> { 
     System.out.println("Subclasses of " + c); 
     reasoner.getSubClasses(c, true).forEach(sc -> System.out.println(" " + sc)); 
//   EntitySearcher.getSubClasses(c, o).forEach(sc -> System.out.println(" " + sc)); 
    }); 
} 

答えて

0

短い答えはイエスである、プロテジェはにいくつかの最低限の推論を持っていますアサーションされた階層を整理します。

+0

こんにちはイグナツィオ、答えてくれてありがとう!それらのルールを調べる方法はありますか?私はProtégéコードからそれらを抽出する以外のことを意味します:-D – khituras

+0

私が知っているから、彼らはプロテインソースコードでハードコードされています、私は恐れています。 – Ignazio

+0

よろしくお願いします。 – khituras

関連する問題