private SqlExpr literalEqual(ValueExpr left, ValueExpr right, SqlCase scase)
throws UnsupportedRdbmsOperatorException
{
// TODO What about xsd:booleans?
SqlExpr labels = eq(label(left), label(right));
SqlExpr langs = and(eqIfNotNull(lang(left), lang(right)), labels.clone());
SqlExpr numeric = eq(numeric(left), numeric(right));
SqlExpr time = eq(time(left), time(right));
SqlExpr bothCalendar = and(isNotNull(time(left)), isNotNull(time(right)));
SqlExpr over14 = gt(abs(sub(time(left), time(right))), num(HR14 / 2));
SqlExpr comparable = and(bothCalendar, or(eq(zoned(left), zoned(right)), over14));
scase.when(or(isNotNull(lang(left)), isNotNull(lang(right))), langs);
scase.when(and(simple(type(left)), simple(type(right))), labels.clone());
scase.when(and(isNotNull(numeric(left)), isNotNull(numeric(right))), numeric);
scase.when(comparable, time);