Perl RDF on CentOS 7 - jneubert/doc GitHub Wiki

Installation

  • Install C
sudo yum install gcc
sudo yum install automake
sudo yum install libtool
  • Install cpanminus
sudo yum install install perl-App-cpanminus
  • Install precompiled modules, where installation fails
    sudo yum install perl-XML-SAX
  • Install RDF modules (plus prerequisites)
sudo cpanm Test::MockModule
sudo cpanm DBI
sudo cpanm DBD::SQLite
sudo cpanm DBIx::Connector
sudo cpanm List::Util
sudo cpanm Text::CSV_XS
sudo cpanm MooseX::ArrayRef
sudo cpanm Algorithm::Combinatorics
sudo cpanm Data::UUID

sudo cpanm RDF::Trine
sudo cpanm RDF::Helper
sudo cpanm Test::RDF

Redland installation

Relativly up-to-date versions in yum. Yet, the Perl bindings seem to be not very well maintained (last change May 2014, as of March 2018). Do not work with RDF::RDFa::Parser any more!.

sudo yum install redland rasqal raptor2 swig

-devel packages for redland and rasqual are not available any more!

cd ~
git clone git://github.com/dajobe/librdf.git
cd librdf
./autogen.sh

missing: gtk-doc!

Perl bindings must be installed separately:

cd ~
git clone git://github.com/dajobe/redland-bindings.git
cd redland-bindings
aclocal; autoheader; automake --add-missing; autoconf
./configure
make
make check
sudo make install
cd perl
make
make check
sudo make install

Lot of messages during make

gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"1.0.17.2\" -DXS_VERSION=\"1.0.17.2\" -fPIC "-I/usr/lib64/perl5/CORE"  -DHAVE_CONFIG_H -I/usr/include/raptor2 -I/usr/include/rasqal -I/usr/include/libxml2   -I. -DREDLAND_PRE_I -DREDLAND_POST_I -DREDLAND_DECL_I  -g -O2  -I/usr/include/raptor2 -I/usr/include/rasqal -I/usr/include/libxml2    CORE_wrap.c
CORE_wrap.c: In function ‘_wrap_librdf_digest_update’:
CORE_wrap.c:2177:5: warning: pointer targets in passing argument 2 of ‘librdf_digest_update’ differ in signedness [-Wpointer-sign]
     librdf_digest_update(arg1,(char const *)arg2,arg3);
     ^
In file included from /usr/include/librdf.h:394:0,
                 from /usr/include/redland.h:30,
                 from CORE_wrap.c:1541:
/usr/include/rdf_digest.h:51:6: note: expected ‘const unsigned char *’ but argument is of type ‘const char *’
 void librdf_digest_update(librdf_digest* digest, const unsigned char *buf, size_t length);
      ^
CORE_wrap.c: In function ‘_wrap_librdf_digest_update_string’:
CORE_wrap.c:2217:5: warning: pointer targets in passing argument 2 of ‘librdf_digest_update_string’ differ in signedness [-Wpointer-sign]
     librdf_digest_update_string(arg1,(char const *)arg2);
     ^
In file included from /usr/include/librdf.h:394:0,
                 from /usr/include/redland.h:30,
                 from CORE_wrap.c:1541:
/usr/include/rdf_digest.h:53:6: note: expected ‘const unsigned char *’ but argument is of type ‘const char *’
 void librdf_digest_update_string(librdf_digest* digest, const unsigned char *string);
      ^
...

example.pl can be executed and works fine. In use it emits some warnings, but works too.

Name "_p_librdf_parser_s::OWNER" used only once: possible typo at /usr/local/lib64/perl5/RDF/Redland/Parser.pm line 87.
Use of qw(...) as parentheses is deprecated at /usr/local/share/perl5/RDF/Helper/RDFRedland.pm line 133.
...

Python rdflib installation

easy_install rdflib