Sparql Algebra 0.0.2 released

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 UTC