W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2005

Report on SPARQL Grammar implementation experience using ANTLR.

From: Thompson, Bryan B. <BRYAN.B.THOMPSON@saic.com>
Date: Wed, 9 Mar 2005 11:05:46 -0500
Message-Id: <D24D16A6707B0A4B9EF084299CE99B3912CB468B@mcl-its-exs02.mail.saic.com>
To: "'public-rdf-dawg@w3.org'" <public-rdf-dawg@w3.org>
Cc: "Bebee, Bradley R." <BRADLEY.R.BEBEE@saic.com>, "Personick, Michael R." <MICHAEL.R.PERSONICK@saic.com>, "'maripuri_sandeep@bah.com'" <maripuri_sandeep@bah.com>

Hello,

I wanted to report on our implementation experience for the SPARQL
grammar using the ANTLR parser generator based on the Working Draft
of the SPARQL query language[1][2].  This implementation does not
handle SPARQL semantics.  As such, the feedback is mainly relevant
to the utility of the current working draft of the SPARQL grammar
to implementors.

Overall, the SPARQL grammar was relatively easy to realize using
ANTLR.  The main points of confusion were the productions for QNAME
and QNAME_NS, especially as used in the PrefixDecl production - the
productions as given could not be made to work without significant
refactoring.  Also, the Perl5 regex production was not given in the
grammar.

The implementation contains a test harness for the parser and another
for the lexer.  The parser accepts several of the DAWG Test Cases[3],
but it has not be vetted against all of the current test cases. (The
lexer test harness is currently non-functional owing to a problem
which has not yet been isolated either with the ANTLR lexer or with
how it is being invoked from the test harness.)

It would be useful from an implementation perspective if a bundle was
developed containing the test cases and sufficient metadata such that
a harness could easily be written or adapted to run the test cases
against a given implementation.

We plan to track subsequent working drafts and update this realization
of a SPARQL parser and lexer.  As of this writing, the parser produces
an AST using the default AST generation rules, and hence is not yet
suitable for query evaluation.  We are considering an RDF algebra as
a translation target that would make it possible to explore query
optimization and query evaluation.

Thanks,

-bryan

[1] http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050217
[2] http://proto.cognitiveweb.org/projects/cweb/multiproject/cweb-sparql/
[3] http://www.w3.org/2001/sw/DataAccess/tests/
Received on Wednesday, 9 March 2005 17:20:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:22 GMT