I am developing a maven plugin to validate OWL ontologies using OWL-API v3.4.3 and HermiT 1.3.8.4. Some of the OWL ontologies are proprietary, and thus are not available on the Web.
Looking at the documentation, I'm using loadOntologyFromOntologyDocument()
to load an OWL file to perform the validation:
OWLOntology onto = ontoManager.loadOntologyFromOntologyDocument(new File($fileName))
Reasoner hermit = new Reasoner(onto);
This works fine when the ontology does not import any proprietary ontology, but returns UnloadableImportException
error otherwise. I have seen people using addIRIMapper
to create a link between the ontology URI and the physical file in which the entities are defined, but I don't think it would work in my case (mostly because the file name are unknown).
Is there a way to tell the OWL API to ignore imports? If there is, I could iterate over the file in a folder and leverage OWLOntologyMerger
to validate all ontologies together.