W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > October 2007

Re: Issue against june 14th edition of SPARQL

From: Lee Feigenbaum <lee@thefigtrees.net>
Date: Fri, 19 Oct 2007 12:12:51 -0400
Message-ID: <4718D783.3020201@thefigtrees.net>
To: Francis McCabe <frankmccabe@mac.com>
CC: public-rdf-dawg-comments@w3.org

Francis McCabe wrote:
> 
> Referring to
> 
> http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/
> 
> The treatment of the ORDER BY solution processing is less than clear.
> 
> The text states:
> 
> [16]  OrderClause  ::=  'ORDER' 'BY' OrderCondition+
> [17]  OrderCondition  ::=  ( 'ASC' | 'DESC' ) BrackettedExpression )
>              | ( Constraint | Var )
> 
> 
> This grammar permits *any* expression or constraint to be an order 
> condition. But the text fails to give clear semantics for this.
> 
> For example, what does
> 
> .... order by ?x < 34
> 
> mean?

Hi Frank,

Looking at 
http://www.w3.org/2001/sw/DataAccess/rq23/rq25.html#modOrderBy, I see:

"""
The ascending order of two solutions with respect to an ordering 
comparator is established by substituting the solution bindings into the 
expressions and comparing them with the "<" operator.
"""

In your example, if we had two solutions in a solution set, say:

?x
--
35
33

...then those two solutions would be ordered by evaluating the 
expression for each:

   33 < 34 --> "true"^^xsd:boolean
   35 < 34 --> "false"^^xsd:boolean

http://www.w3.org/2001/sw/DataAccess/rq23/rq25.html#OperatorMapping 
defines A < B for two xsd:boolean's based on op:boolean-less-than from 
XPath functions and operators: 
http://www.w3.org/TR/xpath-functions/#func-boolean-less-than

In short: false < true, and so the correct ordering of the above 
solutions becomes:

?x
--
33
35

Note that the text in the #modOrderBy has changed a bit in the editors' 
draft since the Candidate Recommendation publication to clarify the 
relative ordering of different types of terms.

To help our comment tracking, please let us know if this addresses your 
comment.

thanks,
Lee


> 
> Perhaps the intention is something like:
> 
> eval(Q order by Exp) = sort({ (S,Exp) .. S satisfies Q })
> 
> where
> 
> (S1,Exp1) o< (S2,Exp2) iff Exp1 < Exp2
> 
> However, that would not permit a reasonable interpretation for
> 
> order by ?x < 34
> 
> (which would seem to be a weird case anyway)
> 
> Looking forward to a response
> 
> Frank McCabe
> 
> P.S. It would have been helpful if the committee adopted an OASIS-style 
> policy of putting line numbers on the specification. Then I could quote 
> line numbers at you.
> 
> 
> 
> 
Received on Friday, 19 October 2007 16:13:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:52 GMT