@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; }