This repository contains an exemplary application integrating OWLAPI and Jena libraries. In particular the application:
- loads an ontology passed as argument;
- loads the ontology imported using
owl:imports
assertions; - infers all implicit assertions using HermiT reasoner;
- transforms the inferred ontology into a Jena model;
- evaluates a query (i.e.
SELECT ?i ?c {?i a ?c}
) on the Jena model and prints the results.
You can install (i.e. mvn clean install
) and run (i.e. mvn exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass="it.cnr.istc.stlab.App" -Dexec.args="[ONTOLOGY IRI]"
) the application using maven.
You can also use this tool to derive the inferred version of any ontology using HermiT reasoner. To do so:
- Compile the project
mvn clean install
- Run the main in GetInferredOntology class
mvn exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass="it.cnr.istc.stlab.GetInferredOntology" -Dexec.args="[ONTOLOGY IRI] /path/to/the/output/ontology.ttl"
(the inferred ontology will be written in Turtle format).
Note: [ONTOLOGY IRI] can be either local paths (e.g. file:///path/to/the/input/ontology.owl) or URLs (e.g.http://www.ontologydesignpatterns.org/ont/dul/DUL.owl)
The code within this repository is distributed under Apache 2.0 License