private void insertChildren(@Nullable OWLEntity entity, ExplanationTree tree) { if (entity == null) { return; } Set<OWLAxiom> currentPath = new HashSet<>(tree.getUserObjectPathToRoot()); getAxioms(entity).filter(ax -> !passTypes.contains(ax.getAxiomType())).forEach(ax -> { Set<OWLAxiom> mapped = getIndexedSet(entity, mappedAxioms, true); if (!consumedAxioms.contains(ax) && !mapped.contains(ax) && !currentPath.contains(ax)) { mapped.add(ax); consumedAxioms.add(ax); ExplanationTree child = new ExplanationTree(ax); tree.addChild(child); getRHSEntitiesSorted(ax).forEach(ent -> insertChildren(ent, child)); } }); sortChildrenAxioms(tree); }
private void insertChildren(@Nullable OWLEntity entity, ExplanationTree tree) { if (entity == null) { return; } Set<OWLAxiom> currentPath = new HashSet<>(tree.getUserObjectPathToRoot()); getAxioms(entity).filter(ax -> !passTypes.contains(ax.getAxiomType())).forEach(ax -> { Set<OWLAxiom> mapped = getIndexedSet(entity, mappedAxioms, true); if (!consumedAxioms.contains(ax) && !mapped.contains(ax) && !currentPath.contains(ax)) { mapped.add(ax); consumedAxioms.add(ax); ExplanationTree child = new ExplanationTree(ax); tree.addChild(child); getRHSEntitiesSorted(ax).forEach(ent -> insertChildren(ent, child)); } }); sortChildrenAxioms(tree); }
private void insertChildren(@Nullable OWLEntity entity, ExplanationTree tree) { if (entity == null) { return; } Set<OWLAxiom> currentPath = new HashSet<>(tree.getUserObjectPathToRoot()); getAxioms(entity).filter(ax -> !passTypes.contains(ax.getAxiomType())).forEach(ax -> { Set<OWLAxiom> mapped = getIndexedSet(entity, mappedAxioms, true); if (!consumedAxioms.contains(ax) && !mapped.contains(ax) && !currentPath.contains(ax)) { mapped.add(ax); consumedAxioms.add(ax); ExplanationTree child = new ExplanationTree(ax); tree.addChild(child); getRHSEntitiesSorted(ax).forEach(ent -> insertChildren(ent, child)); } }); sortChildrenAxioms(tree); }
private void insertChildren(@Nullable OWLEntity entity, ExplanationTree tree) { if (entity == null) { return; } Set<OWLAxiom> currentPath = new HashSet<>(tree.getUserObjectPathToRoot()); getAxioms(entity).filter(ax -> !passTypes.contains(ax.getAxiomType())).forEach(ax -> { Set<OWLAxiom> mapped = getIndexedSet(entity, mappedAxioms, true); if (!consumedAxioms.contains(ax) && !mapped.contains(ax) && !currentPath.contains(ax)) { mapped.add(ax); consumedAxioms.add(ax); ExplanationTree child = new ExplanationTree(ax); tree.addChild(child); getRHSEntitiesSorted(ax).forEach(ent -> insertChildren(ent, child)); } }); sortChildrenAxioms(tree); }
@Override public ExplanationTree getOrderedExplanation(OWLAxiom entailment, Set<OWLAxiom> axioms) { currentExplanation = new HashSet<>(axioms); buildIndices(); ExplanationTree root = new EntailedAxiomTree(entailment); insertChildren(seedExtractor.getSource(entailment), root); OWLEntity currentTarget = seedExtractor.getTarget(entailment); Set<OWLAxiom> axs = root.getUserObjectClosure(); List<OWLAxiom> rootAxioms = new ArrayList<>(); for (OWLAxiom ax : axioms) { if (!axs.contains(ax)) { rootAxioms.add(ax); } } Set<OWLAxiom> targetAxioms = getTargetAxioms(currentTarget); Collections.sort(rootAxioms, (o1, o2) -> { if (targetAxioms.contains(o1)) { return 1; } if (targetAxioms.contains(o2)) { return -1; } return 0; }); rootAxioms.forEach(ax -> root.addChild(new ExplanationTree(ax))); return root; }
@Override public ExplanationTree getOrderedExplanation(OWLAxiom entailment, Set<OWLAxiom> axioms) { currentExplanation = new HashSet<>(axioms); buildIndices(); ExplanationTree root = new EntailedAxiomTree(entailment); insertChildren(seedExtractor.getSource(entailment), root); OWLEntity currentTarget = seedExtractor.getTarget(entailment); Set<OWLAxiom> axs = root.getUserObjectClosure(); List<OWLAxiom> rootAxioms = new ArrayList<>(); for (OWLAxiom ax : axioms) { if (!axs.contains(ax)) { rootAxioms.add(ax); } } Set<OWLAxiom> targetAxioms = getTargetAxioms(currentTarget); Collections.sort(rootAxioms, (o1, o2) -> { if (targetAxioms.contains(o1)) { return 1; } if (targetAxioms.contains(o2)) { return -1; } return 0; }); rootAxioms.forEach(ax -> root.addChild(new ExplanationTree(ax))); return root; }
@Override public ExplanationTree getOrderedExplanation(OWLAxiom entailment, Set<OWLAxiom> axioms) { currentExplanation = new HashSet<>(axioms); buildIndices(); ExplanationTree root = new EntailedAxiomTree(entailment); insertChildren(seedExtractor.getSource(entailment), root); OWLEntity currentTarget = seedExtractor.getTarget(entailment); Set<OWLAxiom> axs = root.getUserObjectClosure(); List<OWLAxiom> rootAxioms = new ArrayList<>(); for (OWLAxiom ax : axioms) { if (!axs.contains(ax)) { rootAxioms.add(ax); } } Set<OWLAxiom> targetAxioms = getTargetAxioms(currentTarget); Collections.sort(rootAxioms, (o1, o2) -> { if (targetAxioms.contains(o1)) { return 1; } if (targetAxioms.contains(o2)) { return -1; } return 0; }); rootAxioms.forEach(ax -> root.addChild(new ExplanationTree(ax))); return root; }
@Override public ExplanationTree getOrderedExplanation(OWLAxiom entailment, Set<OWLAxiom> axioms) { currentExplanation = new HashSet<>(axioms); buildIndices(); ExplanationTree root = new EntailedAxiomTree(entailment); insertChildren(seedExtractor.getSource(entailment), root); OWLEntity currentTarget = seedExtractor.getTarget(entailment); Set<OWLAxiom> axs = root.getUserObjectClosure(); List<OWLAxiom> rootAxioms = new ArrayList<>(); for (OWLAxiom ax : axioms) { if (!axs.contains(ax)) { rootAxioms.add(ax); } } Set<OWLAxiom> targetAxioms = getTargetAxioms(currentTarget); Collections.sort(rootAxioms, (o1, o2) -> { if (targetAxioms.contains(o1)) { return 1; } if (targetAxioms.contains(o2)) { return -1; } return 0; }); rootAxioms.forEach(ax -> root.addChild(new ExplanationTree(ax))); return root; }