String tableName = statements.getTableName(vf.getInternalId(pred), subjId, objId, ctxIds);
SqlQueryBuilder query = factory.createSqlQueryBuilder();
query.select().column("t", "ctx");
query.select().append("CASE WHEN cu.value IS NOT NULL THEN cu.value WHEN clu.value IS NOT NULL THEN clu.value ELSE cb.value END");
query.select().column("t", "subj");
query.select().append("CASE WHEN su.value IS NOT NULL THEN su.value WHEN slu.value IS NOT NULL THEN slu.value ELSE sb.value END");
query.select().column("pu", "id");
query.select().column("pu", "value");
query.select().column("t", "obj");
query.select().append("CASE WHEN ou.value IS NOT NULL THEN ou.value" +
" WHEN olu.value IS NOT NULL THEN olu.value" +