Skip to content
Joachim Neubert edited this page Oct 27, 2022 · 23 revisions

Redland RDF Library - http://librdf.org

Table of Contents

Installation on Ubuntu 22.04

adapted from https://github.com/ropensci/rdflib/blob/master/inst/docker/Dockerfile

sudo apt-get update && sudo apt-get -yq install \
libxml2-dev \
libcurl4-openssl-dev \
libssl-dev \
git \
automake \
libtool \
gtk-doc-tools \
bison \
flex \
libgmp-dev  \
libmhash-dev \
libgcrypt20-dev \
libpcre3-dev \
libv8-dev \
libjq-dev \
libpq-dev \
libdb-dev \
libsqlite3-dev \
librdf \       # the docker recipe installs this as dependency of virtuoso
unixodbc-dev

Perl modules

`RDF::Helper 2.01` had errors in the make step. The syntax errors were solved by patching the module as below. An error related to RDF::Helper::RDFQuery was ignored, and the module installed anyway.

```

    index 3b2e17e..f09d0d9 100644
    --- a/lib/RDF/Helper/RDFRedland.pm
    +++ b/lib/RDF/Helper/RDFRedland.pm
    @@ -130,7 +130,7 @@ sub add_statement {
        my $statement = shift;
        my @nodes = ();
    -    foreach my $type qw( subject predicate object ) {
    +    foreach my $type ( qw( subject predicate object ) ) {
            push @nodes, $self->helper2native( $statement->$type );
        }
    @@ -145,7 +145,7 @@ sub remove_statements {
        my $e = $self->get_enumerator(@_);
        while ( my $s = $e->next ) {
            my @nodes = ();
    -        foreach my $type qw( subject predicate object ) {
    +        foreach my $type ( qw( subject predicate object ) ) {
                push @nodes, $self->helper2native( $s->$type );
            }
    @@ -325,7 +325,7 @@ sub next {
        my $s     = undef;
        my @nodes = ();
    -    foreach my $type qw( subject predicate object ) {
    +    foreach my $type ( qw( subject predicate object ) ) {
            push @nodes, process_node( $in->$type );
        }
        return RDF::Helper::Statement->new(@nodes);

````

Installation on CentOS 7.x

  sudo yum install libtool curl-devel mysql-devel sqlite-devel \
      mpfr-devel pcre-devel expat-devel
  sudo /usr/local/bin/cpanm XML::DOM

Installing src.rpms (as for Centos 6.x) does not work.

Therefore, download latest source tarballs from http://download.librdf.org/source/:

  -rw-r--r--   1 root     root     1.8M Nov  2  2014 raptor2-2.0.15.tar.gz
  -rw-r--r--   1 root     root     1.6M Dec 16  2014 rasqal-0.9.33.tar.gz
  -rw-r--r--   1 root     root     1.6M Dec 28  2013 redland-1.0.17.tar.gz
  -rw-r--r--   1 root     root     912K May 11  2014 redland-bindings-1.0.17.1.tar.gz

Installation sequence matters!

  cd raptor2-2.0.15
  ./configure && make && make test && make install
    ...
    make[5]: Leaving directory `/usr/local/src/redland/rasqal-0.9.33/utils'
    improve: Running testsuites sparql-query in /usr/local/src/redland/rasqal-0.9.33/tests/sparql/bugs
      Running testsuite sparql-query: Bug Tests via SPARQL
      FF...
        Failed tests:
          352
          353
        Passed: 3  Failed: 2  Skipped: 0  Xfailed: 0  Uxpassed: 0
      Testsuites summary:
        Failed tests:
          352
          353
        Passed: 3  Failed: 2  Skipped: 0  Xfailed: 0  Uxpassed: 0
    make[4]: *** [check-local] Error 1
    make[4]: Leaving directory `/usr/local/src/redland/rasqal-0.9.33/tests/sparql/bugs'
    make[3]: *** [check-am] Error 2
    make[3]: Leaving directory `/usr/local/src/redland/rasqal-0.9.33/tests/sparql/bugs'
    make[2]: *** [check-recursive] Error 1
    make[2]: Leaving directory `/usr/local/src/redland/rasqal-0.9.33/tests/sparql'
    make[1]: *** [check-recursive] Error 1
    make[1]: Leaving directory `/usr/local/src/redland/rasqal-0.9.33/tests'
    make: *** [check-recursive] Error 1

Nevertheless

  make install

Installs to /usr/local/lib - so we need

  export LD_LIBRARY_PATH=/usr/local/lib

respectively adding the variable to /etc/environment

  cd ../redland-1.0.1
  env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure
  make
  make check
  make install
  cd ../redland-bindings-1.0.17.1
  make
  make check
  cd perl
  make
  make check
  make install
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Installing /usr/local/lib64/perl5/auto/RDF/Redland/CORE/CORE.so
    Installing /usr/local/lib64/perl5/auto/RDF/Redland/CORE/CORE.bs
    Installing /usr/local/lib64/perl5/RDF/Redland.pm
    ...
  perl ./example.pl

Installation on CentOS 6.x

Package in default base repository: 1.0.7

Build RPMS

Download *.src.rpm from http://download.librdf.org/source/:

  -rw-r--r--. 1 root root 1.5M Jul 19  2009 raptor-1.4.19-1.src.rpm
  -rw-r--r--. 1 root root 1.1M Jul  6  2008 rasqal-0.9.16-1.src.rpm
  -rw-r--r--. 1 root root 3.7M Jul  6  2008 redland-1.0.8-1.src.rpm
  -rw-r--r--. 1 root root 739K Jul  6  2008 redland-bindings-1.0.8.1-1.src.rpm

(The raptor2-2.0.0-0.fc14.src.rpm and rasqal-0.9.22-0.fc14.src.rpm from 2011 seem incompatible with redland-1.0.8.)

Install dependencies:

  yum install rpm-build curl-devel mysql-devel libtool sqlite-devel gtk-doc mpfr-devel pcre-devel perl-XML-DOM

The sequence of the following steps matters, as

  rpmbuild --rebuild raptor-1.4.19-1.src.rpm
  cd /root/rpmbuild/RPMS/x86_64/
  yum localinstall raptor-1.4.19-1.x86_64.rpm raptor-devel-1.4.19-1.x86_64.rpm
  cd -
  rpmbuild --rebuild rasqal-0.9.16-1.src.rpm
  cd /root/rpmbuild/RPMS/x86_64/
  yum localinstall rasqal-0.9.16-1.x86_64.rpm rasqal-devel-0.9.16-1.x86_64.rpm
  cd -
  rpmbuild --rebuild redland-1.0.8-1.src.rpm

crashes with

  ...
  checking for sqlite library versions available... 3.6.20
  checking using sqlite library... yes - version 3.6.20
  checking sqlite3.h usability... no
  checking sqlite3.h presence... yes
  configure: WARNING: sqlite3.h: present but cannot be compiled
  configure: WARNING: sqlite3.h:     check for missing prerequisite headers?
  configure: WARNING: sqlite3.h: see the Autoconf documentation
  configure: WARNING: sqlite3.h:     section "Present But Cannot Be Compiled"
  configure: WARNING: sqlite3.h: proceeding with the preprocessor's result
  configure: WARNING: sqlite3.h: in the future, the compiler will take precedence
  configure: WARNING:     ## -------------------------------------- ##
  configure: WARNING:     ## Report this to http://bugs.librdf.org/ ##
  configure: WARNING:     ## -------------------------------------- ##
  checking for sqlite3.h... yes
  checking sqlite.h usability... no
  checking sqlite.h presence... no
  checking for sqlite.h... no
  ...
  gcc -DHAVE_CONFIG_H -I. -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX -I/usr/include -I/usr/include/rasqal -DPKGDATADIR=\"/root/rpmbuild/BUILDROOT/redland-1.0.8-1.x86_64/usr/share/redland\" -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX -I/usr/include -I/usr/include/rasqal -DLIBRDF_INTERNAL=1 -O2 -g -MT rdf_storage_sqlite.lo -MD -MP -MF .deps/rdf_storage_sqlite.Tpo -c rdf_storage_sqlite.c  -fPIC -DPIC -o .libs/rdf_storage_sqlite.o
  In file included from rdf_storage_sqlite.c:49:
  /usr/include/sqlite3.h:155: error: expected identifier or ‘(’ before numeric constant
  /usr/include/sqlite3.h:156: error: expected identifier or ‘(’ before numeric constant
  ...
  make[2]: *** [rdf_storage_sqlite.lo] Error 1
  make[2]: Leaving directory `/root/rpmbuild/BUILD/redland-1.0.8/librdf'

aborted for now, preliminary results on nbt3