Manuel Munier
Manuel Munier

Reputation: 11

How to get OWL explanation with Drools engine?

I'm using OWLAPI along with SWRLAPI to build ontologies with SWRL rules and perform some SQWRL queries. Fot that, I use something like:

SQWRLQueryEngine queryEngine = SWRLAPIFactory.createSQWRLQueryEngine(onto);
sqwrlResult = queryEngine.runSQWRLQuery("q1","idsm:is_Permitted(?x) -> sqwrl:select(?x)");

I get right answers, i.e. idsm:is_Permitted(op) axioms are well inferred from SWRL rules by the SQWRL engine. But now, I would like to get OWL explanations for "how those axioms were inferred".

I found the OWL explanation API (https://github.com/matthewhorridge/owlexplanation), but I only found examples using Pellet or HermiT. Is it possible to get explanations from Drools engine too ? If I execute queryEngine.getOWLReasoner() I then get an exception "reasoner not yet wired up". And if I execute queryEngine.getOWL2RLEngine() I get an object from class OWL2RLEngine that is different of the class OWLReasoner.

The code I found is:

OWLReasonerFactory rf = ...;

// Create the explanation generator factory which uses reasoners provided by the specified
// reasoner factory
ExplanationGeneratorFactory<OWLAxiom> genFac = ExplanationManager.createExplanationGeneratorFactory(rf, null);

// Now create the actual explanation generator for our ontology
ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(onto);

Ok. What should I put for rf variable to "connect" to the Drools engine ?

Thanks for your help, Manu

Upvotes: 1

Views: 73

Answers (0)

Related Questions