diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1df2e..ab3d031 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Based on the suggestion at https://keepachangelog.com/en/1.0.0/. - Removed Eclipse files that should not have been added in [phyloref/jphyloref#13]. - Moved code for determining Phyloref statuses to PhylorefHelper. This is part of [phyloref/jphyloref#8]. +- WebserverCommand now looks for ontologies in the local 'ontologies/' directory. ## 0.2 - 2018-06-20 - Added support for phyloreference statuses using the Publication Status Ontology diff --git a/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java b/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java index e584bcd..54f60f0 100644 --- a/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java +++ b/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java @@ -40,6 +40,7 @@ import org.semanticweb.owlapi.rio.RioOWLRDFConsumerAdapter; import org.semanticweb.owlapi.search.EntitySearcher; import org.semanticweb.owlapi.util.AnonymousNodeChecker; +import org.semanticweb.owlapi.util.AutoIRIMapper; import org.semanticweb.owlapi.util.VersionInfo; import fi.iki.elonen.NanoHTTPD; @@ -160,6 +161,13 @@ public JSONObject serveReason(File jsonldFile) throws OWLOntologyCreationExcepti // Prepare an ontology to fill with the provided JSON-LD file. OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + + // Is purl.obolibrary.org down? No worries, you can access local copies + // of your ontologies in the 'ontologies/' folder. + AutoIRIMapper mapper = new AutoIRIMapper(new File("ontologies"), true); + System.err.println("Found local ontologies: " + mapper.getOntologyIRIs()); + manager.addIRIMapper(mapper); + OWLOntology ontology = manager.createOntology(); OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();