I have an ontology created in Protege 4.3.0 and stored in an OWL file. To download this ontology using the OWL API , I use the following code example.
public class MySampleClass { private final OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); private final OWLDataFactory df = manager.getOWLDataFactory(); private final OWLReasonerFactory rf = new StructuralReasonerFactory(); private final OWLOntology ontology; private final OWLOntologyID id; private final IRI iri; private final PrefixManager pm; private final OWLReasoner reasoner; public MySampleClass(File file) { try { ontology = manager.loadOntologyFromOntologyDocument(file); } catch (OWLOntologyInputSourceException | OWLOntologyCreationException ex) {
However, if I try to load an ontology that includes one or more imports if these importers are not available, an UnloadableImportException is thrown as the following example:
org.semanticweb.owlapi.model.UnloadableImportException: Failed to load imported ontology: http://www.w3.org/2004/02/skos/core Reason: connection timeout
How to solve this problem? If the imported ontology is available offline, how do I import this ontology while loading my ontology?
source share