Rasqal RDF Query Library - Release Notes

Rasqal 0.9.8 Changes

SPARQL Query Language Changes

Grammar updated to follow the SPARQL Query Language for RDF, W3C Working Draft, 17 February 2005.

Added support for casting in constraint expresions for datatyped literals with the syntax qname(literal) such as xsd:decimal("10").

Added named graphs parsing with LOAD and note that UNION cannot be handled yet, SOURCE and [...] syntax for optionals are deprecated.

Query Engine Changes

Engine now operates over a hierarchy of rasqal_graph_pattern objects, where at the root the query has a single query graph rather than a sequence of graph patterns. The query graph contains the former sequence of graph patterns.

Constraints can be applied to any graph pattern, not just at the top level of a query.

Added casting expressions type RASQAL_EXPR_CAST and constructor rasqal_new_cast_expression.

Fixed setting of a triple origin (SPARQL GRAPH) which was not working in 0.9.7

xsd:boolean RDF literals are now promoted into internal RASQAL_LITERAL_BOOLEAN typed rasqal_literal like for XSD integer and double.

The query engine uses the named graph information when evaluating queries, passing it to the rasqal_triples_match factory methods either implemented with raptor or redland as a rasqal_triples_source_factory and returning them as results of variable bindings.

Query API Changes

Added no-arg constructor rasqal_new_graph_pattern

Added method rasqal_graph_pattern_add_triples to add triples to an existing graph pattern.

Added methods rasqal_graph_pattern_add_constraint, rasqal_graph_pattern_get_constraint_sequence and rasqal_graph_pattern_get_constraint to add constraints to a graph pattern.

Added method rasqal_graph_pattern_add_sub_graph_pattern to add a sub-graph pattern to a graph pattern.

Added a Data Graph class with constructor rasqal_new_data_graph, destructor rasqal_free_data_graph and debug method rasqal_data_graph_print.

Added query methods for data graphs: rasqal_query_add_data_graph, rasqal_query_get_data_graph_sequence, rasqal_query_get_data_graph.

Deprecated query methods rasqal_query_add_constraint, rasqal_query_get_constraint_sequence rasqal_query_get_constraint, rasqal_query_add_source, rasqal_query_get_source_sequence and rasqal_query_get_source. These will be removed in the next release.

Removed functions deprecated in previous version: rasqal_query_get_variable_sequence and rasqal_query_add_triple.

Rasqal 0.9.7 Changes

General Changes

Fix a resource clean up when query results are either not read at all or not fully exhausted. This caused a problem in Redland when it held on to MySQL database handles despite a query having ended.

Added option -n/--dryrun to roqet to stop after preparing the query. Added option -w/--walk-query to walk and print the query using the graph API.

Portability fixes for win32 - define RASQAL_INLINE and use it as for raptor. (Dave Viner)

Make rasqal tests work when building against raptor in a sibling source tree.

Query Engine Changes

Added a graph pattern API with rasqal_graph_pattern typedef and rasqal_pattern_flags enum with value RASQAL_PATTERN_FLAGS_OPTIONAL to allow complete walking of the query structure.

Two new methods to the query class were added to support this: rasqal_query_get_graph_pattern_sequence to get the raptor_sequence of graph patterns in a query and rasqal_query_get_graph_pattern to get individual an graph pattern by index.

The new graph pattern methods added are:

Deprecated rasqal_query_add_triple as it doesn't construct the graph patterns and is of little use as it does not build the correct query structures.

Added query API methods to get the bound and all variables in a query: rasqal_query_get_bound_variable_sequence and rasqal_query_get_all_variable_sequence respectively. Deprecated rasqal_query_get_variable_sequence as too ambiguous.

With the aid of gcc -Wswitch-enum, found and fixed cases where switch on enumerated values were missing cases. The remaining cases return failure or an error message rather than abort(). This fixed a crash when comparing for equality a variable ?x with a blank node value and an interger.

Deleted RASQAL_EXPR_PATTERN as it was never used.

Added rasqal_query_get_distinct to get a query-specified distinct results flag.

Added rasqal_query_get_limit to get a query-specified limit on the number of results.

SPARQL Query Language Changes

Updated some of the SPARQL syntax to match the changes in the SPARQL Query Language for RDF W3C Working Draft of 17 February 2005. Added GRAPH replacing SOURCE and WITH replacing FROM. Added warnings about using the older forms and about using [...] instead of OPTIONAL.

Added recording of DISTINCT and LIMIT in the query structures but not yet used by the query engine.

RDQL Query Language Changes

None.

Rasqal 0.9.6 Changes

General Changes

Fix a bug in writing a query result to XML when blank nodes are used. Now also correctly uses the base URI when pass in to the writing method.

Added support for three types of query result - bindings (the only one in previous versions), an RDF graph and a boolean. Added rasqal_query_results methods to test the type of the result: rasqal_query_results_is_bindings, rasqal_query_results_is_boolean and rasqal_query_results_is_graph.

Added rasqal_query_results_get_triple to get current triple as a raptor_statement and rasqal_query_results_next_triple to move to the next triple.

Added rasqal_query_results_get_boolean to get a boolean query result value.

Added rasqal_triple copy constructor rasqal_new_triple_from_triple.

Query Engine Changes

Constructs an RDF graph result as a sequence of triples. This enables the SPARQL CONSTRUCT form to work.

Can return a boolean result indicating that there were variable binding results, but not returning them. This enables the SPARQL ASK form to work.

Added a new function expression - rasqal_op enum value RASQAL_EXPR_FUNCTION, added new name and args fields to the rasqal_expression structure and added rasqal_new_function_expression to construct this expression.

Added new 1-argument expression RASQAL_EXPR_STR returning a string version of the expression.

Added new 1-argument expressions operating on RDF literals: RASQAL_EXPR_LANG returning the language string of an RDF literal, RASQAL_EXPR_DATATYPE returning the datatype URI of an RDF literal.

Added new 1-argument testing expressions returning booleans: RASQAL_EXPR_BOUND true if the variable argument is bound to a value, RASQAL_EXPR_ISURI true if the argument is a URI, RASQAL_EXPR_ISBLANK true if the argument is a blank node and RASQAL_EXPR_ISLITERAL true if the argument is an RDF literal.

Fixed a problem in optional results returning extra results with no new bindings.

SPARQL Query Language Changes

The SPARQL Parser now allows UTF-8 and \u, \U in prefixes and QNames.

Now supports CONSTRUCT and ASK queries using the updated query engine features.

OPTIONAL can now be used wherever [ ... ] could be used (parser bug fix).

Now supports the SPARQL built-in functions STR() returning a string version of the expression, LANG() returning the language string of an RDF literal, DATATYPE() returning the datatype URI of an RDF literal, BOUND() testing if a variable is bound, ISURI() testing if an expression is a URI, ISBLANK() testing if an expression is a blank node and ISLITERAL() testing if an expression is an RDF literal.

Now supports SPARQL BASE directive for setting the base URI of a query. This is experimental and may not be in the next version or may not be in the final SPARQL language.

The parser now expands QNames correctly when used in literals like "blah"^^xsd:string.

RDQL Query Language Changes

The RDQL Parser now allows UTF-8 and \u, \U in prefixes and QNames. This makes RDQL testsuite tests S-03, S-04 and S-05 work.

Rasqal 0.9.5 Changes

A release with major changes internal to the query engine to operate over graph patterns instead of sequences of triple patterns and to add execution of optional graph patterns. Additionally the query results can now be written in a recognised XML format.

This version of Rasqal requires Raptor 1.4.4.

Core Changes

Added a rasqal_graph_pattern class for handling matching a graph pattern (set of triple patterns) in an rasqal_query. RDQL only has one of these wheras SPARQL may have many, and they may be nested (this may change, as SPARQL is under development).

Added rasqal_query_results_write method to write variable binding query results to a raptor_iostream in the XML format defined by SPARQL Variable Binding Results XML Format, W3C Working Draft, 21 December 2004.

Query Engine Changes

Updated the query engine to operate over graph patterns rather than a single sequence of triple patterns. The graph patterns may be optional, which is used to implement SPARQL optionals. Nested graph patterns are constructed but cannot yet be executed.

Added a unary minus expression type.

Improved the type promotion for expression evaluation. Try to evaluate strings as doubles or integers if the operation contains one double or integer respectively.

Fixed a memory leak with string matches/non-matches.

SPARQL Query Language Changes

Optional graph patterns OPTIONAL and [ ... ] now work.

Added the { ... } group syntax and removed the ( ... ) form.

$ was added as an allowed variable prefixes.

A warning was added to show SOURCE * is ignored.

Added the UNION keyword, unsupported.

Rasqal now passes the DAWG SPARQL test cases: Optional triples (dawg-opt-query-001, dawg-opt-query-002, dawg-opt-query-003, dawg-opt-query-004) and examples from query WD (sparql-query-example-2.1a, sparql-query-example-2.2a, sparql-query-example-2.3a, sparql-query-example-2.4a, sparql-query-example-3)

Allow UTF-8 qname prefixes and check name against XML name constraints.

Recover lexer state from errors in regexes.

Terminate the lexer on a syntax error, rather than produce multiple errors.

RDQL Query Language Changes

The lexer now handles UTF-8 qname prefixes, enabling RDQL testsuite test S-02 to pass.

Allow UTF-8 qname prefixes and check name against XML name constraints.

Recover lexer state from errors in regexes.

Terminate the lexer on a syntax error, rather than produce multiple errors.

Rasqal 0.9.4 Changes

Pass on raptor parser errors to rasqal's error routines and upwards.

Clean up several memory allocations when a query fails to prepare or execute fully.

Fixed lexer jams when a query contained an illegal variable name after a '?'.

Fixed lexer crashes when a query ended in a regex pattern like /abc/.

Tidied up the testing framework so 'make distcheck' works.

Rasqal 0.9.3 Changes

Rasqal's License was changed from LGPL 2.1/MPL 1.1 to LGPL 2.1/Apache 2

Added support for the SPARQL Query Language for RDF, W3C Working Draft, 12 October 2004 from the W3C RDF Data Access Working Group (DAWG). The support is at the basic syntax level - token lexer and grammar parser which passes the first simple tests from the proposed DAWG testcases. No additional query engine support has been added for SPARQL features that are not supported by RDQL. The Rasqal to do list contains full details of the implementation state.

Queries can now be prepared and then executed multiple times.

Added configure --enable-query-languages option with rdql and sparql as the choices.

Thanks to Chris Pointon for several patches to make Rasqal easier to build under Win32. Applied with some modifications. Renamed the RDQL and SPARQL syntax tokens ERROR to ERROR_TOKEN to help.

Added experimental support for querying multiple sources; the same query is executed over each source in turn. Also added some support for returning the source URI which is not yet enabled as this feature is in flux in the DAWG work. This may change or be removed in future versions.

roqet can specify a data source URI on the command line with -s / --source) URI for queries executing against an implicit model.

Added the DAWG SPARQL test cases driven from the manifest.n3 format. Created tests from the examples in the working draft.

Added an experimental XML result format for bindings, based on DAWG work. Enabled in roqet with -o xml. This is very likely to change or replaced in future versions.

Added roqet argument -d / --dump-query to dump the processed query, rather than do it by default (0.9.2 and earlier).

roqet can now read queries from URIs, using the raptor_www class to do the retrieval.

Fixed the configure checks for a posix regex function regcomp to correctly discover it is present.

Internal changes

Added support for declaring prefixes for XML-style QNames both before and after their use.

The struct rasqal_prefix gained a declared field.

The struct rasqal_triple gained an origin field; not used at present but intended to support work on tracking triple provenance such as provided by Redland Contexts.

Added methods rasqal_triple_set_origin and rasqal_triple_get_origin to support the above.

struct rasqal_triple_meta now takes a 4-array of bindings, the fourth being the origin.

Exported function rasqal_set_triples_source_factory publically as originally intended.

Rasqal 0.9.2 Changes

This release made minor portability fixes for building with C++ and Win32 (untested).

Several functions changed their parameters or return values from char* to unsigned char* or const unsigned char* to reflect the actual use.

Changed to return a const unsigned char*:
rasqal_literal_as_string

Changed to take const unsigned char* (or add const):
rasqal_new_floating_literal
rasqal_new_pattern_literal
rasqal_new_prefix
rasqal_new_simple_literal
rasqal_new_string_literal
rasqal_new_variable
rasqal_query_has_variable
rasqal_query_results_get_binding_name
rasqal_query_results_get_binding_value_by_name
rasqal_query_results_get_bindings
rasqal_query_set_variable

Rasqal 0.9.1 Changes

This release changed the way that results were returned. A new rasqal_query_results class was created. This allows for a clean separation of the two concepts allowing multiple form of the results to be retrieved as methods of the query_results class, rather than the query class. The only form of results currently available is variable bindings, but RDF graphs will be returned in future, as a set of triples in a serialised form.

The execution method rasqal_query_execute was changed to return a new object of that class rather than an int success or failure.

The following methods of the rasqal_query class were renamed and moved to the new rasqal_query_results class:

0.9.0 name 0.9.1+ name
rasqal_query_get_result_count rasqal_query_results_get_count
rasqal_query_next_result rasqal_query_results_next
rasqal_query_results_finished rasqal_query_results_finished
rasqal_query_get_result_bindings rasqal_query_results_get_bindings
rasqal_query_get_result_binding_value rasqal_query_results_get_binding_value
rasqal_query_get_result_binding_name rasqal_query_results_get_binding_name
rasqal_query_get_result_binding_by_name rasqal_query_results_get_binding_value_by_name
rasqal_query_get_bindings_count rasqal_query_results_get_bindings_count

A new rasqal_free_query_results destructor was created to delete the query results. (There is no public constructor).

Other minor bugs were fixed such as multiple constraints now being ANDed and not ORed, and adding defensive code for when queries fail and results methods are invoked.

Rasqal 0.9.0 Changes

It is all new.


Copyright 2004-2005 Dave Beckett, Institute for Learning and Research Technology, University of Bristol