0
有人可以幫助如何使用JenaOWLModel或OWLOntology從下面的示例OWL頭中獲取頭值。如何從OWL本體頭值中檢索值
<owl:Ontology rdf:about="">
<owl:versionInfo>v 1.17 2003/02/26 12:56:51 mdean</owl:versionInfo>
<rdfs:comment>An example ontology</rdfs:comment>
<owl:imports rdf:resource="http://www.example.org/foo"/>
</owl:Ontology>
You can refer http://www.w3.org/TR/owl-ref/#Annotations (2.2. Ontology Headers) for more reference.
I tried using the below code to fetch the values, but not able to fetch the values. I can just see the keys. Any help would be appreciated.
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLDataFactory dataFactory = manager.getOWLDataFactory();
OWLOntology owlLOntology = manager.loadOntologyFromOntologyDocument(new File(dataPath));
Set owlAnnotationPropertySet = owlLOntology.getAnnotationPropertiesInSignature();
Iterator<OWLAnnotationProperty> iter = owlAnnotationPropertySet.iterator();while(iter.hasNext()){
OWLAnnotationProperty owlAnnotationProperty = (OWLAnnotationProperty) iter.next();
}
感謝 阿努拉格
任何想法如何得到下面 創作者的價值創作者名稱 –
Anurag
'創建者名稱'將成爲您的本體的註釋。因此,遍歷每個註釋應該會返回該註釋。有關如何實現此目的的某些代碼,請參閱編輯答案。 –