/** * Expands the axiom set by adding the referencing axioms for the * specified entity. */ private int expandWithReferencingAxioms(OWLEntity obj, int limit) throws OWLException { Set<OWLAxiom> expansionAxioms = new HashSet<OWLAxiom>(); // First expand by getting the defining axioms - if this doesn't // return any axioms, then get the axioms that reference the entity for (OWLOntology ont : owlOntologyManager.getImportsClosure(getOWLOntology())) { expansionAxioms.addAll(ont.getReferencingAxioms(obj)); } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
@Override public Set<OWLAxiom> getSOSForInconsistentClass(OWLClassExpression cls) { reset(); currentClass = setupDebuggingClass(cls); generateSOSAxioms(); getOWLOntology().remove(temporaryAxioms); debuggingAxioms.removeAll(temporaryAxioms); return new HashSet<>(debuggingAxioms); }
@Override public Set<OWLAxiom> getSOSForInconsistentClass(OWLClassExpression cls) { reset(); currentClass = setupDebuggingClass(cls); generateSOSAxioms(); getOWLOntology().remove(temporaryAxioms); debuggingAxioms.removeAll(temporaryAxioms); return new HashSet<>(debuggingAxioms); }
@Override public Set<OWLAxiom> getSOSForInconsistentClass(OWLClassExpression cls) { reset(); currentClass = setupDebuggingClass(cls); generateSOSAxioms(); getOWLOntology().remove(temporaryAxioms); debuggingAxioms.removeAll(temporaryAxioms); return new HashSet<>(debuggingAxioms); }
@Override public Set<OWLAxiom> getSOSForInconsistentClass(OWLClassExpression cls) { reset(); currentClass = setupDebuggingClass(cls); generateSOSAxioms(); getOWLOntology().remove(temporaryAxioms); debuggingAxioms.removeAll(temporaryAxioms); return new HashSet<>(debuggingAxioms); }
public Set<OWLAxiom> getSOSForIncosistentClass(OWLClassExpression cls) throws OWLException { reset(); currentClass = setupDebuggingClass(cls); generateSOSAxioms(); for (OWLAxiom ax : temporaryAxioms) { owlOntologyManager.applyChanges(Arrays.asList(new RemoveAxiom(getOWLOntology(), ax))); } debuggingAxioms.removeAll(temporaryAxioms); ontologyCounter = 0; return new HashSet<OWLAxiom>(debuggingAxioms); }
/** * Expands the axiom set by adding the referencing axioms for the specified * entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithReferencingAxioms(OWLEntity obj, int limit) { // First expand by getting the defining axioms - if this doesn't // return any axioms, then get the axioms that reference the entity Set<OWLAxiom> expansionAxioms = asUnorderedSet( getOWLOntology().referencingAxioms(obj, INCLUDED)); expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Expands the axiom set by adding the referencing axioms for the specified * entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithReferencingAxioms(OWLEntity obj, int limit) { // First expand by getting the defining axioms - if this doesn't // return any axioms, then get the axioms that reference the entity Set<OWLAxiom> expansionAxioms = asUnorderedSet( getOWLOntology().referencingAxioms(obj, INCLUDED)); expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Expands the axiom set by adding the referencing axioms for the specified * entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithReferencingAxioms(OWLEntity obj, int limit) { // First expand by getting the defining axioms - if this doesn't // return any axioms, then get the axioms that reference the entity Set<OWLAxiom> expansionAxioms = asUnorderedSet( getOWLOntology().referencingAxioms(obj, INCLUDED)); expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Expands the axiom set by adding the referencing axioms for the specified * entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithReferencingAxioms(OWLEntity obj, int limit) { // First expand by getting the defining axioms - if this doesn't // return any axioms, then get the axioms that reference the entity Set<OWLAxiom> expansionAxioms = asUnorderedSet( getOWLOntology().referencingAxioms(obj, INCLUDED)); expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Creates a set of axioms to expands the debugging axiom set by adding the defining axioms for the * specified entity. */ private int expandWithDefiningAxioms(OWLEntity obj, int limit) throws OWLException { Set<OWLAxiom> expansionAxioms = new HashSet<OWLAxiom>(); for (OWLOntology ont : owlOntologyManager.getImportsClosure(getOWLOntology())) { if (obj instanceof OWLClass) { expansionAxioms.addAll(ont.getAxioms((OWLClass) obj)); } else if (obj instanceof OWLObjectProperty) { expansionAxioms.addAll(ont.getAxioms((OWLObjectProperty) obj)); } else if (obj instanceof OWLDataProperty) { expansionAxioms.addAll(ont.getAxioms((OWLDataProperty) obj)); } else if (obj instanceof OWLIndividual) { expansionAxioms.addAll(ont.getAxioms((OWLIndividual) obj)); } } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Creates a set of axioms to expands the debugging axiom set by adding the * defining axioms for the specified entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithDefiningAxioms(OWLEntity obj, int limit) { Set<OWLAxiom> expansionAxioms = new HashSet<>(); if (obj instanceof OWLClass) { add(expansionAxioms, getOWLOntology().axioms((OWLClass) obj, INCLUDED)); } else if (obj.isOWLObjectProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLObjectProperty(), INCLUDED)); } else if (obj.isOWLDataProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLDataProperty(), INCLUDED)); } else if (obj instanceof OWLIndividual) { add(expansionAxioms, getOWLOntology().axioms((OWLIndividual) obj, INCLUDED)); } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
private OWLClass setupDebuggingClass(OWLClassExpression cls) throws OWLException { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = owlOntologyManager.getOWLDataFactory().getOWLClass(createIRI()); Set<OWLClassExpression> operands = new HashSet<OWLClassExpression>(); operands.add(curCls); operands.add(cls); temporaryAxioms.add(owlOntologyManager.getOWLDataFactory().getOWLEquivalentClassesAxiom(operands)); for (OWLAxiom ax : temporaryAxioms) { owlOntologyManager.applyChanges(Arrays.asList(new AddAxiom(getOWLOntology(), ax))); } return curCls; } }
/** * Creates a set of axioms to expands the debugging axiom set by adding the * defining axioms for the specified entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithDefiningAxioms(OWLEntity obj, int limit) { Set<OWLAxiom> expansionAxioms = new HashSet<>(); if (obj instanceof OWLClass) { add(expansionAxioms, getOWLOntology().axioms((OWLClass) obj, INCLUDED)); } else if (obj.isOWLObjectProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLObjectProperty(), INCLUDED)); } else if (obj.isOWLDataProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLDataProperty(), INCLUDED)); } else if (obj instanceof OWLIndividual) { add(expansionAxioms, getOWLOntology().axioms((OWLIndividual) obj, INCLUDED)); } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Creates a set of axioms to expands the debugging axiom set by adding the * defining axioms for the specified entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithDefiningAxioms(OWLEntity obj, int limit) { Set<OWLAxiom> expansionAxioms = new HashSet<>(); if (obj instanceof OWLClass) { add(expansionAxioms, getOWLOntology().axioms((OWLClass) obj, INCLUDED)); } else if (obj.isOWLObjectProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLObjectProperty(), INCLUDED)); } else if (obj.isOWLDataProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLDataProperty(), INCLUDED)); } else if (obj instanceof OWLIndividual) { add(expansionAxioms, getOWLOntology().axioms((OWLIndividual) obj, INCLUDED)); } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Creates a set of axioms to expands the debugging axiom set by adding the * defining axioms for the specified entity. * * @param obj the obj * @param limit the limit * @return the int */ private int expandWithDefiningAxioms(OWLEntity obj, int limit) { Set<OWLAxiom> expansionAxioms = new HashSet<>(); if (obj instanceof OWLClass) { add(expansionAxioms, getOWLOntology().axioms((OWLClass) obj, INCLUDED)); } else if (obj.isOWLObjectProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLObjectProperty(), INCLUDED)); } else if (obj.isOWLDataProperty()) { add(expansionAxioms, getOWLOntology().axioms(obj.asOWLDataProperty(), INCLUDED)); } else if (obj instanceof OWLIndividual) { add(expansionAxioms, getOWLOntology().axioms((OWLIndividual) obj, INCLUDED)); } expansionAxioms.removeAll(debuggingAxioms); return addMax(expansionAxioms, debuggingAxioms, limit); }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }
/** * Setup debugging class. * * @param cls the cls * @return the oWL class */ private OWLClass setupDebuggingClass(OWLClassExpression cls) { if (!cls.isAnonymous()) { return (OWLClass) cls; } else { // The class is anonymous, so we need to assign it a name OWLClass curCls = df.getOWLClass(createIRI()); temporaryAxioms.add(df.getOWLEquivalentClassesAxiom(createSet(curCls, cls))); temporaryAxioms.forEach(ax -> man.addAxiom(getOWLOntology(), ax)); return curCls; } }