Map<String, ColumnVar> vars = new HashMap<String, ColumnVar>(4);
for (ColumnVar var : new ColumnVar[] { s, p, o, c }) {
from.addVar(var);
Value value = var.getValue();
if (vars.containsKey(var.getName())) {
IdColumn existing = new IdColumn(vars.get(var.getName()));
from.addFilter(new SqlEq(new IdColumn(var), existing));
}
else if (value != null && !var.isImplied()) {
try {
NumberValue vc = new NumberValue(vf.getInternalId(value));
from.addFilter(new SqlEq(new RefIdColumn(var), vc));