我使用 OWL API 4.1.3 来加载我的本体并不大。由于我需要使用推断信息,我还使用 Hermit 1.3.8.413 库进行推理。以下代码显示了我是如何完成它的。
public class ReasonRDF {
public static void main(String[] args) throws OWLOntologyCreationException, OWLOntologyStorageException {
readRDF("C:/Users/workspace/Ontology_matching/NVDB_Matching_v18_H_4_1_CONVERTYING/results/NewInstantiated/owl/OSM1.owl");
}
public static void readRDF(String address) throws OWLOntologyCreationException, OWLOntologyStorageException{
OWLOntologyManager manager =OWLManager.createOWLOntologyManager();
File file = new File (address);
OWLOntology ont = manager.loadOntologyFromOntologyDocument(IRI.create(file));
System.out.println("Ontology Loaded...");
System.out.println("Logical IRI : " + ont.getOntologyID());
System.out.println("Format : " + manager.getOntologyFo