From b6ee6c5b4cb815c2d33716c727b811f1831856e1 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 28 Aug 2018 09:04:53 +1200 Subject: [PATCH 1/2] Updated WebserverCommand to use local ontologies if available. --- .../org/phyloref/jphyloref/commands/WebserverCommand.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java b/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java index f137216..8e935b9 100644 --- a/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java +++ b/src/main/java/org/phyloref/jphyloref/commands/WebserverCommand.java @@ -38,6 +38,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; @@ -158,6 +159,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(); From 1967d9930078b012bccace1d01a530832dc8a7cf Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Mon, 8 Oct 2018 18:11:33 -0400 Subject: [PATCH 2/2] Updated CHANGELOG.md with changes to WebserverCommand. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ad7a43..dedd112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Based on the suggestion at https://keepachangelog.com/en/1.0.0/. - Added a "webserver" command that starts a webserver that provides a simple HTTP API for reasoning over JSON-LD file in [phyloref/jphyloref#12]. - Removed Eclipse files that should not have been added in [phyloref/jphyloref#13]. +- 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