I'm getting a size==0 explanation model.

                        PelletInfGraph pelletGraph = (PelletInfGraph) queryModel.getGraph();                         Statement why = queryModel.createStatement(member.asResource(), rdfType, clazz.asResource());                         boolean containsStatement = queryModel.contains(why);
                        Model because = pelletGraph.explain(why);

containsStatement is true.

On 12/28/2020 1:46 AM, Lorenz Buehmann wrote:
The method getDerivation() is not implemented in Pellet resp. Openllet.

You can cast the InfGraph to PelletInfGraph  and then call explain() or
explainTriple() with the corresponding arguments.

For example

InfGraph g = ...
Statement stmt =  ...
Model explanation = ((PelletInfGraph)g).explain(stmt);

You can also check if the current model/graph entails a triple with

Triple t = ...
boolean isEntailed = ((PelletInfGraph)g).entails(t);

On 27.12.20 15:13, Steve Vestal wrote:
When I create an OntModel using OntModelSpec.OWL_DL_MEM_RULE_INF,
InfGraph#getDerivation returns a derivation.  When I switch to
PelletReasonerFactory.THE_SPEC (the only choice), I get a null
result.  I have tried setDerivationLogging(true) on both the Reasoner
and the InfGraph.  Reasoner#getReasonerCapabilities() result doesn't
seem to say anything about the ability to provide a derivation in
either case.  The openllet github site says it can explain
inferences.  Does anyone know how to turn that on?




Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to