/** * Computes a diff of what axioms have been added and what axioms have been * removed from the list of pending changes. Note that even if the list of * pending changes is non-empty then there may be no changes for the * reasoner to deal with. * * @param added The logical axioms that have been added to the imports closure of the reasoner * root ontology * @param removed The logical axioms that have been removed from the imports closure of the * reasoner root ontology */ private void computeDiff(Set<OWLAxiom> added, Set<OWLAxiom> removed) { if (rawChanges.isEmpty()) { return; } rootOntology.importsClosure().flatMap(o -> o.logicalAxioms()) .filter(ax -> !reasonerAxioms.contains(ax .getAxiomWithoutAnnotations())).forEach(added::add); rootOntology.importsClosure().flatMap(o -> o.axioms(AxiomType.DECLARATION)) .filter(ax -> !reasonerAxioms .contains(ax.getAxiomWithoutAnnotations())).forEach(added::add); for (OWLAxiom ax : reasonerAxioms) { if (!rootOntology .containsAxiom(ax, Imports.INCLUDED, AxiomAnnotations.CONSIDER_AXIOM_ANNOTATIONS)) { removed.add(ax); } } }
/** * Computes a diff of what axioms have been added and what axioms have been * removed from the list of pending changes. Note that even if the list of * pending changes is non-empty then there may be no changes for the * reasoner to deal with. * * @param added The logical axioms that have been added to the imports closure of the reasoner * root ontology * @param removed The logical axioms that have been removed from the imports closure of the * reasoner root ontology */ private void computeDiff(Set<OWLAxiom> added, Set<OWLAxiom> removed) { if (rawChanges.isEmpty()) { return; } rootOntology.importsClosure().flatMap(o -> o.logicalAxioms()) .filter(ax -> !reasonerAxioms.contains(ax .getAxiomWithoutAnnotations())).forEach(added::add); rootOntology.importsClosure().flatMap(o -> o.axioms(AxiomType.DECLARATION)) .filter(ax -> !reasonerAxioms .contains(ax.getAxiomWithoutAnnotations())).forEach(added::add); for (OWLAxiom ax : reasonerAxioms) { if (!rootOntology .containsAxiom(ax, Imports.INCLUDED, AxiomAnnotations.CONSIDER_AXIOM_ANNOTATIONS)) { removed.add(ax); } } }
/** * Computes a diff of what axioms have been added and what axioms have been * removed from the list of pending changes. Note that even if the list of * pending changes is non-empty then there may be no changes for the * reasoner to deal with. * * @param added The logical axioms that have been added to the imports closure of the reasoner * root ontology * @param removed The logical axioms that have been removed from the imports closure of the * reasoner root ontology */ private void computeDiff(Set<OWLAxiom> added, Set<OWLAxiom> removed) { if (rawChanges.isEmpty()) { return; } rootOntology.importsClosure().flatMap(o -> o.logicalAxioms()) .filter(ax -> !reasonerAxioms.contains(ax .getAxiomWithoutAnnotations())).forEach(added::add); rootOntology.importsClosure().flatMap(o -> o.axioms(AxiomType.DECLARATION)) .filter(ax -> !reasonerAxioms .contains(ax.getAxiomWithoutAnnotations())).forEach(added::add); for (OWLAxiom ax : reasonerAxioms) { if (!rootOntology .containsAxiom(ax, Imports.INCLUDED, AxiomAnnotations.CONSIDER_AXIOM_ANNOTATIONS)) { removed.add(ax); } } }
/** * Computes a diff of what axioms have been added and what axioms have been * removed from the list of pending changes. Note that even if the list of * pending changes is non-empty then there may be no changes for the * reasoner to deal with. * * @param added The logical axioms that have been added to the imports closure of the reasoner * root ontology * @param removed The logical axioms that have been removed from the imports closure of the * reasoner root ontology */ private void computeDiff(Set<OWLAxiom> added, Set<OWLAxiom> removed) { if (rawChanges.isEmpty()) { return; } rootOntology.importsClosure().flatMap(o -> o.logicalAxioms()) .filter(ax -> !reasonerAxioms.contains(ax .getAxiomWithoutAnnotations())).forEach(added::add); rootOntology.importsClosure().flatMap(o -> o.axioms(AxiomType.DECLARATION)) .filter(ax -> !reasonerAxioms .contains(ax.getAxiomWithoutAnnotations())).forEach(added::add); for (OWLAxiom ax : reasonerAxioms) { if (!rootOntology .containsAxiom(ax, Imports.INCLUDED, AxiomAnnotations.CONSIDER_AXIOM_ANNOTATIONS)) { removed.add(ax); } } }