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

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

			final Taxonomy<ElkClass> taxonomy = restoreTaxonomy();

			return TaxonomyNodeUtils.getAllReachable(Operations.map(subNodes,
					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.getDirectSubNodes();
						}

					});
		}

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

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

			final Taxonomy<ElkClass> taxonomy = restoreTaxonomy();

			return TaxonomyNodeUtils.getAllReachable(Operations.map(subNodes,
					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.getDirectSubNodes();
						}

					});
		}

	}
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 ElkInconsistentOntologyException
if the ontology is inconsistent
@throws ElkException
if the result cannot be computed