W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > March 2011

Sparql Algebra 0.0.2 released

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Thu, 3 Mar 2011 21:13:05 -0500
To: "public-rdf-ruby@w3.org" <public-rdf-ruby@w3.org>
CC: Arto Bendiken <arto.bendiken@gmail.com>, Ben Lavender <blavender@gmail.com>
Message-ID: <4E03D42E-77E3-467C-9C7E-B5512BF71334@kellogg-assoc.com>
For those intrepid enough, I've pushed version 0.0.2 of sparql-algebra [1]. It relies on unreleased changes to RDF.rb and sxp-ruby, so you need to use bundler with the included Gemfile.

SPARQL Algebra implements the s-expression-based SPARQL algebra described in [2] and [3]. Remaining work needed for _describe_ operator and query optimizations. This is the base for translation from SPARQL Grammar [4], which requires just a bit more work to be fully compliant. Both of these, along with support for an HTTP endpoint and solution serializer, will be sufficient to implement a complete SPARQL solution in pure Ruby.

SPARQL Algebra passes all but four W3C DAWG tests (data-r2), with those four not being worth implementing, in my opinion. As an example of an SSE based on the SPARQL grammar, consider the following:

  PREFIX  foaf:   <http://xmlns.com/foaf/0.1/>

  SELECT ?mbox ?name
     {
       ?x foaf:mbox ?mbox .
       OPTIONAL { ?x foaf:name  ?name } .
     }

which is equivalent to the following SSE:

  (prefix ((foaf: <http://xmlns.com/foaf/0.1/>))
    (project (?mbox ?name)
      (leftjoin
        (bgp (triple ?x foaf:mbox ?mbox))
        (bgp (triple ?x foaf:name ?name)))))


There are outstanding pull requests to RDF.rb and sxp-ruby that are required to release it to RubyGems, but you're encouraged to play with it and send feedback!

Thanks to Arto and Ben for the initial work they did on this, and other enabling projects, as well as creating an excellent executable test suite!

Gregg

[1] https://github.com/gkellogg/sparql-algebra
[2] http://www.w3.org/TR/rdf-sparql-query/#sparqlAlgebra
[3] http://openjena.org/wiki/SSE
Received on Friday, 4 March 2011 02:14:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 4 March 2011 02:14:06 GMT