{
if ( opQuad.isEmpty() )
return TableFactory.createUnit() ;
ExecutionContext cxt = evaluator.getExecContext() ;
DatasetGraph ds = cxt.getDataset() ;
BasicPattern pattern = opQuad.getBasicPattern() ;
if ( ! opQuad.getGraphNode().isVariable() )
{
if ( ! opQuad.getGraphNode().isURI() )
{ throw new ARQInternalErrorException("Not a URI or variable: "+opQuad.getGraphNode()) ;}
Graph g = null ;
if ( opQuad.isDefaultGraph() )
g = ds.getDefaultGraph() ;
else
g = ds.getGraph(opQuad.getGraphNode()) ;
if ( g == null )
return new TableEmpty() ;
ExecutionContext cxt2 = new ExecutionContext(cxt, g) ;
QueryIterator qIter = executeBGP(pattern, QueryIterRoot.create(cxt2), cxt2) ;
return TableFactory.create(qIter) ;