Re: Updated SPARQL Query Results XML Format draft

Steve Harris wrote:
> On Thu, Jul 14, 2005 at 11:59:10AM +0100, Andy Seaborne wrote:
>>>>Maybe you just need to know that the results are ordered - i.e. an
>>>>isOrdered boolean flag.   Is isDistinct also needed?  Those seem to be
>>>>the two crucial flags that tell you the four forms of variable bindings
>>>>results you can get:
>>>>1. a bag (the default)
>>>>2. an ordered sequence (ORDER BY)
>>>>3. an ordered sequence with no duplicates (ORDER BY + DISTINCT)
>>>>4. a set (DISTINCT)
>>>Maybe, I'm not clear on any situations where the client might not know, and
>>>would care.
>>The only cases I see as being important in the result set
>>DISTINCTness is detectable in the results whereas ordering is not.
>>How about an optional attribute to the <results> element.
>>   <results order="true">
>>Then there is no consistency issue about funny index orders, missing 
>>indexes, or duplicates.
>>The next complexity level would be to number the variable declarations in 
>>the header indicating the order of the variables but that does not make 
>>sense for function ordering.  So, just an indication in the <results> 
>>element seems fine, if anything at all.
> Why optional? order="false" seems pretty reasonable, and optional
> things just make processing harder.
> - Steve

Simplest would be to put in nothing - currently, ARQ preserves ordering when 
reading regardless, preserves ordering when writing regardless and does not 
indictae it in the XML produced.  It's streamed (well, nearly so - I need to 
switch to StAX from SAX.  Or have a callback API (no!).  Details, details) and 
that is important for XML result set usage IMHO.

If it (order="") is mandatory, we also need a "don't know" value.

I can't think of a reason not to preserve order for the application.  The only 
usage I can think of is testing - where there are two result sets and they are 
to be compared.  But we use RDF for that.  It was an issue for the RDF form 
because the graph isn't order, so XML->RDF->XML might reorder or the RDF must 
retain indexes.  Both can be wrong but does it matter?

So, an XML result form which has no indicators of orderedness and an assumption 
that the results are in the order they are in the file is fine by me.  i.e. drop 
"2.3.3. Ordering Results"

The XSD version is a bit odd - the Relax => XSD seems to have put attribute 
"index" into a group which is not then mentioned in the XSD.  The attribute is 
used directly.

But nameAttr is used.  Axis does not care - it does nothing with the attribute 
groups and directly associates "name" with the class for Variable, just like 
"index" and the class Result.


Received on Thursday, 14 July 2005 12:26:11 UTC