if ( ! Var.isVar(opGraph.getNode()) )
{
Graph graph = execCxt.getDataset().getGraph(opGraph.getNode()) ;
if ( graph == null )
// No such name in the dataset
return new TableEmpty() ;
ExecutionContext execCxt2 = new ExecutionContext(execCxt, graph) ;
Evaluator e2 = EvaluatorFactory.create(execCxt2) ;
return eval(e2, opGraph.getSubOp()) ;
}
// Graph node is a variable.
Var gVar = Var.alloc(opGraph.getNode()) ;
Table current = null ;
for ( Iterator<Node> iter = execCxt.getDataset().listGraphNodes() ; iter.hasNext() ; )
{
Node gn = iter.next();
Graph graph = execCxt.getDataset().getGraph(gn) ;
ExecutionContext execCxt2 = new ExecutionContext(execCxt, graph) ;
Evaluator e2 = EvaluatorFactory.create(execCxt2) ;
Table tableVarURI = TableFactory.create(gVar, gn) ;
// Evaluate the pattern, join with this graph node possibility.
// XXX If Var.ANON then no-opt.
Table patternTable = eval(e2, opGraph.getSubOp()) ;
Table stepResult = evaluator.join(patternTable, tableVarURI) ;
if ( current == null )
current = stepResult ;
else
current = evaluator.union(current, stepResult) ;
}
if ( current == null )
// Nothing to loop over
return new TableEmpty() ;
return current ;
}