Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Last active February 13, 2017 23:31
Show Gist options
  • Save GiovanniBalestrieri/c95835b22a409f7b8e4f27f07f723c1f to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/c95835b22a409f7b8e4f27f07f723c1f to your computer and use it in GitHub Desktop.
invoking reasoner on ontology
// Two ways
Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
reasoner = reasoner.bindSchema(tbox);
OntModelSpec ontModelSpec=OntModelSpec.OWL_MEM_MICRO_RULE_INF;
ontModelSpec.setReasoner(reasoner);
InfModel infmodel = ModelFactory.createInfModel(reasoner,abox);
/**
* This is equivalent to an Ontology Model with Reasoner capabilities
* specialized on the ABox.
*/
InfModel infModel1 = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF, abox);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment