Skip to content

Commit

Permalink
Merge pull request #25 from phyloref/use_local_ontologies_in_webserver
Browse files Browse the repository at this point in the history
TestCommand (`java -jar jphyloref.jar test ...`) already supports the use of local ontologies if they are available. This PR adds support for reading ontologies from the same folder to WebserverCommand (`java -jar jphyloref.jar webserver ...`) as well.
  • Loading branch information
gaurav committed Oct 16, 2018
2 parents 5e8399e + ae5ba48 commit fc4369d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit fc4369d

Please sign in to comment.