@Override public Set<OWLClass> getEquivalents(OWLClass node) { logger.debug("getEquivalents(" + node + ")"); try{ return getReasoner().getEquivalentClasses(node).getEntitiesMinus(node); } catch (OWLReasonerRuntimeException e) { logger.error(e.getMessage(), e); } return Collections.emptySet(); }
/** * Uses the reasoner to find all equivalent classes in the ontology, and then adds the axioms that * are not allowed the the list of failed axioms. Once reasoning has occurred, a report can be * logged with #logReport * * @return True if there were no failing equivalence axioms found, False if any failed the test */ public boolean reason() { for (OWLClass c : ontology.getClassesInSignature()) { Set<OWLClass> equivalentClasses = reasoner.getEquivalentClasses(c).getEntitiesMinus(c); foundEquivalentAxioms.addAll(this.createEquivalenceAxioms(c, equivalentClasses)); } for (OWLEquivalentClassesAxiom axiom : foundEquivalentAxioms) { if (reasoningTest.fails(axiom)) { failingAxioms.add(axiom); } } return failingAxioms.isEmpty(); }
public Set<OWLClass> getEquivalents(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } if (!getReasoner().isSatisfiable(object)) { return Collections.emptySet(); } return getReasoner().getEquivalentClasses(object).getEntitiesMinus(object); } finally { // getReadLock().unlock(); } }
public Set<OWLClass> getEquivalents(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } if (!getReasoner().isSatisfiable(object)) { return Collections.emptySet(); } return getReasoner().getEquivalentClasses(object).getEntitiesMinus(object); } finally { // getReadLock().unlock(); } }
private Set<OWLClass> getEquivalentClasses (OWLReasoner reasoner, OWLClass c) { Node<OWLClass> equivalentClasses = reasoner.getEquivalentClasses(c); Set<OWLClass> results; if (!c.isAnonymous()) { results = equivalentClasses.getEntities(); } else { results = equivalentClasses.getEntitiesMinus(c.asOWLClass()); } return results; }
public Set<OWLClass> getUnfilteredChildren(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntitiesMinus(owlNothing)); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; } finally { // getReadLock().unlock(); } }
public Set<OWLClass> getUnfilteredChildren(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntitiesMinus(owlNothing)); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; } finally { // getReadLock().unlock(); } }
reasoner.getUnsatisfiableClasses().getEntitiesMinus(nothing); if (unsatisfiableClasses.size() > 0) { logger.error( reasoner.getUnsatisfiableClasses().getEntitiesMinus(nothing);
/** * @param reasoner OWLReasoner being used * @param outputIRI IRI of output * @return minimal incoherent module * @throws OWLOntologyCreationException on issue creating incoherent module */ public static OWLOntology createIncoherentModule(OWLReasoner reasoner, IRI outputIRI) throws OWLOntologyCreationException { OWLOntology ontology = reasoner.getRootOntology(); OWLClass nothing = ontology.getOWLOntologyManager().getOWLDataFactory().getOWLNothing(); Set<OWLClass> unsatisfiableClasses = reasoner.getUnsatisfiableClasses().getEntitiesMinus(nothing); return createIncoherentModule(ontology, unsatisfiableClasses, outputIRI); }
protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_EQUIVALENT_OBJECT_PROPERTIES, () -> { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Node<OWLObjectPropertyExpression> equivalentObjectProperties = getReasoner().getEquivalentObjectProperties(getRootObject()); if (!equivalentObjectProperties.getEntitiesMinus(getRootObject()).isEmpty()) { OWLEquivalentObjectPropertiesAxiom ax = getOWLDataFactory().getOWLEquivalentObjectPropertiesAxiom(equivalentObjectProperties.getEntities()); if (!added.contains(ax)) { addInferredRowIfNontrivial(new OWLEquivalentObjectPropertiesAxiomFrameSectionRow(getOWLEditorKit(), OWLEquivalentObjectPropertiesAxiomFrameSection.this, null, getRootObject(), ax)); } } }); }
protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_EQUIVALENT_OBJECT_PROPERTIES, () -> { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Node<OWLObjectPropertyExpression> equivalentObjectProperties = getReasoner().getEquivalentObjectProperties(getRootObject()); if (!equivalentObjectProperties.getEntitiesMinus(getRootObject()).isEmpty()) { OWLEquivalentObjectPropertiesAxiom ax = getOWLDataFactory().getOWLEquivalentObjectPropertiesAxiom(equivalentObjectProperties.getEntities()); if (!added.contains(ax)) { addInferredRowIfNontrivial(new OWLEquivalentObjectPropertiesAxiomFrameSectionRow(getOWLEditorKit(), OWLEquivalentObjectPropertiesAxiomFrameSection.this, null, getRootObject(), ax)); } } }); }