public static <E> Explanation<E> getEmptyExplanation(E entailment) { Set<OWLAxiom> emptySet = Collections.emptySet(); return new Explanation<>(entailment, emptySet); }
private void processAxioms(Set<OWLAxiom> axioms) { WorkingAxiomVisitor visitor = new WorkingAxiomVisitor(); for (OWLAxiom ax : axioms) { if (entailment.equalsIgnoreAnnotations(ax)) { Set<OWLAxiom> axs = Collections.singleton(ax); simpleExplanations.add(new Explanation<>(entailment, axs)); } ax.accept(visitor); } }
/** * Loads a previously stored explanation from the specified input stream * @param is The input stream from where to read the explanation * @return The explanation that was read * @throws IllegalStateException if the input stream does not appear to contain a serialisation of an explanation. */ public static Explanation<OWLAxiom> load(InputStream is, Supplier<OWLOntologyManager> m) { try { OWLOntology ontology = m.get().loadOntologyFromOntologyDocument(new BufferedInputStream(is)); OWLDataFactory df = ontology.getOWLOntologyManager().getOWLDataFactory(); OWLAnnotationProperty entailmentMarkerAnnotationProperty = df.getOWLAnnotationProperty(ENTAILMENT_MARKER_IRI); Set<OWLAxiom> justificationAxioms = asSet(ontology.axioms().filter(ax -> isNotEntailment(entailmentMarkerAnnotationProperty, ax))); // Expected one and only one entailment axiom OWLAxiom entailment = ontology.axioms().filter(ax->isEntailment(entailmentMarkerAnnotationProperty, ax)).findAny() .orElseThrow(() -> new IllegalStateException("Not a serialisation of an Explanation")); return new Explanation<>(entailment, justificationAxioms); } catch (OWLOntologyCreationException e) { throw new RuntimeException(e); } }
Explanation<E> explanation = new Explanation<>(laconicExp.getEntailment(), reconstituedAxioms); reconstituedExplanations.add(explanation);
if(reconstitutedAxiomSourcesWithMultipleSources.isEmpty()) { return Collections.singleton(new Explanation<>(expl.getEntailment(), pool));
if (reconstitutedAxiomSourcesWithMultipleSources.isEmpty()) { return Collections.singleton(new Explanation<>(expl.getEntailment(), pool));
if (reconstitutedAxiomSourcesWithMultipleSources.isEmpty()) { return Collections.singleton(new Explanation<>(expl.getEntailment(), pool));
DeltaTransformationUnfolder unfolder = new DeltaTransformationUnfolder(dataFactory); Set<OWLAxiom> unfoldedAxioms = unfolder.getUnfolded(expl.getAxioms(), signature); Explanation<OWLAxiom> unfoldedExpl = new Explanation<>(entailment, unfoldedAxioms); if(checker.isLaconic(unfoldedExpl)) { boolean added = laconicExplanations.add(unfoldedExpl);
result = new Explanation<>(entailment, Collections.singleton((OWLAxiom) entailment)); result = new Explanation<>(entailment, justificationAxioms);
Explanation<E> expl = new Explanation<>(entailment, justification);