Re: SPARQL.js: a SPARQL 1.1 parser for JavaScript

On Aug 22, 2014, at 9:26 AM, Ruben Verborgh <ruben.verborgh@ugent.be> wrote:

> Hi Jonas,
> 
>> You mention "full SPARQL 1.1 support" in your blog entry - does that 
>> mean full coverage of "SPARQL 1.1 Query language" or _all_ SPARQL specs?
> 
> It means the grammar as specified in the SPARQL 1.1 query language document,
> and this grammar includes:
> - http://www.w3.org/TR/sparql11-update/
> - http://www.w3.org/TR/sparql11-federated-query/
> 
> So yes, it can parse INSERT and SERVICE queries too :-)
> 
>> Put differently - how does it compare to these?: 
>> http://www.w3.org/2009/sparql/implementations/
> 
> It should pass all parser tests.
> 
> I would gladly use the SPARQL syntax test suite (as I did for Turtle [1]),
> but unlike Turtle, the SPARQL test suite doesn't seem to give the correct solution.

How so? There are certainly differences if you're using RDF 1.1 semantics, but these are fairly minor.

> So all I can do is a simple accept/reject test, which doesn't seem that interesting.
> (Unless somebody has a better idea?)

The approach I used for the Ruby SPARQL gem is to ensure that the grammar parses to essentially the same algebra as Jena produces. I have a copy of these results included with the published tests at [2]. For example, parsing data-sparql11/exists/exists01.rq should generate data-sparql11/exists/exists01.sse.

I separately run the results of the algebra (e.g., the exists01.sse) against the dataset, and verify that the results (exists01.srx) are generated, as well as doing the complete .rq to .srx path for each test. I found this approach to be pretty effective at implementing most everything; the few things that this doesn't cover are done in some gem-specific rspec tests.

Gregg

> Best,
> 
> Ruben
> 
> [1] https://github.com/RubenVerborgh/N3.js/tree/master/spec
[2] https://github.com/ruby-rdf/sparql/tree/develop/spec/dawg/data-sparql11

Received on Saturday, 23 August 2014 23:24:49 UTC