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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
|
<?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 - Building and Installing from Source</title>
</head>
<body>
<h1>Raptor RDF Parser Toolkit - Building and Installing from Source</h1>
<h2>1. Getting the sources</h2>
<h2>1.1 Getting the sources from releases</h2>
<p>The sources are available from
<a href="http://librdf.org/dist/source/">http://librdf.org/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><strong>NOTE</strong>: Raptor will be switching to use
<a href="http://subversion.tigris.org/">Subversion</a>
for version control after the 1.4.8 release. Please check the
<a href="http://svn.librdf.org/">Redland Subversion site</a>
for the latest status or the online
<a href="http://librdf.org/raptor?INSTALL.html">Raptor installation notes</a>
for the raptor specific subversion installation information.
</p>
<pre>
# sh, bash, ...
CVSROOT=:pserver:anonymous@cvs.librdf.org:/cvsroot
export CVSROOT
# csh, tcsh, ...
setenv CVSROOT :pserver:anonymous@cvs.librdf.org:/cvsroot
cvs login
Logging in to :pserver:anonymous@cvs.librdf.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. It will
optionally use libxslt (requiring libxml2 also) to provide the XSLT
functionality for the GRDDL parser.</p>
<p>Raptor is developed and built on x86 GNU/Linux
(Redhat Fedora Core 3, Debian unstable) but is also regularly tested on
sparc Sun Solaris 2.x, x86 FreeBSD 4.10, ppc Apple OSX 10.3
and as part of Redland on several other systems via the
<a href="http://sourceforge.net/">SourceForge</a> compile farm
(typically AMD64, Alpha, Solaris x86, OpenBSD, NetBSD).</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>
<p>Raptor also requires
<a href="http://lex.sourceforge.net/">flex</a> version 2.5.31 or newer
(2.5.4 will not work) and
<a href="http://www.gnu.org/software/bison/bison.html">GNU Bison</a>
to build lexers and parsers.
These are only required when building from CVS.</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.
The code primarily consists of large tables plus some checking code
which can be removed from the library with this option. All NFC
checks will succeed when this is disabled.
</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>--enable-parsers=PARSERS</tt><br /></dt>
<dd><p>Pick the RDF parsers to build from the list:<br />
<code>rdfxml ntriples turtle rss-tag-soup</code><br />
The default when this option is omitted is to enable all parsers.
<code>rss-tag-soup</code> requires version 2.5.10 of libxml2
or newer so may not always be available. If all parsers are not
enabled, parts of the test suite will likely fail.</p>
<p>The parsers that a built library supports can be found from the
API level using functions such as
<code>raptor_parsers_enumerate</code> and
<code>raptor_syntaxes_enumerate</code> or from the
<code>rapper</code> utility in the help message.</p></dd>
<dt><tt>--enable-serializers=SERIALIZERS</tt><br /></dt>
<dd><p>Pick the RDF serializers to build from the list:<br />
<code>rdfxml ntriples rdfxml-abbrev</code><br />
The default when this option is omitted is to enable all serializers.
If all serializers are not enabled, parts of the test suite will
likely fail.</p>
<p>The serializers that a built library supports can be found from the
API level using functions such as
<code>raptor_serializers_enumerate</code> or from the
<code>rapper</code> utility in the help message.</p></dd>
<dt><tt>--with-memory-signing</tt><br /></dt>
<dd><p>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.</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 (2.6.0 or newer prefered)
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),
expat 1.95.8 (on Debian unstable),
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, x86 Solaris 2.9),
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>
<p>The libxml2 on Apple OSX 10.3.X is quite broken - the headers do
not match the libraries. Install your own to get something
coherent.</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-xslt-config=NAME</tt><br /></dt>
<dd><p>Set the path to the libxslt xslt-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-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 will be some Unicode NFC
checking tests that give ignored failures in 1.3.2 or later as NFC
checking has been temporarily removed.</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
# 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-2005 <a href="http://purl.org/net/dajobe/">Dave Beckett</a><br />Copyright 2000-2005 <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>
|