RDF::Query 1.034
I’ve just uploaded a new version of RDF::Query (version 1.034). It should be available from CPAN shortly.
Notable changes in this release:
-
There’s initial support for compiling RDF queries directly into SQL queries using the Redland schema. This provides dramatic improvements in query runtime, especially when the query has an ORDER BY clause.
Currently, the SPARQL to SQL compiler is rather simple, handling only basic SELECT queries with no OPTIONAL blocks. That said, there is support for REGEX (in MySQL), ORDER BY, and LIMIT, with a plugin mechanism for implementing custom function-to-sql translations.
When called with database information, RDF::Query will attempt to compile the query to SQL and execute it directly through DBI, falling back on the existing query engine if the compilation fails. This allows the developer to benefit from the efficiency of the SQL compilation while relying on the SPARQL coverage of the existing engine.
As always with new features, this hasn’t been widely tested, nor am I claiming to have been able to accurately translate the SPARQL semantics into SQL. Use at your own risk.
Not to be out-done by yesterday’s release of Rasqal with JSON, the new RDF::Query has JSON serialization for bindings and boolean queries (actually, implemented because the new Rasqal hadn’t been released when I needed it).
Using unquoted integers, floats, true and false in SPARQL queries now results in literals that have appropriate XSD datetypes.