}
// ---- Choose the table to access
// The default graph table may be a specialized table (e.g. triples, not quads).
TableDescQuads tableDesc = null ;
String alias = null ;
if ( accessStoredDefaultGraph )
{
tableDesc = request.getStore().getTripleTableDesc() ;
alias = request.genId(AliasesSql.TriplesTableBase) ;
}
else
{
tableDesc = request.getStore().getQuadTableDesc() ;
alias = request.genId(AliasesSql.QuadTableBase) ;
}
SqlTable table = new SqlTable(alias, tableDesc.getTableName()) ;
if ( accessStoredDefaultGraph )
table.addNote(FmtUtils.stringForTriple(quad.asTriple(), request.getPrefixMapping())) ;
else
table.addNote(FmtUtils.stringForQuad(quad, request.getPrefixMapping())) ;
// Only constrain the G column
// IF there is a graph column (so it's not the triples table)
// AND if we are not unioning the named graphs.
if ( ! accessStoredDefaultGraph && ! accessUnionGraph )
slotCompiler.processSlot(request, table, conditions, quad.getGraph(),
tableDesc.getGraphColName()) ;
slotCompiler.processSlot(request, table, conditions, quad.getSubject(),
tableDesc.getSubjectColName()) ;
slotCompiler.processSlot(request, table, conditions, quad.getPredicate(),
tableDesc.getPredicateColName()) ;
slotCompiler.processSlot(request, table, conditions, quad.getObject(),
tableDesc.getObjectColName()) ;
return SqlBuilder.restrict(request, table, conditions) ;
}