/** * Creates an explanation generator factory that will produce explanation generators that generate explanations * as to why an checker is entailed by a set of axioms. * @param reasonerFactory A reasoner factory that can be used for creating new reasoners if necessary * @return An explanation generatory factory that creates explanation generators for entailed axioms */ public static ExplanationGeneratorFactory<OWLAxiom> createExplanationGeneratorFactory(OWLReasonerFactory reasonerFactory, Supplier<OWLOntologyManager> m) { return createExplanationGeneratorFactory(reasonerFactory, null, m); }
public static <E> ExplanationGeneratorFactory<E> createLaconicExplanationGeneratorFactory(EntailmentCheckerFactory<E> entailmentCheckerFactory, Supplier<OWLOntologyManager> m) { return new LaconicExplanationGeneratorFactory<>(createExplanationGeneratorFactory(entailmentCheckerFactory, m), m); } }
public static ExplanationGeneratorFactory<OWLAxiom> createLaconicExplanationGeneratorFactory(OWLReasonerFactory reasonerFactory, ExplanationProgressMonitor<OWLAxiom> progressMonitor, Supplier<OWLOntologyManager> m) { return new LaconicExplanationGeneratorFactory<>(createExplanationGeneratorFactory(reasonerFactory, m), m); }
/** * Compute explanations for an entailed axiom. * * @param axiom entailed axiom to explain * @param ontology ontology to search for explanation * @param reasonerFactory reasoner factory used to create reasoners to test entailments * @param maxExplanations maximum number of explanations to compute * @return explanations */ public static Set<Explanation<OWLAxiom>> explain( OWLAxiom axiom, OWLOntology ontology, OWLReasonerFactory reasonerFactory, int maxExplanations) { logger.debug("Explaining: " + axiom); ExplanationGeneratorFactory<OWLAxiom> genFac = ExplanationManager.createExplanationGeneratorFactory(reasonerFactory); ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(ontology); return gen.getExplanations(axiom, maxExplanations); }
roots.addAll(estimatedRoots); for (final OWLClass estimatedRoot : estimatedRoots) { ExplanationGeneratorFactory<OWLAxiom> genFac = ExplanationManager.createExplanationGeneratorFactory(reasonerFactory, m); ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(allAxioms); OWLDataFactory df = manager.getOWLDataFactory();
private ExplanationGeneratorFactory<OWLAxiom> getCurrentExplanationGeneratorFactory(JustificationType type) { OWLReasoner reasoner = modelManager.getOWLReasonerManager().getCurrentReasoner(); if(reasoner.isConsistent()) { if (type.equals(JustificationType.LACONIC)) { OWLReasonerFactory rf = getReasonerFactory(); return ExplanationManager.createLaconicExplanationGeneratorFactory(rf, progressDialog.getProgressMonitor()); } else { OWLReasonerFactory rf = getReasonerFactory(); return ExplanationManager.createExplanationGeneratorFactory(rf, progressDialog.getProgressMonitor()); } } else { if (type.equals(JustificationType.LACONIC)) { OWLReasonerFactory rf = getReasonerFactory(); InconsistentOntologyExplanationGeneratorFactory fac = new InconsistentOntologyExplanationGeneratorFactory(rf, Long.MAX_VALUE); return new LaconicExplanationGeneratorFactory<>(fac); } else { OWLReasonerFactory rf = getReasonerFactory(); return new InconsistentOntologyExplanationGeneratorFactory(rf, Long.MAX_VALUE); } } }