elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java
protected Set<? extends Node<ElkNamedIndividual>> queryDirectInstances(
			final ElkClassExpression classExpression)
			throws ElkInconsistentOntologyException, ElkException {

		final Set<? extends Node<ElkNamedIndividual>> result;

		if (computeQuery(classExpression, true)) {

			final InstanceTaxonomy<ElkClass, ElkNamedIndividual> taxonomy = instanceTaxonomyState
					.getTaxonomy();

			final Set<? extends Node<ElkNamedIndividual>> r = classExpressionQueryState_
					.getDirectInstances(classExpression, taxonomy);

			if (r == null) {
				result = taxonomy.getBottomNode().getDirectInstanceNodes();
			} else {
				result = r;
			}

		} else {
			// classExpression couldn't be indexed; pretend it is a fresh class

			result = Collections.emptySet();
		}

		incompleteness_.log(
				incompleteness_.getIncompletenessMonitorForClassExpressionQuery(
						classExpressionQueryState_
								.getOccurrenceStore(classExpression)));
		return result;
	}
protected Set<? extends Node<ElkNamedIndividual>> queryDirectInstances(
			final ElkClassExpression classExpression)
			throws ElkInconsistentOntologyException, ElkException {

		final Set<? extends Node<ElkNamedIndividual>> result;

		if (computeQuery(classExpression, true)) {

			final InstanceTaxonomy<ElkClass, ElkNamedIndividual> taxonomy = instanceTaxonomyState
					.getTaxonomy();

			final Set<? extends Node<ElkNamedIndividual>> r = classExpressionQueryState_
					.getDirectInstances(classExpression, taxonomy);

			if (r == null) {
				result = taxonomy.getBottomNode().getDirectInstanceNodes();
			} else {
				result = r;
			}

		} else {
			// classExpression couldn't be indexed; pretend it is a fresh class

			result = Collections.emptySet();
		}

		incompleteness_.log(
				incompleteness_.getIncompletenessMonitorForClassExpressionQuery(
						classExpressionQueryState_
								.getOccurrenceStore(classExpression)));
		return result;
	}
Computes all direct instances of the supplied (possibly complex) class
expression. The query state is updated accordingly.

@param classExpression
The queried class expression.
@return all direct instances of the supplied class expression.
@throws ElkInconsistentOntologyException
if the ontology is inconsistent
@throws ElkException
if the reasoning process cannot be completed successfully