W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > January 2006

Re: minor technical on 10.2 Selecting variables [OK?]

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Tue, 17 Jan 2006 18:59:21 +0000
Message-ID: <43CD3E89.9080705@hp.com>
To: Fred Zemke <fred.zemke@oracle.com>
Cc: public-rdf-dawg-comments@w3.org



Fred Zemke wrote:
> 
> 10.2 Selecting variables
> If SELECT * is used, what is order of the variables in the result?
> Perhaps the answer is that it is irrelevant because results are
> necessarily returned with the names of the variables.  This is certainly
> true of the XML format for returning results.  However, this format is
> not mandated.  If you do not care to specify the order of variables in
> SELECT *, then you should specify that results must be presented in a
> format that identifies the variable names.
> 
> Fred Zemke
> 
> 

Fred,

The order is undefined in the query language - it would be a local 
implementation matter as to the form of the presentation and API for handling 
queries.  An implementation may give them an ordering if it wishes, together 
with API calls based on that ordering, or it make use name-based access.  This 
is outside the scope of section 10.2.  Not every variable occurs in every 
solution - again, how that is presented to an application is not defined.

As you note, the only format the working group does provide is the "SPARQL 
Query Results XML Format" [1] which is a network presentation of the results:

"""
The order of the variable names in the sequence is the order of the variable 
names given to the argument of the SELECT statement in the SPARQL query. If 
SELECT * is used, the order of the names is undefined.
"""

and incidentally it also says later on:

"""
Each result element corresponds to one Query Solution in a result and contains 
child elements (in no particular order) for each Query Variable that appears 
in the solution. It is used to record how the query variables bind to RDF Terms.
"""

Again, some other protocol or use of existing connection technology may choose 
to make things ordered, maybe based on a query processor that gives the result 
some kind of order, but that is a private agreement between client and server 
in that case.

I hope that responds to your comment.  Please let us know if it does.

	Andy

[1] http://www.w3.org/2001/sw/DataAccess/rf1/
Received on Tuesday, 17 January 2006 18:59:38 GMT

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