<title>Rasqal RDF Query Library</title>
Rasqal is a free software / Open Source C library that handles Resource Description Framework (RDF) query language syntaxes, query construction and execution of queries returning results as bindings, boolean, RDF graphs/triples or syntaxes. The supported query languages are SPARQL Query 1.0, SPARQL Query 1.1, SPARQL Update 1.1 (no executing) and the Experimental SPARQL extensions (LAQRS). Rasqal can write binding query results in the SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables, RDF/XML and Turtle / N3 and read them in SPARQL XML, CSV, TSV, RDF/XML and Turtle / N3.
This is a beta quality library - the code is mature, the API is mostly stable but changing slowly. Rasqal supports all of SPARQL 1.0 query and most of SPARQL 1.1 query. It is a portable library and has been tested on multiple POSIX systems and architectures. Rasqal has no known memory leaks.
Known bugs and issues are recorded in the Redland issue tracker.
Rasqal does not provide an RDF API or triple store, but relies on external libraries implementing the triple store API providing matched RDF data originally from a specified content URI. Rasqal ships with a triple store implementation using the output of an RDF parser from Raptor. This can be called using the standalone command line roqet query utility giving a query language identifier (default sparql), the query string and optionally the data to use unless it is declared in the query string.
Rasqal is used inside Redland to provide support for query languages, a query API and a result bindings API over graphs stored in indexed Redland triple stores. Since this can index the triples it will be faster than the default rasqal triple store of reading the triples from Raptor into memory when the queries are complex.
Rasqal provides complete support for the W3C SPARQL Query Language 1.0 developed by the W3C RDF Data Access Working Group, as defined in SPARQL Query Language for RDF (1.0), W3C Recommendation 15 January 2008.
Rasqal implements most of the
SPARQL 1.1 Query Language
SPARQL 1.1 Update
W3C Recommendations 21 March 2013 including aggregates,
subqueries, expression in SELECT, assignment, short form for
CONSTRUCT and all the new set of builtin functions and
Unimplemented parts of SPARQL 1.1:
VALUES: part of federated query
SERVICE: Part of federated query
Out of scope parts of SPARQL 1.1:
The details on the Rasqal support for SPARQL 1.1 can be found at the rasqal testing SPARQL 1.1 page which shows the SPARQL 1.1 tests that fail and any diagnosis.
an experimental set of syntax extensions for SPARQL. The
syntax and features may change at any time. At present Rasqal
provides parsing and API support for alternate update syntaxes,
EXPLAIN keyword, plus executing a few experimental
The public API is described in the API reference. It is demonstrated in the roqet utility program which shows how to call the query engine and operate over the query results. When Rasqal is used inside Redland, the Redland documentation explains how to call the query engine and contains several example programs.
To build and install Rasqal from sources see the Installation document.
Rasqal requires Raptor 2.0.7 or newer to build and run, which can be downloaded from the same area as the Rasqal source and binaries.
This library is free software / open source software released under the LGPL (GPL) or Apache 2.0 licenses. See LICENSE.html for full details.
The Redland mailing lists discusses the development and use of Rasqal and Redland as well as future plans and announcement of releases.