use of com.inova8.intelligentgraph.path.PathTupleExpr in project com.inova8.intelligentgraph by peterjohnlawrence.
the class IntelligentStatementPaths method hasNext.
/**
* Checks for next.
*
* @return true, if successful
* @throws QueryEvaluationException the query evaluation exception
*/
@Override
public boolean hasNext() throws QueryEvaluationException {
if (resultsIterator != null && resultsIterator.hasNext()) {
return true;
} else {
while (pathIteration < this.sortedIterations.size()) {
CustomQueryOptions customQueryOptions = CustomQueryOption.getCustomQueryOptions(contexts, source.getRepositoryContext().getPrefixes());
pathTupleExpr = pathElement.pathPatternQuery(pathIteration, customQueryOptions);
if (this.thing == null && pathTupleExpr.getBoundVariable() == null) {
throw new QueryEvaluationException("Paths query unbound");
} else {
this.boundVariableName = pathTupleExpr.getBoundVariable().getName();
}
pathIteration++;
this.resultsIterator = intelligentGraphConnection.getResultsIterator(source, thing, pathElement, pathTupleExpr, contexts);
boolean hasNext = resultsIterator.hasNext();
if (hasNext)
return true;
}
return false;
}
}
Aggregations