<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Redland RDF Application Framework - Installation Instructions</title> </head> <body bgcolor="#ffffff" text="#000085"> <h1 align="center">Redland RDF Application Framework - Installation Instructions</h1> <h2>1. Getting the sources</h2> <p>There are several ways to get the sources. The most stable and tested versions are the sources shipped with each release and these are recommended as the first place to start. If you want to get a newer set, then there are nightly snapshots made of the development sources, which may not yet be committed to the CVS. For the latest developent sources, anonymous CVS access is available but this may require some configuring of developer tools that are not needed for the snapshot releases.</p> <p>The source bundle and package files contain all the HTML files and documentation provided on the web site.</p> <h3>1.1. Getting released sources</h3> <p>Every release comes with full sources and these are available from <a href="http://www.redland.opensource.ac.uk/dist/source/">http://www.redland.opensource.ac.uk/dist/source/</a> master site as well as the <a href="http://sourceforge.net/projects/librdf/">SourceForge site</a>. </p> <h3>1.2. Getting nightly source snapshots</h3> <p>Each night a snapshot distribution is attempted using the current development sources (that may not even be in the CVS), using the <code>make dist</code> target of the automake system. If this target completes, these snapshots are then made available from: <a href="http://www.redland.opensource.ac.uk/dist/snapshots/source/">http://www.redland.opensource.ac.uk/dist/snapshots/source/</a> (binary snapshot releases are also attempted each night from the same sources). </p> <h3>1.3. Getting the sources from CVS</h3> <pre> # sh, bash, ... CVSROOT=:pserver:anonymous@cvs.ilrt.org:/cvsroot export CVSROOT # csh, tcsh, ... setenv CVSROOT :pserver:anonymous@cvs.ilrt.org:/cvsroot cvs login Logging in to :pserver:anonymous@cvs.ilrt.org:2401/cvsroot CVS password: [return] cvs checkout redland cd redland </pre> <p>At this stage, or after a <code>cvs update</code> you will need to create the automake and autoconf derived files, as described below in <a href="#sec-create-configure">Create the configure program</a> by using the <code>autogen.sh</code> script.</p> <p>Building Redland in this way requires some particular development tools not needed when building from snapshot releases - automake, autoconf and swig. The <code>autogen.sh</code> script checks for the appropriate versions.</p> <p>(Aside: the current automake/conf system is using the "old" format configure.in with automake 1.4, autoconf 2.1x. These will be switched to the "new" format configure.ac with automake 1.6+, autoconf 2.5+ from the next release.)</p> <h2>2. Configuring and building</h2> <p>Redland uses the GNU automake and autoconf to handle system dependency checking. It is developed and built on x86 Linux (Redhat), but is also used extensively locally on various versions of sparc Sun Solaris 2.x. I also test it via <a href="http://sourceforge.net/">SourceForge</a>s' compile farm and it builds on Debian Linux (x86, Alpha, PPC and Sparc), FreeBSD (x86) and Apple OSX.</p> <h3><a id="sec-create-configure" name="sec-create-configure"></a>2.1. Create <code>configure</code> program</h3> <p>If there is no <code>configure</code> program, you can create it by running the <code>autogen.sh</code> script, as long as you have the <a href="http://www.gnu.org/software/automake/automake.html">automake</a> and <a href="http://www.gnu.org/software/autoconf/autoconf.html">autoconf</a> tools. This is done by:</p> <pre> ./autogen.sh </pre> <p>and you can also pass along arguments intended for configure (see below for what these are):</p> <pre> ./autogen.sh --prefix=/usr/local/somewhere </pre> <p>Alternatively you can run the automake and autoconf programs by hand with:</p> <pre> aclocal; autoheader; automake --add-missing; autoconf </pre> <p>(Ignore any warnings from autoconf about AC_TRY_RUN, it is caused by an autoconf macro and seems to be an autoconf bug.)</p> <h3>2.2. Options for <code>configure</code></h3> <p>See also the generic GNU installation instructions in <a href="INSTALL">INSTALL</a> for information about general options such as <code>--prefix</code> etc.</p> <dl> <dt><code>--with-bdb=ROOT</code><br /></dt> <dd><p>Enable use of the Berkeley / Sleepycat DB library installed at <em>ROOT</em>. That means <em>ROOT</em><code>/include</code> must contain the BDB header <code>db.h</code> and <em>ROOT</em><code>/lib</code> must contain the library <code>libdb.a</code> (or whatever shared library version you have).</p> <p>Berkeley DB is now known as Sleepycat DB (after version 2) and distributed and supported by <a href="http://www.sleepycat.com/">SleepyCat Software</a>. Versions 4.1.24, 4.0.14, 3.3.11, 3.2.9, 3.1.17, 3.1.14, 2.7.7 and 2.4.14 have been tested and work. Some systems do not come installed with a working Berkeley/Sleepycat DB so on those systems, Redland will have no persistent storage unless BDB is built separately and enabled via this option.</p> <p><b>Note</b>: If you change installed versions of BDB (from 3.x to 4.x) then you will need to re-configure Redland carefully to let it discover the features of the newer BDB as follows:</p> <pre> rm -f config.cache make clean ./configure ... # any configure arguments here </pre> <p>(plus you might need to use the <code>db</code><em>X</em><code>_upgrade</code> utility to update the BDB database files to the formats supported by the newer version <em>X</em> - see the BDB documentation to find out if this is required.)</p> <p>If the BerkeleyDB is installed in different places from <em>ROOT</em><code>/lib</code> (library) and <em>ROOT</em><code>/include</code> (header) or the library name is something that can't be worked out automatically, then you can use the following options to specify them.</p> </dd> <dt><code>--with-bdb-lib=</code><em>LIBDIR</em><br /></dt> <dt><code>--with-bdb-include=</code><em>INCDIR</em><br /></dt> <dt><code>--with-bdb-name=</code><em>NAME</em><br /></dt> <dd><p>Use Berkeley DB with the installed library in <em>LIBDIR</em> and the <code>db.h</code> header in <em>INCDIR</em> and the installed library called <em>NAME</em> like <code>-l</code><em>NAME</em>. This is relative to <em>LIBDIR</em>. All of these options can be omitted and <code>configure</code> will try to find or guess the values from the system.</p> <p>For example, to compile redland on OSX with <a href="http://fink.sourceforge.net/">fink</a> required a configure line something like this:</p> <pre> ./configure --with-bdb-lib=/sw/lib --with-bdb-include=/sw/include/db3 </pre> <p>The name of the BDB library was correctly discovered for this configuration, as <code>db-3.3</code></p> </dd> <dt><code>--with-libwww</code><br /></dt> <dd><p>Enable use of the W3C <a href="http://www.w3.org/Library/">libwww</a>, if available. configure will automatically enable this if the <code>libwww-config</code> program can be found in the path unless disabled by setting this option to <em>no</em>. libwww is not used at present. </p> </dd> <dt><code>--enable-parsers=LIST</code><br /></dt> <dd><p>Select the list of RDF parsers to be included if the are availble. The valid list of RDF parsers are: <code>raptor repat</code> (the default). Even when selected these depend on the available XML parsers. Raptor uses either of libxml2 (prefered) or expat and repat requires expat. Redland requires the Raptor parser for other functionality, so this cannot be disabled. If no system-wide libxml2 or expat is available, Redland will compile an internal copy of expat and use that. </p></dd> <dt><code>--enable-digests=LIST</code><br /></dt> <dd><p>Select the list of digests to be included if the are availble. The valid list of digests are: <code>md5 sha1 ripem160</code> (the default). The digest functions can be provided by external libraries such as the <a href="http://www.openssl.org/">OpenSSL</a> libcrypto library or by provided portable versions (only MD5 supported in this release).</p></dd> <dt><code>--with-openssl-digests</code><br /></dt> <dd><p>Enable digests provided by the <a href="http://www.openssl.org/">OpenSSL</a> libcrypto library (MD5, SHA1 and RIPEMD160) if the library is available. configure will automatically enable this unless disabled by setting this option to <em>no</em>.</p></dd> <dt><code>--with-xml-parser=NAME</code><br /></dt> <dd><p>Pick an XML parser to use for Raptor - either <code>libxml</code> (default) or <code>expat</code>. If this option is not given, either will be used, with libxml preferred if both are present. libxml must be present as a system library but expat is always available since it is provided inside Redland.</p> <p>If the <code>repat</code> RDF parser is also required (by default, yes) then since it always requires <code>expat</code>, then even if expat is not selected for this option, it will be compiled in. To prevent this, remove repat from the list of RDF parsers using <code>--enable-parsers=raptor</code>.</p> <p>Raptor has been tested with various combinations of these libraries that are described further in the Raptor <a href="http://www.redland.opensource.ac.uk/raptor/INSTALL.html">install</a> documentation. </p> </dd> </dl> <p><b>WARNING</b> If the libwww or Sleepycat/Berkeley DB libraries are installed in a non-default directory, when the final linking occurs, the libraries may not be found at run time. To fix this you will need to use a system-specific method of passing this information to the run-time loader. On Linux and Solaris you can set the LD_LIBRARY_PATH environment variable to include the directory where the libwww libraries are found. You can also configure it via a system wide file - see the <code>ld</code>, <code>ld.so</code> or<code>ld.so.1</code> manual pages for details. The alternative, to link libwww statically, works but is difficult to enable.</p> <h3>2.3 Configuring</h3> <p>If everything is in the default place, do:</p> <pre> ./configure </pre> <p>More commonly you will be doing something like this, when compiling with the Stanford version of the SiRPAC Java parser:</p> <pre> ./configure --with-sirpac-stanford-jar=rdf-api-2000-10-30.jar </pre> <p>If you are having problems with configuring several times when adding or removing options, you may have to tidy up first with either of these:</p> <pre> make clean rm -f config.cache </pre> <h3>2.4 Compiling</h3> <pre> make </pre> <h2>2.5. Testing</h2> <p>You can build and run the built-in tests with:</p> <pre> make check </pre> <p>which should emit lots of exciting test messages to the screen but conclude with something like:<br /> <code>All </code><em>n</em><code> tests passed</code><br /> if everything works correctly.</p> <p>(If you have got all the required subsidiary development tools, you can also do <code>make distcheck</code> which does a longer check that the distribution installation, configuring and building works. This does not perform any additional core testing).</p> <h3>2.6 Installing the library</h3> <p>Although this works, the user interface/internal interface header file split hasn't been completed yet, so I currently recommend compiling against the source tree. However, if you choose to install, do:</p> <pre> make install </pre> <h2>3. Using the library</h2> <p>Once the library has been configured and built, there are several C example programs that can be used. They are in the <code>examples</code> sub-directory and can be built with:</p> <pre> cd examples make </pre> <p>(This may be done by the initial 'make' automatically).</p> <p>Examples for the other language interfaces are in the corresponding sub-directories such as <code>perl/example.pl</code>.</p> <p>If no Berkeley DB was found by configure, some of the examples will fail since there is no on-disk storage system available. To change them to use the in-memory hashes, edit the lines reading something like</p> <pre> storage=librdf_new_storage("hashes", "test", "hash_type='bdb',dir='.'"); </pre> <p>to read</p> <pre> storage=librdf_new_storage("hashes", "test", "hash_type='memory',dir='.'"); </pre> <p>Note: there is very poor error reporting support at present from the RDF parsers. Generally if the results are just an empty model when something was expected, an error ocurred. If the URI works (check it in a browser) then probably it was a parsing problem.</p> <p>You can check that you have a functioning Java/SiRPAC installation by running the Java parser directly against some RDF URL, eg.:</p> <pre> java -classpath .../rdf-api-2000-10-30.jar org.w3c.rdf.examples.ListStatements http://purl.org/dc/index.htm.rdf </pre> <h3>3.1. <a href="example1.c">example1.c</a></h3> <p><code>example1</code> uses a RDF parser, if you have one available, to parse a URI of RDF/XML content, store it in multple Berkeley DB hashes on the disk and run queries against them. It takes two arguments, the first the URI of the RDF/XML content (or <code>file:</code><em>filename</em>) and the second, optional one, is the name of the RDF parser to use. At present these can be <code>sirpac</code> or <code>libwww</code></p> <h3>3.2. <a href="example2.c">example2.c</a></h3> <p><code>example2</code> does not use a RDF parser, but reads from a simple triple dump format and again stores the data on disk in multiple Berkeley DB hashes.</p> <h3>3.3. <a href="example3.c">example3.c</a></h3> <p><code>example3</code> contains a 10 line main program that creates an RDF model, a statement, adds it to the model and stores it on disk.</p> <h3>3.4. <a href="example4.c">example4.c</a></h3> <p><code>example4</code> is a utility that allows the parsing, printing and querying of an existing on disk Berkeley DB-stored RDF model by statement; source, arc or target node and allows the addition and removal of statements. To see a usage message type:</p> <pre> example4 </pre> <p>For example, to parse some RDF/XML using the repat parser into a BerkeleyDB store, print it, do some queries, you could do the following (some lines broken for clarity)</p> <pre> $ cd examples $ example4 test parse file:../perl/dc.rdf repat example4: Parsing URI file:../perl/dc.rdf with repat parser $ example4 test print [[ {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/title], "Dave Beckett's Home Page"} {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Beckett"} {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/description], "The generic home page\ of Dave Beckett."} ]] $ example4 test targets http://purl.org/net/dajobe/ http://purl.org/dc/elements/1.1/title Matched node: Dave Beckett's Home Page example4: matching nodes: 1 $ example4 test statements http://purl.org/net/dajobe/ - - Matched statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/title], "Dave Becke\ tt's Home Page"} Matched statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/creator], "Dave Bec\ kett"} Matched statement: {[http://purl.org/net/dajobe/], [http://purl.org/dc/elements/1.1/description], "The \ generic home page of Dave Beckett."} example4: matching statements: 3 </pre> <h2>3. Using the Perl interface</h2> <p>See the <a href="docs/perl.html">Redland Perl Interface</a> document for full information on installing and using Redland from Perl.</p> <h2>4. Using the Python interface</h2> <p>See the <a href="docs/python.html">Redland Python Interface</a> document for full information on installing and using Redland from Python.</p> <h2>5. Using the Tcl interface</h2> <p>See the <a href="docs/tcl.html">Redland Tcl Interface</a> document for full information on installing and using Redland from Tcl, and/or Tcl/Tk.</p> <h2>6. Using the Java interface</h2> <p>See the <a href="docs/java.html">Redland Java Interface</a> document for full information on installing and using Redland from Java.</p> <h2>7. Using the Ruby interface</h2> <p>See the <a href="docs/ruby.html">Redland Ruby Interface</a> document for full information on installing and using Redland from Ruby.</p> <h2>8. Using the PHP interface</h2> <p>See the <a href="docs/php.html">Redland PHP Interface</a> document for full information on installing and using Redland from PHP.</p> <hr /> <p>Copyright 2000-2001 <a href="http://purl.org/net/dajobe/">Dave Beckett</a>, <a href="http://www.ilrt.bristol.ac.uk/">Institute for Learning and Research Technology</a>, <a href="http://www.bristol.ac.uk/">University of Bristol</a></p> </body> </html>