summaryrefslogtreecommitdiff
path: root/INSTALL.html
blob: 2d585392f5f4444fb06130cb77530d9217e94e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Raptor RDF Parser Toolkit - Installation</title>
</head>
<body>

<h1 style="text-align:center">Raptor RDF Parser Toolkit - Installation</h1>
<h2 style="text-align:center"><a href="http://purl.org/net/dajobe/">Dave Beckett</a><br /><a href="http://www.ilrt.bristol.ac.uk/">Institute for Learning and Research Technology</a><br /><a href="http://www.bristol.ac.uk/">University of Bristol</a></h2>
  

<h2>1. Getting the sources</h2>

<h2>1.1 Getting the sources from releases</h2>

<p>The sources are available from
<a href="http://www.redland.opensource.ac.uk/dist/source/">http://www.redland.opensource.ac.uk/dist/source/</a> (master site) and also from the
<a href="http://sourceforge.net/projects/librdf/">SourceForge site</a>.</p>


<h2>1.2 Getting the sources from CVS</h2>

<p>Note that using this rather than the bundles may require having
some extra development tools.  Presently this includes the gperf
tool.</p>

<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/raptor

  cd redland/raptor
</pre>

<p>At this stage, or after a <tt>cvs update</tt> 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 Raptor in this way requires some particular development
tools not needed when building from snapshot releases - automake and
autoconf.  The <code>autogen.sh</code> script looks for the newest
versions of the auto* tools and checks that they meet the minimum
versions.</p>


<h2>2. Configuring and building</h2>

<p>Raptor uses the GNU automake and autoconf to handle system
dependency checking.  It requires an XML parser - either libxml2
(2.4.0 or newer, 2.6.0 or later highly recommended) or expat.  It will
optionally use libcurl, libxml2 for retrieving URIs.  If GNOME glib
2.0 is present, it will be used for Unicode Normal Form C (NFC)
checking unless <tt>--disable-nfc-check</tt> is used.  If glib
is missing, some of the RDF/XML tests will note the failure
but continue.</p>

<p>Raptor is developed and built on x86 GNU/Linux
(Redhat Fedora Core 2, Debian unstable) but is also regularly tested on
sparc Sun Solaris 2.x, x86 FreeBSD 4.8, ppc Apple OSX 10.2 
and as part of Redland on several other systems via the 
<a href="http://sourceforge.net/">SourceForge</a> compile farm
(typically AMD IA64 SuSE 8 Linux 2.4, Alpha Debian Linux 2.2).</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 <tt>configure</tt> program, you can create it 
using the <tt>autogen.sh</tt> 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 them by hand with:</p>
<pre>
  aclocal; autoheader; automake --add-missing; autoconf
</pre>

<p>The automake and autoconf tools have many different versions and
at present development is being done with automake 1.8.3 (minimum
version 1.7), autoconf 2.59 (minimum version 2.54) and libtool 1.5.4
(minimum version 1.4).  These are only needed when compiling from CVS
sources.  autogen.sh enforces the requirements.  In future
development will move to require automake 1.8, autoconf 2.58 and
libtool 1.5.</p>


<h3>2.2 Options for <tt>configure</tt></h3>

<p>Raptor also supports the following extra configure options:</p>

<dl>
<dt><tt>--disable-nfc-check</tt><br /></dt>
<dd><p>Disable Unicode Normal Form C (NFC) checking code.  This
is usually enabled and at present, requires the GNOME glib library
to provide this check for the RDF/XML parser.  The check may result
in a run time warning when non-normalised Unicode literals are
seen in the RDF/XML.  If the GNOME glib library is not available,
a configure time warning may be given printed unless this option
is used.</p></dd>

<dt><tt>--with-expat-source=DIR</tt><br /></dt>
<dd><p>Build against a statically compiled expat source tree in
directory <em>DIR</em>.  This handles the older and newer style 
expat source directory structures.
</p></dd>

<dt><tt>--with-xml-parser=NAME</tt><br /></dt>
<dd><p>Pick an XML parser to use - either <tt>libxml</tt> (default)
minimum version 2.4.0 or <tt>expat</tt>.  If this option is not given,
either will be used, with libxml preferred if both are present.
These can either be installed system libraries or source
trees in subdirectories of these sources named libxml, expat.</p>
<p>Raptor has been tested with various combinations of these libraries
including 
expat 1.95.1 (on RedHat 7.2),
expat 1.95.2-2 (on RedHat 7.3),
expat 1.95.2-6 (on Debian 3.0),
expat 1.95.7 (on Redhat Fedora Core 2),
libxml 2.4.10 (on RedHat 7.2),
libxml 2.4.13 (on OSX 10.1.5),
libxml 2.4.17 (on FreeBSD 4.5-RELEASE-p2),
libxml 2.4.19 (on RedHat 7.2),
libxml 2.4.23 (on Debian 3.0),
libxml 2.4.24 (on FreeBSD 4.7-STABLE),
libxml 2.4.25, 2.4.28, 2.4.30 (Debian unstable),
libxml 2.5.3-2.5.4 (Redhat 9, Debian unstable),
libxml 2.5.7 (Redhat 9, Debian unstable),
libxml 2.5.8-2.5.9 (Debian unstable),
libxml 2.6.0-2.6.10 (Debian unstable),
libxml 2.6.8 (Redhat Fedora Core 2),
libxml 2.6.9 (FreeBSD 4.10-STABLE)
</p>
<p>libxml1 is not supported.</p>
</dd>

<dt><tt>--with-www=NAME</tt><br /></dt>
<dd><p>Pick a WWW library to use - either <tt>curl</tt>, 
<tt>xml</tt> (for libxml), <tt>libwww</tt> for W3C libwww or
<tt>none</tt> to disable it.</p></dd>

<dt><tt>--with-xml2-config=NAME</tt><br /></dt>
<dd><p>Set the path to the libxml xml2-config program</p></dd>

<dt><tt>--with-curl-config=NAME</tt><br /></dt>
<dd><p>Set the path to the <a href="http://curl.haxx.se/libcurl/">libcurl</a> curl-config program</p></dd>

<dt><tt>--with-pkg-config=NAME</tt><br /></dt>
<dd><p>Set the path to the GNOME pkg-config program</p></dd>

<dt><tt>--with-libwww-config=NAME</tt><br /></dt>
<dd><p>Set the path to the W3C <a href="http://www.w3.org/Library/">WWW library</a> libwww-config program</p></dd>

</dl>

<h3>2.3 Configuring</h3>

<p>If everything is in the default place, do:</p>
<pre>
   ./configure
</pre>

<p>The most common configuration you will be doing something like this:</p>
<pre>
   ./configure --with-xml-parser=expat
</pre>


<h3>2.4 Compiling</h3>

<p>Compile the parser and the test program <tt>rapper</tt> with;</p>
<pre>
   make
</pre>
<p>Note: GNU make is probably required which may be called
gmake or gnumake if your system has a different make available too.</p>


<h3>2.5 Testing</h3>

<p>Raptor has a built-in test suite that can be invoked with:</p>
<pre>
  make check
</pre>

<p>which should emit lots of exciting test messages to the screen but
conclude with something like:<br />
  <tt>All </tt><em>n</em><tt> tests passed</tt><br />
if everything works correctly. There might be some Unicode NFC
tests that fail if either GNOME glib2.0 was not available when raptor was
compiled or NFC support was disabled with the
the <tt>--disable-nfc-check</tt> option to configure</p>

<p>Raptor builds a utility RDF parsing program <em>rapper</em> can
be tried with RDF/XML content like this:</p>

<pre>
  rapper dc.rdf
</pre>

<p>Raptor can also extract RDF content inside general XML when the
<tt>-s</tt> (<tt>--scan</tt>) option is user.  For example if some
RDF/XML is embedded inside some SVG, it could be extracted with:</p>

<pre>
  rapper -s /path/to/test/pic.svg
</pre>

<p>You can also run it on <a href="http://www.w3.org/TR/rdf-testcases/#ntriples">N-Triples</a> files like this:</p>

<pre>
  rapper -i ntriples test.nt
</pre>

<p>The default output is a simple statement dump format, but it can
be changed to emit <a href="http://www.w3.org/TR/rdf-testcases/#ntriples">N-Triples</a> by using the <code>-o</code> option, like this:</p>

<pre>
  rapper -o ntriples dc.rdf
</pre>



<h2>3. Using the library</h2>

<p>Once the library has been configured and built, there are 
some C example programs that can be built apart from the rapper utility.
They are in the <code>examples</code> sub-directory and can be built with:</p>
<pre>
   cd examples

   # Raptor GUI - only if you have the GTK libraries
   make grapper

   # Raptor parser abort test program
   make raptor_abort

   # If you have all requirements
   make examples
</pre>

<p>The public Raptor API is described in the
<a href="libraptor.html">libraptor.3</a> UNIX manual/web page
</p>


<hr />

<p>Copyright 2000-2004 <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>