elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java
public synchronized Set<? extends Node<ElkClass>> getSuperClasses(
			ElkClassExpression classExpression, boolean direct)
			throws ElkInconsistentOntologyException, ElkException {
		if (classExpression instanceof ElkClass) {
			final TaxonomyNode<ElkClass> queryNode = getTaxonomyNode(
					(ElkClass) classExpression);
			return direct ? queryNode.getDirectSuperNodes()
					: queryNode.getAllSuperNodes();
		} else {

			final Set<? extends Node<ElkClass>> superNodes = queryDirectSuperClasses(
					classExpression);
			if (direct) {
				return superNodes;
			}
			// else all nodes

			final Taxonomy<ElkClass> taxonomy = restoreTaxonomy();

			return TaxonomyNodeUtils.getAllReachable(Operations.map(superNodes,
					new Operations.Transformation<Node<ElkClass>, TaxonomyNode<ElkClass>>() {

						@Override
						public TaxonomyNode<ElkClass> transform(
								final Node<ElkClass> node) {
							return taxonomy.getNode(node.getCanonicalMember());
						}

					}),
					new Operations.Functor<TaxonomyNode<ElkClass>, Set<? extends TaxonomyNode<ElkClass>>>() {

						@Override
						public Set<? extends TaxonomyNode<ElkClass>> apply(
								final TaxonomyNode<ElkClass> node) {
							return node.getDirectSuperNodes();
						}

					});
		}

	}
public synchronized Set<? extends Node<ElkClass>> getSuperClasses(
			ElkClassExpression classExpression, boolean direct)
			throws ElkInconsistentOntologyException, ElkException {
		if (classExpression instanceof ElkClass) {
			final TaxonomyNode<ElkClass> queryNode = getTaxonomyNode(
					(ElkClass) classExpression);
			return direct ? queryNode.getDirectSuperNodes()
					: queryNode.getAllSuperNodes();
		} else {

			final Set<? extends Node<ElkClass>> superNodes = queryDirectSuperClasses(
					classExpression);
			if (direct) {
				return superNodes;
			}
			// else all nodes

			final Taxonomy<ElkClass> taxonomy = restoreTaxonomy();

			return TaxonomyNodeUtils.getAllReachable(Operations.map(superNodes,
					new Operations.Transformation<Node<ElkClass>, TaxonomyNode<ElkClass>>() {

						@Override
						public TaxonomyNode<ElkClass> transform(
								final Node<ElkClass> node) {
							return taxonomy.getNode(node.getCanonicalMember());
						}

					}),
					new Operations.Functor<TaxonomyNode<ElkClass>, Set<? extends TaxonomyNode<ElkClass>>>() {

						@Override
						public Set<? extends TaxonomyNode<ElkClass>> apply(
								final TaxonomyNode<ElkClass> node) {
							return node.getDirectSuperNodes();
						}

					});
		}

	}
public synchronized Set < ? extends Node < ElkClass > > getSuperClasses ( ElkClassExpression classExpression , boolean direct ) throws ElkInconsistentOntologyException , ElkException { if ( classExpression instanceof ElkClass ) { final TaxonomyNode < ElkClass > queryNode = getTaxonomyNode ( ( ElkClass ) classExpression ) ; return direct ? queryNode . getDirectSuperNodes ( ) : queryNode . getAllSuperNodes ( ) ; } else { final Set < ? extends Node < ElkClass > > superNodes = queryDirectSuperClasses ( classExpression ) ; if ( direct ) { return superNodes ; } // else all nodes final Taxonomy < ElkClass > taxonomy = restoreTaxonomy ( ) ; return TaxonomyNodeUtils . getAllReachable ( Operations . map ( superNodes , new Operations . Transformation < Node < ElkClass > , TaxonomyNode < ElkClass > > ( ) { @ Override public TaxonomyNode < ElkClass > transform ( final Node < ElkClass > node ) { return taxonomy . getNode ( node . getCanonicalMember ( ) ) ; } } ) , new Operations . Functor < TaxonomyNode < ElkClass > , Set < ? extends TaxonomyNode < ElkClass > > > ( ) { @ Override public Set < ? extends TaxonomyNode < ElkClass > > apply ( final TaxonomyNode < ElkClass > node ) { return node . getDirectSuperNodes ( ) ; } } ) ; } }
Return the (direct or indirect) superclasses 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 superclasses. 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
superclass {@link Node}s
@param direct
if {@code true}, only direct superclasses are returned
@return the set of {@link Node}s for direct or indirect superclasses of
the given {@link ElkClassExpression} according to the specified
parameter
@throws ElkInconsistentOntologyException
if the ontology is inconsistent
@throws ElkException
if the result cannot be computed
Return the ( direct or indirect ) superclasses 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 superclasses . Calling of this method may trigger the computation of the taxonomy if it has not been done yet .