private Node<OWLClass> getClassNode(ElkClass elkClass) throws FreshEntitiesException, InconsistentOntologyException, ElkException { try { return elkConverter_ .convertClassNode(reasoner_.getEquivalentClasses(elkClass)); } catch (ElkException e) { throw elkConverter_.convert(e); } }
private Node<OWLClass> getClassNode(ElkClass elkClass) throws FreshEntitiesException, InconsistentOntologyException, ElkException { try { return elkConverter_ .convertClassNode(reasoner_.getEquivalentClasses(elkClass)); } catch (ElkException e) { throw elkConverter_.convert(e); } }
private Node<OWLClass> getClassNode(ElkClass elkClass) throws FreshEntitiesException, InconsistentOntologyException, ElkException { try { return elkConverter_ .convertClassNode(reasoner_.getEquivalentClasses(elkClass)); } catch (ElkException e) { throw elkConverter_.convert(e); } }
/** * Return the {@code Node} containing equivalent classes of the given * {@link ElkClassExpression}. Calling of this method may trigger the * computation of the taxonomy, if it has not been done yet. * * @param classExpression * the {@link ElkClassExpression} for which to return the * {@link Node} * @return the set of {@link Node} whose members are {@link ElkClass}es * equivalent to the given {@link ElkClassExpression} * @throws ElkException * if the result cannot be computed */ public synchronized Node<ElkClass> getEquivalentClassesQuietly( ElkClassExpression classExpression) throws ElkException { try { return getEquivalentClasses(classExpression); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. return getTaxonomyQuietly().getBottomNode(); } }
/** * Return the {@code Node} containing equivalent classes of the given * {@link ElkClassExpression}. Calling of this method may trigger the * computation of the taxonomy, if it has not been done yet. * * @param classExpression * the {@link ElkClassExpression} for which to return the * {@link Node} * @return the set of {@link Node} whose members are {@link ElkClass}es * equivalent to the given {@link ElkClassExpression} * @throws ElkException * if the result cannot be computed */ public synchronized Node<ElkClass> getEquivalentClassesQuietly( ElkClassExpression classExpression) throws ElkException { try { return getEquivalentClasses(classExpression); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. return getTaxonomyQuietly().getBottomNode(); } }
/** * Return the {@code Node} containing equivalent classes of the given * {@link ElkClassExpression}. Calling of this method may trigger the * computation of the taxonomy, if it has not been done yet. * * @param classExpression * the {@link ElkClassExpression} for which to return the * {@link Node} * @return the set of {@link Node} whose members are {@link ElkClass}es * equivalent to the given {@link ElkClassExpression} * @throws ElkException * if the result cannot be computed */ public synchronized Node<ElkClass> getEquivalentClassesQuietly( ElkClassExpression classExpression) throws ElkException { try { return getEquivalentClasses(classExpression); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. return getTaxonomyQuietly().getBottomNode(); } }
@Override public Node<OWLClass> getEquivalentClasses(OWLClassExpression ce) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { LOGGER_.trace("getEquivalentClasses(OWLClassExpression)"); checkInterrupted(); try { return elkConverter_.convertClassNode( reasoner_.getEquivalentClasses(owlConverter_.convert(ce))); } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "getEquivalentClasses(OWLClassExpression)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } }
@Override public Node<OWLClass> getEquivalentClasses(OWLClassExpression ce) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { LOGGER_.trace("getEquivalentClasses(OWLClassExpression)"); checkInterrupted(); try { return elkConverter_.convertClassNode( reasoner_.getEquivalentClasses(owlConverter_.convert(ce))); } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "getEquivalentClasses(OWLClassExpression)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } }
@Override public Node<OWLClass> getEquivalentClasses(OWLClassExpression ce) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { LOGGER_.trace("getEquivalentClasses(OWLClassExpression)"); checkInterrupted(); try { return elkConverter_.convertClassNode( reasoner_.getEquivalentClasses(owlConverter_.convert(ce))); } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "getEquivalentClasses(OWLClassExpression)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } }
@Test public void testEquivalentClasses() throws ElkException { Reasoner reasoner = TestReasonerUtils.createTestReasoner( new EmptyAxiomLoader()); // empty ontology, query for conjunction ElkClass A = objectFactory.getClass(new ElkFullIri(":A")); ElkClass B = objectFactory.getClass(new ElkFullIri(":B")); ElkClassExpression queryExpression = objectFactory .getObjectIntersectionOf(A, B); assertEquals(0, reasoner.getEquivalentClasses(queryExpression).size()); // the following has reproduced Issue 23: assertEquals(0, reasoner.getEquivalentClasses(queryExpression).size()); }