@Override public int compare(OWLAxiom o1, OWLAxiom o2) { if(o1.equals(o2)) { return 0; } int count1 = 0; int count2 = 0; for(Explanation<E> expl : hittingSetTree.getExplanations()) { if(expl.contains(o1)) { count1++; } if(expl.contains(o2)) { count2++; } } if(count1 > count2) { return -1; } else if(count2 > count1) { return 1; } else { return 0; } } }
private Explanation<E> getNonIntersectingExplanation(HittingSetTree<E> hittingSetTree, Set<OWLAxiom> pathContents) { for (Explanation<E> existingExpl : hittingSetTree.getExplanations()) { boolean overlaps = false; // Does the explanation intersect with out current path? If not, we can reuse it for (OWLAxiom pathAx : pathContents) { if (existingExpl.contains(pathAx)) { // Overlap overlaps = true; break; } } if (!overlaps) { return existingExpl; } } return null; } }
private Explanation<E> getNonIntersectingExplanation(HittingSetTree<E> hittingSetTree, Set<OWLAxiom> pathContents) { List<Explanation<E>> explanations = hittingSetTree.getSortedExplanations(); // Choose an explanation that contains axioms that are contained in other openFromFolder paths Explanation<E> currentCandidate = null; for (Explanation<E> existingExpl : explanations) { boolean overlaps = false; // Does the explanation intersect with out current path? If not, we can reuse it for (OWLAxiom pathAx : pathContents) { if (existingExpl.contains(pathAx)) { // Overlap overlaps = true; break; } } if (!overlaps) { return existingExpl; } } return currentCandidate; } }
public int getPopularity(OWLAxiom axiom) { int count = 0; Set<Explanation<OWLAxiom>> justifications = justificationManager.getJustifications(entailment, workbenchSettings.getJustificationType()); for(Explanation<OWLAxiom> justification : justifications) { if(justification.contains(axiom)) { count++; } } return count; }
if (axiom.isLogicalAxiom() && newJustification.contains(axiom)) {
@Override protected Color getItemBackgroundColor(MListItem item) { if(item instanceof JustificationFrameSectionRow) { JustificationFrameSectionRow row = (JustificationFrameSectionRow) item; OWLAxiom axiom = row.getAxiom(); int rowIndex = row.getFrameSection().getRowIndex(row) + 1; if(!isSelectedIndex(rowIndex)) { if(axiomSelectionModel.getSelectedAxioms().contains(axiom)) { return Color.YELLOW; } else { boolean inAll = true; for(Explanation<?> expl : workbenchManager.getJustifications(getRootObject().getEntailment())) { if(!expl.contains(axiom)) { inAll = false; break; } } if(inAll) { return new Color(245, 255 , 235); } } } } return super.getItemBackgroundColor(item); }