[Pellet-users] only first explanation by org.mindswap.pellet.owlapi.Reasoner.getExplanation()

Martin Knechtel knechtel at gmail.com
Tue May 20 08:36:46 UTC 2008


>
> is it possible to get all explaination variants? Only the first explanation
>>> is returned by org.mindswap.pellet.owlapi.Reasoner.getExplanation()
>>>
>> If you get the latest release of OWLAPI (v 2.2.0) and look into
>> com.clarkparsia.explanation package you will find relevant classes
>
> Ah okay, how should the org.mindswap.pellet.examples.ExplanationExample be
> adapted then?


Hi,

to close this thread, the following code can be used.

Cheers,
Martin

          // the axiom states, that the subsumption does not hold
          OWLAxiom disjointAxiom =
factory.getOWLDisjointClassesAxiom(subsumee, subsumer);

          /* Now add the axiom to the ontology */
          AddAxiom addAxiom = new AddAxiom(ontology, disjointAxiom);
          /* Use the manager to apply the change */
          manager.applyChange(addAxiom);

          /* Create a satisfiability checker */
          OWLSatisfiabilityChecker checker = new Reasoner(manager);
          checker.loadOntologies(Collections.singleton(ontology));
          OWLDebugger debugger = new BlackBoxOWLDebugger(manager,
ontology, checker);

          /* Find the sets of support and print them */
          Set<Set<OWLAxiom>> allsos =
              debugger.getAllSOSForIncosistentClass(subsumee);

          for (Set<OWLAxiom> sos : allsos){
              printAxioms("next set of support", sos);
          }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20080520/1dc36c89/attachment.htm 


More information about the Pellet-users mailing list