major technical: orthogonality

Section 10.1.3 "ORDER BY"
says that an ordering condition can be a variable or a function
call.  This points up a non-orthogonality in the design: function
calls are allowed in the ORDER BY but not the SELECT list.  And expressions
are not allowed in either.  The workaround is to add a variable to
a query and use it to compute the expression.  Example: suppose you
want to order by (price + tax).  You can write

SELECT ?item
WHERE { ?item v:price ?price . ?item v:tax ?tax .
        FILTER (?sum = ?price + ?tax) }
ORDER BY ?sum

But why is this workaround required for any expression in the SELECT
list, and any expression except a function call in the ORDER BY?

Fred Zemke

Received on Thursday, 12 January 2006 21:41:49 UTC