{
QuadBlock tableQuads = new QuadBlock() ;
Set<Node> predicates = new HashSet<Node>(cols.keySet()) ;
// Use the fact that i'th quad is the trigger
Quad trigger = quadBlock.get(i) ;
Node subject = trigger.getSubject() ;
Node graph = trigger.getGraph() ;
for ( Node p : predicates )
{
int idx = quadBlock.findFirst(i, graph, subject, p, null) ;
if ( idx < 0 )
// No match.
// Conservative - must find all predicates
//return null ;
// Liberal - any predicates
continue ;
Quad q = quadBlock.get(idx) ;
tableQuads.add(q) ;
}
quadBlock.removeAll(tableQuads) ;
SqlStagePatternTable stage = new SqlStagePatternTable(graph, subject, tableQuads) ;