Rasqal RDF Query Library - Building and Installing from Source

0. Prerequisites

Rasqal requires the Raptor RDF Syntax Library version 1.4.19 or later for parsing RDF, retrieving WWW content and other utility classes and libraries. It can also use Redland as an alternate triple store and enabled by --with-triples-source=redland as described below however Raptor is also required.

1. Getting the sources

1.1 Getting the sources from releases

The sources are available from http://download.librdf.org/source/ (master site) and also from the SourceForge site.

1.2 Getting the sources from GIT

Building from development sources rather than from a release may required some extra development tools. Presently this includes the flex scanner generator version 2.5.31 or later.

  git clone git://github.com/dajobe/rasqal.git
  cd rasqal

At this stage, or after a git pull you will need to create the automake and autoconf derived files, as described below in Create the configure program by using the autogen.sh script.

Building Rasqal in this way requires some particular development tools not needed when building from snapshot releases - automake and autoconf. The autogen.sh script looks for the newest versions of the auto* tools and checks that they meet the minimum versions.

2. Configuring and building

Requirements: the Raptor RDF Syntax Library version 1.4.19 or later (plus flex and bison as specified above, when building from GIT). Recommended: PCRE regex library or another implementing the POSIX regex API. If neither is present some of the tests will fail and the query engine will fail to handle regex matches.

Raptor uses the GNU automake and autoconf to handle system dependency checking. It is developed and built on x86 Linux and x86 OSX but is also tested on other systems occasionally.

2.1. Create configure program

If there is no configure program, you can create it using the autogen.sh script, as long as you have the automake and autoconf tools. This is done by:

  ./autogen.sh

and you can also pass along arguments intended for configure (see below for what these are):

  ./autogen.sh --prefix=/usr/local/somewhere

On OSX you may have to explicitly set the LIBTOOLIZE variable for the libtoolize utility since on OSX libtoolize is a different program:

  LIBTOOLIZE=glibtoolize ./autogen.sh

Alternatively you can run them by hand with:

  aclocal; autoheader; automake --add-missing; autoconf

The automake and autoconf tools have many different versions and at present development is being done with automake 1.11.1 (minimum version 1.11), autoconf 2.65 (minimum version 2.62) and libtool 2.2.10 (minimum version 2.2.0). These are only needed when compiling from GIT sources. autogen.sh enforces the requirements.

Rasqal also requires flex version 2.5.31 or newer (2.5.4 will not work) and GNU Bison to build lexers and parsers. These are only required when building from GIT.

2.2 Options for configure

Rasqal also supports the following extra configure options:

--enable-query-languages=LANGUAGES

Pick the RDF query languages to build from the list:
rdql sparql laqrs
The default when this option is omitted is to enable all query languages except the experimental one, laqrs.

--enable-raptor2

Build raptor against the beta Raptor V2 APIs (libraptor2) rather than the default V1 APIs (libraptor). This is a developer option for testing against the raptor 2 beta APIs. In some future version, this will be the default and rasqal will depend on raptor2. When rasqal is built in this way and librdf is built against it, librdf also has to be built with a configure --enable-raptor option.

--with-memory-signing

Enable signing of memory allocations so that when memory is allocated with malloc() and released free(), a check is made that the memory was allocated in the same library.

--with-regex-library=NAME

Pick a regex library to use - either pcre (default) for the PCRE or posix a POSIX regex implementation in the C library

--with-triples-source=NAME

Pick a triples source library to use - either raptor (default, and always available) or redland to use Redland. Raptor creates a simple in-store list of triples on parsing each time whereas Redland makes a much more efficient indexed in-memory store. See also --with-redland-config.

--with-pcre-config=NAME

Set the path to the PCRE pcre-config program

--with-raptor= system or internal

This option tells Rasqal to use either the system installed version of Raptor or a version in the sibling directory of ../raptor If the option is omittted, Rasqal will guess and choose either the system one, if new enough or the internal one if present. If --with-raptor=system is used and Rasqal discovers that the system Raptor is too old, a warning will be given but the configuration will continue.

--with-redland-config=NAME

Set the path to the Redland redland-config program

2.3 Configuring

If everything is in the default place, do:

   ./configure

The most common configuration you will be doing something like this:

   ./configure --prefix=/usr

2.4 Compiling

Compile the library with;

   make

Note: GNU make is probably required which may be called gmake or gnumake if your system has a different make available too.

2.5 Testing

You can build and run the built-in test suite with:

  make check

which should emit lots of exciting test messages to the screen but conclude with something like:
All n tests passed
if everything works correctly. There might be some regex tests that fail if no POSIX regex library was available when Rasqal was compiled.

3. Using the library

The public Rasqal API is described in the librasqal.3 UNIX manual/web page


Copyright (C) 2003-2010 Dave Beckett
Copyright (C) 2003-2005 University of Bristol