Как я могу получить существующий класс из онтологии с OWL-API? Это фрагмент из моей онтологии:OWL: получить класс из существующей Антологии
<owl:Class rdf:ID="StringDocu">
<owl:equivalentClass>
<owl:Restriction>
<owl:someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
<owl:onProperty rdf:resource="#hasContent"/>
</owl:Restriction>
</owl:equivalentClass>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>String Docu</rdfs:label>
<rdfs:subClassOf rdf:resource="#Docu"/>
<owl:disjointWith rdf:resource="#URIDocu"/>
<rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>This class concerns a docu with the content specified as common text.</rdfs:comment>
</owl:Class>
Я начинаю с этим кодом:
String ontologyUri = "http://mysite.com/my_ontology.owl";
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.createOntology(IRI.create(ontologyUri));
OWLDataFactory factory = manager.getOWLDataFactory();
и теперь я хочу, чтобы получить StringDocu
класс. Как я могу это получить?
Hi WongiSeng, это слишком сложно - все, что вам нужно, это дать вам все классы в онтологии как набор. Вы можете получить прямую ссылку на класс, зная его URI. –