Re: Update on ORDERing solutions

On Mon, Mar 21, 2005 at 11:42:58 +0000, Andy Seaborne wrote:
> >>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.
> 
> ASC[] and DESC[] would be a different from functions.  How's that?

I'm not sure if thats better or not.
 
> ASC[?x]
> DESC[xsd:integer(?v)]
> 
> It would be nice to have a joining trailing marker
> 
> ?x\ASC
> xsd:integer(?v)\ASC
> 
> but I I can't think of one. \ is not a good choice!

Truely. I cant think of a good one, but given the definition of what the
functions do below (which seems good) I cant think of a funcitonal
definition of ASC() and DESC() that fits with that either.

It could be a modifier to the ORDER, eg.
	ORDER DESC BY ?x ?y ASC BY ?z

which is
	ORDER BY ?x DESC, ?y DESC, ?z ASC
in SQL speak

Looses SQL familiriarity points though.
 
> >What does it return? A positional decimal? comparison function style -1,
> >0, +1?
> 
> It returns an RDF value like any other function.  This isn't the collation 
> function, it is a transformation of the data.  cf. xsd:integer(?v) or 
> xsd:dateTime(?myDateFormat)

Hence the need for global ordering (int come before dates, etc.). Makes
sense.

- Steve

Received on Monday, 21 March 2005 15:05:11 UTC