/** * 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(); } }
protected static void printResult(Reasoner reasoner, Writer writer) throws IOException, ElkException { Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomyQuietly(); TaxonomyPrinter.dumpTaxomomy(taxonomy, writer, false); writer.flush(); }
@SuppressWarnings("static-method") protected String getResultHash(Reasoner reasoner) throws ElkException { return TaxonomyPrinter.getHashString(reasoner.getTaxonomyQuietly()); }
@Override public TaxonomyTestOutput<?> getExpectedOutput() throws Exception { LOGGER_.trace( "======= Computing Expected Taxonomy ======="); final Taxonomy<ElkClass> taxonomy = getStandardReasoner() .getTaxonomyQuietly(); return new TaxonomyTestOutput<Taxonomy<ElkClass>>( taxonomy); }
@Override public TaxonomyTestOutput<?> getActualOutput() throws Exception { LOGGER_.trace( "======= Computing Incremental Taxonomy ======="); final Taxonomy<ElkClass> taxonomy = getIncrementalReasoner() .getTaxonomyQuietly(); return new TaxonomyTestOutput<Taxonomy<ElkClass>>( taxonomy); }
@Override public TaxonomyTestOutput<?> getActualOutput() throws Exception { final Taxonomy<ElkClass> taxonomy = getReasoner() .getTaxonomyQuietly(); return new TaxonomyTestOutput<Taxonomy<ElkClass>>(taxonomy); }
/** * Return the (direct or indirect) subclasses of the given * {@link ElkClassExpression} as specified by the parameter. The method * returns a set of {@link Node}s, each of which representing an equivalent * class of subclasses. 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 * subclass {@link Node}s * @param direct * if {@code true}, only direct subclasses should be returned * @return the set of {@link Node}s for direct or indirect subclasses of the * given {@link ElkClassExpression} according to the specified * parameter * @throws ElkException * if the result cannot be computed */ public synchronized Set<? extends Node<ElkClass>> getSubClassesQuietly( final ElkClassExpression classExpression, final boolean direct) throws ElkException { try { return getSubClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSubNodes() : node.getAllSubNodes(); } }
/** * Return the (direct or indirect) subclasses of the given * {@link ElkClassExpression} as specified by the parameter. The method * returns a set of {@link Node}s, each of which representing an equivalent * class of subclasses. 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 * subclass {@link Node}s * @param direct * if {@code true}, only direct subclasses should be returned * @return the set of {@link Node}s for direct or indirect subclasses of the * given {@link ElkClassExpression} according to the specified * parameter * @throws ElkException * if the result cannot be computed */ public synchronized Set<? extends Node<ElkClass>> getSubClassesQuietly( final ElkClassExpression classExpression, final boolean direct) throws ElkException { try { return getSubClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSubNodes() : node.getAllSubNodes(); } }
} catch (final ElkInconsistentOntologyException e) { final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSuperNodes()
/** * Return the (direct or indirect) subclasses of the given * {@link ElkClassExpression} as specified by the parameter. The method * returns a set of {@link Node}s, each of which representing an equivalent * class of subclasses. 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 * subclass {@link Node}s * @param direct * if {@code true}, only direct subclasses should be returned * @return the set of {@link Node}s for direct or indirect subclasses of the * given {@link ElkClassExpression} according to the specified * parameter * @throws ElkException * if the result cannot be computed */ public synchronized Set<? extends Node<ElkClass>> getSubClassesQuietly( final ElkClassExpression classExpression, final boolean direct) throws ElkException { try { return getSubClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so also to owl:Nothing. final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSubNodes() : node.getAllSubNodes(); } }
} catch (final ElkInconsistentOntologyException e) { final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSuperNodes()
} catch (final ElkInconsistentOntologyException e) { final TaxonomyNode<ElkClass> node = getTaxonomyQuietly() .getBottomNode(); return direct ? node.getDirectSuperNodes()
@SuppressWarnings("unchecked") private String getFailureMessage(Reasoner testReasoner, final OnOffVector<T> changingAxioms, final List<T> staticAxioms, long seed) throws ElkException { LOGGER_.trace("====== FAILURE! ===="); LOGGER_.trace("= Expected Reasoner Computation ="); Reasoner standardReasoner = io_.createReasoner(Operations .concat(changingAxioms.getOnElements(), staticAxioms)); standardReasoner.getTaxonomyQuietly(); LOGGER_.trace("Current axioms"); printCurrentAxioms( Operations.concat(changingAxioms.getOnElements(), staticAxioms), LogLevel.DEBUG); StringWriter writer = new StringWriter(); try { writer.write("EXPECTED TAXONOMY:\n"); printResult(standardReasoner, writer); writer.write("\nINCREMENTAL TAXONOMY:\n"); printResult(testReasoner, writer); writer.flush(); } catch (IOException ioe) { // TODO } return "Seed: " + seed + "\n" + writer.getBuffer().toString(); }
Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomyQuietly();
Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomyQuietly();
Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomyQuietly(); if (options.hasArgument(outputFile)) writeClassTaxonomyToFile(options.valueOf(outputFile),
Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomyQuietly(); taxonomy = reasoner.getTaxonomyQuietly();