Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated WebserverCommand to use local ontologies if available #25

Merged
merged 3 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down