System.out.println("--------------") ;
System.out.print(op) ;
System.out.println("--------------") ;
// ---- Execute expression
QueryIterator qIter = Algebra.exec(op, m.getGraph()) ;
// -------- Either read the query iterator directly ...
if ( false )
{
for ( ; qIter.hasNext() ; )
{
Binding b = qIter.nextBinding() ;
Node n = b.get(var_x) ;
System.out.println(FmtUtils.stringForNode(n)) ;
System.out.println(b) ;
}
qIter.close() ;
}
else
{
// -------- Or make ResultSet from it (but not both - reading an
// iterator consumes the current solution)
List<String> varNames = new ArrayList<String>() ;
varNames.add("x") ;
varNames.add("z") ;
ResultSet rs = new ResultSetStream(varNames, m, qIter);
ResultSetFormatter.out(rs) ;
qIter.close() ;
}
System.exit(0) ;
}