Dave Beckett's blog

Rasqal 0.9.18 RDF Query Library Released

2010-02-14 16:05

Update: you want 0.9.19 not 0.9.18 after package configuration issue found. Links fixed.

This release of Rasqal adds draft syntax support for the SPARQL 1.1 Update language being developed by the W3C SPARQL Working Group. The SPARQL 1.1 Update W3C Working Draft of 2010-01-26 introduces the first syntax design with some uncertainties and gray areas still present (no grammar spec section yet). I added what I thought would work, avoiding the ambiguous WITH forms where everything is optional. Since this is draft work, this extra parsing is only done when the 'laqrs' query language syntax is chosen. LAQRS stands for LAQRS adds to Querying RDF in SPARQL.

This is just syntax and API support in Rasqal, so it means you can prepare the upload queries, but there is no code to execute it. The API allows getting access to the decoded sparql update (INSERT, DELETE with or without DATA) and graph operations (CLEAR, DROP etc.). There is still more to do, when the syntax gets changed in later drafts and there is no API to stream triple insert/deletes during parsing, to handle uploading and downloading large triple blocks. That would required a rewrite of the SPARQL parser to use a different technology than flex+bison (maybe lemon, maybe Ragel) as well as new APIs.

Rasqal has several things to finish for SPARQL 1.0 support (UNION and nested OPTIONALs don't work) but the recent rewrite of the query engine internals should make other SPARQL 1.1 parts such as aggregate functions and nested queries, a lot easier to do than with the old query engine. I will probably remove the old query engine from the codebase soon.

The second substantial change is a set of APIs moved from private to public in rasqal.h to enable the construction of query result sets and query result set rows (rasqal_row) via the public API. This allows query results to be read from a syntax or constructed by API as well as serialized to result formats, without any query being executed. Rasqal can be used with this addition to provide the sparql results syntax support for other applications that may have created query results via a different method. It can read query results formats from the SPARQL XML format (the standard format), and write or serialize them to SPARQL XML, SPARQL JSON, CSV, TSV and an ASCII Table format. This functionality is all available via Triplr where you can make HTTP GET URLs for saved queries.

The final change is in the area of resilience. The functions in the public API have been updated so that when invalid or NULL pointers are given, the functions return failure or NULL / false rather than try to use the pointer and probably crash. Hopefully I caught all of them. The release testing (as usual) included valgrind memory leak checking of all of the 100s of tests and there were no leaks or buffer overruns found.

This is also the first Rasqal release since switching to GIT as the source control for the Redland libraries so the source pointers have moved to git.librdf.org where details of how to check it out can be found.

So in summary, the main changes in this release are:

  • 0.9.19: Fix rasqal.pc to Requires raptor again.
  • Add initial draft parsing and API (NOT execution) support for SPARQL 1.1 Update W3C Working Draft of 2010-01-26.
  • Add public APIs (row, results, result formatter, variables table) so that query results can be built, read and written without a query.
  • Add API resilience checks for invalid NULL pointer arguments.
  • Many other bug fixes and improvements were made.

Fixed Issues:

  • 0000320: Add a void* user_data field to rasqal_variable
  • 0000323: Official MIME Type for JSON isn't text/json
  • 0000343: Mime type for 'table' results format is text/plan
  • 0000345: MIME Type and URI for TSV and CSV
  • 0000347: rasqal linking fix

See the Rasqal 0.9.19 Release Notes for the full details of the changes.

Download: at http://download.librdf.org/source/rasqal-0.9.19.tar.gz