Re: Update on ORDERing solutions

On Fri, Mar 18, 2005 at 04:45:49 +0000, Andy Seaborne wrote:
> 3/ Syntax
> 
> SQL's "ORDER BY" clause
> 
> XQuery also has an "order by" clause: it specifies the modifiers in full: 
> "ascending" and "descending".  Each system can take an expression or a 
> column name (in SQL's case also a number).
> 
> 
> Proposed syntax (examples):
> 
> SELECT *
> WHERE { :x :p ?v . :x :q ?w }
> ORDER BY ?v ?w
> LIMIT  10
> OFFSET 10
> 
> 
> Confusion point: SPARQL does not have commas so I omitted them here too but 
> then
> 
> ORDER BY ?v DESCENDING ?w
> 
> is confusing (it means descending-in-?v, ascending-in-?w but is very easy 
> to miss read).
> 
> Alternative syntax: break from SQL, XQuery and have
>   DESC(?v) ?w
> or some other clear association of modifier with expression.
> 
> I prefer the (non-SQL) DESC(?x), ASC(xsd:integer(?x)) style for clarity.

Without commas? So do I, I think. I'm not toally happy about the fact that
ASC and DESC appear to be functions, unless they have some defination in
that sense.
 
> 4/ Ordering Expressions
> 
> We have a requirement (3.3) for extensible value testing.  Therefore, I put 
> in expressions for ordering (like xquery, SQL) which allows types unknown 
> to the core language to be ordered.  This also allows casting (useful for 
> dates in non-xsd:dateTime format or older RDF without datatypes).
> 
> ORDER BY xsd:integer(?v)
> 
> ORDER BY app:cordOrder(?x, ?y)
> 
> Such an ordering function must not cause an evaluation failure.  If it 
> does, it is not determined whether any results, some results or all the 
> results in some junk order are returned.

What does it return? A positional decimal? comparison function style -1,
0, +1?

- Steve 

Received on Saturday, 19 March 2005 12:03:04 UTC