W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2009

The syntax of the SELECT clause.

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Mon, 14 Sep 2009 11:26:12 +0000
To: SPARQL Working Group <public-rdf-dawg@w3.org>
Message-ID: <B6CF1054FDC8B845BF93A6645D19BEA3693DEB1E80@GVW1118EXC.americas.hpqcorp.net>
Deciding on syntax can be a painful matter because once the basic technical issues are dealt with it comes down to aesthetics.

We will have to come to a decision on the SELECT expression syntax sometime (it's not needed for FPWD) so I have taken a look at as many systems that have been mentioned or I can find.  In each case, I have tried to go back to the definitive grammar, or failing that, what I think is the definitive documentation.  As such, the survey is bias to open source.

References used are listed at the end of the message.

Dimension of the designs include:
* Does the term after AS include the ? or not.
* Does the AS appear inside or outside any ().
* Allowing optional commas. The examples below don't show that.

Please add systems to the list and make corrections on the wiki:
http://www.w3.org/2009/sparql/wiki/Design:Project_Expression#Survey_of_syntax_forms_in_deployed_systems


	Andy

* Glitter

SELECT ?x ?y (?x+?y AS ?z)

* ARQ

SELECT ?x ?y (?x+?y AS ?z)

* RDF::Query

SELECT ?x ?y (?x+?y AS ?z)

* Virtuoso

Optional commas
() required with AS

SELECT ?x ?y (?x+?y) AS ?z
SELECT ?x ?y (?x) AS ?z

* Redland:RASQAL

4Store uses RASQAL.
Optional commas
() required with AS

SELECT ?x ?y (?x+?y) AS z

* ARC

SELECT ?x ?y count(?a) AS ?z

AS only with aggregates.

* Sesame:
I found a contributed parser (due to Jeen?) with

SELECT ?x ?y datatype(?a) AS "z"

----
Steve has proposed mandating commas in a SELECT form when an expression or AS is used.

SELECT ?x ?y ?z
SELECT ?x , ?y , count(?a) AS ?z
----


References:

RDF::Query
http://cpansearch.perl.org/src/GWILLIAMS/RDF-Query-2.200/lib/RDF/Query/Parser/SPARQLP.pm


Glitter:
http://svn.openanzo.org/svn/openanzo/openanzo/trunk/org.openanzo.rdf/grammar/sparql.jj


ARQ:
http://jena.svn.sourceforge.net/viewvc/jena/ARQ/trunk/Grammar/arq.jj


RASQAL:
http://svn.librdf.org/view/*checkout*/rasqal/trunk/src/sparql_parser.y


ARC2:
http://code.semsol.org/source/arc/parsers/ARC2_SPARQLPlusParser.php


Virtuoso:
http://docs.openlinksw.com/virtuoso/rdfsparqlimplementationextent.html


Sesame:
http://repo.aduna-software.org/svn/org.openrdf/sesame-ext/sparqlplus/trunk/src/main/java/org/openrdf/query/parser/sparqlplus/ast/sparql+.jjt


Received on Monday, 14 September 2009 11:26:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:08:28 GMT