// Simple rewrite.
Node n = graphs.iterator().next() ;
return new OpQuadPattern(n, basicPattern) ;
}
OpSequence opSeq = OpSequence.create() ;
for ( Triple t : basicPattern )
{
// One expansion for each triple pattern.
Op union = null ;
for ( Node n : graphs )
{
BasicPattern bp = new BasicPattern() ;
bp.add(t) ;
Op pattern = new OpQuadPattern(n, bp) ;
union = OpUnion.create(union, pattern) ;
}
opSeq.add(union) ;
}
// More than one graph - make distinct
return new OpDistinct(opSeq) ;
}