Embedding TrOWL
TrOWL supports the OWLReasoner interface from the OWL API . TrWOL has native support for working with objects such as ontologies and class expression from the OWL API 2.2.0. After adding TrOWLCore.jar to your classpath, you can now instantiate TrOWL in your java program by creating an instance of the Reasoner class in the package eu.trowl.owl.rel.reasoner.RELReasonerFactory. The following code shows how to loads an ontology, creates a reasoner object and check whether the ontology is consistent.
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ont = manager.loadOntologyFromPhysicalURI(URI.create("someURI"));
OWLReasonerFactory reasonerFactory = new RELReasonerFactory();
OWLReasoner reasoner = reasonerFactory.createReasoner(manager);
System.out.println("Consistent: " + reasoner.isConsistent(ont));