Open noorbakerally opened 5 years ago
This is likely two errors: one is a known bug with cycling imports, and the other is missing declarations in one of the ontologies.
As a workaround, try loading the ontology that is both imported by your root ontology and imports the root ontology - the imports closure for the reasoner will be the same but the loading sequence might work better.
For the second error, what declaration could be missing ?
Can't tell, sorry.
I'm seeing that an addOntologyLoaderListener
can be added to the manager. Using this, the IRI of ontology that is about to be imported can be know. I was thinking, if there anyway to stop loading that important if it was already loaded.
manager.addOntologyLoaderListener(new OWLOntologyLoaderListener() {
@Override
public void startedLoadingOntology(LoadingStartedEvent loadingStartedEvent) {
String iri = loadingStartedEvent.getOntologyID().getOntologyIRI().get().getIRIString();
//STOP THE LOADING HERE if IRI is the original ontology or already imported
}
@Override
public void finishedLoadingOntology(LoadingFinishedEvent loadingFinishedEvent) {
}
});
I am not sure if this is still an issue. I tried opening the ontology provided from OP and it loads correctly in protege 5.5 and 5.6
I am trying to load an ontology (file is here) with OWL API(5.1.10). The ontology has imports and the imported ontology imports the original ontology. Consequently this is generating errors when loading the original ontology. The codes for loading the original ontology and errors are below. I believe that the error is mostly because of trying to load twice the same ontology due to the cyclic imports. Can OWL API support for this ?
Codes for loading original ontology
Error