Re: sorting tests moved to r2

Jeen Broekstra wrote:
> Seaborne, Andy wrote:
> 
>> ARQ fails test 11:
>>
>> Failure: Test 11 :: sort-11
>> Got: 8 --------------------------------
>> ------------------------------------------------------
>> | name                                               |
>> ======================================================
>> | "Alice"                                            |
>> | "Alice"^^<http://www.w3.org/2001/XMLSchema#string> |
>> | "Bob"                                              |
>> | "Bob"^^<http://www.w3.org/2001/XMLSchema#string>   |
>> | "Eve"                                              |
>> | "Eve"^^<http://www.w3.org/2001/XMLSchema#string>   |
>> | "Fred"                                             |
>> | "Fred"^^<http://www.w3.org/2001/XMLSchema#string>  |
>> ------------------------------------------------------
>> Expected: 8 -----------------------------
>> ------------------------------------------------------
>> | name                                               |
>> ======================================================
>> | "Alice"                                            |
>> | "Bob"                                              |
>> | "Eve"                                              |
>> | "Fred"                                             |
>> | "Alice"^^<http://www.w3.org/2001/XMLSchema#string> |
>> | "Bob"^^<http://www.w3.org/2001/XMLSchema#string>   |
>> | "Eve"^^<http://www.w3.org/2001/XMLSchema#string>   |
>> | "Fred"^^<http://www.w3.org/2001/XMLSchema#string>  |
>> ------------------------------------------------------
>>
>> ORDER BY is by the "<" operator unless it can't split two different RDF
>> terms.
>>
>> Under the extra conditions rq25 says:
>> [[
>> The "<" operator (see the Operator Mapping and 11.3.1 Operator
>> Extensibility) defines the relative order of pairs of numerics, simple
>> literals, xsd:strings, xsd:booleans and xsd:dateTimes. Pairs of IRIs are
>> ordered by comparing them as simple literals.
>> ....
>> 5. A plain literal is lower than an RDF literal with type xsd:string of
>> the same lexical form.
>> ]]
>>
>> The < operator makes "Alice"^^xsd:string < "Fred" and simple literals.
> 
> You are likely correct, but I am not sure how you arrived at this, talk
> me through with small words please. Condition 5 only states, as I read
> it, that:
> 
>   "Fred" < "Fred"^^xsd:string
> 
> In other words, two literals with the same lexical form only. It does
> not tell us how to order a plain/simple literal and a typed literal with
> different lexical values (for example "Alice"^^xsd:string and "Fred").
> 
> And I can't seem to find where this is defined, in fact. What am I
> overlooking?

The first papagraph says that ordering is by "<" where possible so:

   "Alice"^^xsd:string < "Bob"
   "Alice"^^xsd:string < "Bob"^^xsd:string
   "Alice" < "Bob"^^xsd:string

then rq25 says:

""
SPARQL also fixes an order between some kinds of RDF terms that would not 
otherwise be ordered:
"""

so that gives the ordering when they would not be ordered by "<"

Hence: "Alice" < "Alice"^^xsd:string

and combing these two parts only allows:

"Alice" < "Alice"^^xsd:string < "Bob" < "Bob"^^xsd:string

	Andy



> 
> Jeen

-- 
Hewlett-Packard Limited
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

Received on Tuesday, 26 June 2007 12:33:46 UTC