gnu: Use 'modify-phases' syntax.
[jackhill/guix/guix.git] / gnu / packages / rdf.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages rdf)
21 #:use-module ((guix licenses)
22 #:select (non-copyleft isc gpl2 lgpl2.1 lgpl2.1+))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system cmake)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
28 #:use-module (guix build-system waf)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages curl)
35 #:use-module (gnu packages cyrus-sasl)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages multiprecision)
40 #:use-module (gnu packages pcre)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages qt)
45 #:use-module (gnu packages tls)
46 #:use-module (gnu packages xml))
47
48 (define-public raptor2
49 (package
50 (name "raptor2")
51 (version "2.0.15")
52 (source (origin
53 (method url-fetch)
54 (uri (string-append "http://download.librdf.org/source/" name
55 "-" version ".tar.gz"))
56 (patches
57 (search-patches "raptor2-heap-overflow.patch"))
58 (sha256
59 (base32
60 "1vc02im4mpc28zxzgli68k6j0dakh0k3s389bm436yvqajxg19xd"))))
61 (build-system gnu-build-system)
62 (inputs
63 `(("curl" ,curl)
64 ("libxml2" ,libxml2)
65 ("libxslt" ,libxslt)
66 ("zlib" ,zlib)))
67 (arguments
68 `(#:parallel-tests? #f))
69 (home-page "http://librdf.org/raptor/")
70 (synopsis "RDF syntax library")
71 (description "Raptor is a C library providing a set of parsers and
72 serialisers that generate Resource Description Framework (RDF) triples
73 by parsing syntaxes or serialise the triples into a syntax. The supported
74 parsing syntaxes are RDF/XML, N-Quads, N-Triples 1.0 and 1.1, TRiG,
75 Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup including all versions
76 of RSS, Atom 1.0 and 0.3, GRDDL and microformats for HTML, XHTML and
77 XML. The serialising syntaxes are RDF/XML (regular, abbreviated, XMP),
78 Turtle 2013, N-Quads, N-Triples 1.1, Atom 1.0, RSS 1.0, GraphViz DOT,
79 HTML and JSON.")
80 (license lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
81
82 (define-public clucene
83 (package
84 (name "clucene")
85 (version "2.3.3.4")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "mirror://sourceforge/clucene/"
89 "clucene-core-unstable/2.3/clucene-core-"
90 version ".tar.gz"))
91 (sha256
92 (base32
93 "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx"))
94 (patches (search-patches "clucene-pkgconfig.patch"
95 "clucene-contribs-lib.patch"))))
96 (build-system cmake-build-system)
97 (inputs
98 `(("boost" ,boost) ; could also use bundled copy
99 ("zlib" ,zlib)))
100 (arguments
101 `(#:test-target "cl_test"
102 #:configure-flags '("-DBUILD_CONTRIBS_LIB=ON")
103 #:tests? #f)) ; Tests do not compile, as TestIndexSearcher.cpp uses
104 ; undeclared usleep. After fixing this, one needs to run
105 ; "make test" in addition to "make cl_test", then
106 ; SimpleTest fails.
107 ; Notice that the library appears to be unmaintained
108 ; with no reaction to bug reports.
109 (home-page "http://clucene.sourceforge.net/")
110 (synopsis "C text indexing and searching library")
111 (description "CLucene is a high-performance, scalable, cross platform,
112 full-featured indexing and searching API. It is a port of the very popular
113 Java Lucene text search engine API to C++.")
114 (license lgpl2.1)))
115
116 (define-public lrdf
117 (package
118 (name "lrdf")
119 (version "0.5.0")
120 (source (origin
121 (method url-fetch)
122 (uri (string-append "https://github.com/swh/LRDF/archive/"
123 version ".tar.gz"))
124 (file-name (string-append name "-" version ".tar.gz"))
125 (sha256
126 (base32
127 "18p2flb2sv2hq6w2qkd29z9c7knnwqr3f12i2srshlzx6vwkm05s"))))
128 (build-system gnu-build-system)
129 (arguments
130 '(#:phases
131 (modify-phases %standard-phases
132 (add-after 'remove-out-of-tree-references 'autoreconf
133 (lambda _
134 (zero? (system* "autoreconf" "-vfi"))))
135 (add-after 'unpack 'remove-out-of-tree-references
136 (lambda _
137 ;; remove symlinks to files in /usr/
138 (delete-file-recursively "m4")
139 (for-each delete-file '("config.guess"
140 "config.sub"
141 "depcomp"
142 "install-sh"
143 "ltmain.sh"
144 "missing"))
145 ;; remove_test depends on an out-of-tree RDF file
146 (substitute* "examples/Makefile.am"
147 (("instances_test remove_test") "instances_test")
148 (("\\$\\(TESTS\\) remove_test") "$(TESTS)"))
149 #t)))))
150 (inputs
151 `(("raptor" ,raptor2)
152 ("cyrus-sasl" ,cyrus-sasl)
153 ("openssl" ,openssl)
154 ("zlib" ,zlib)))
155 (native-inputs
156 `(("autoconf" ,autoconf)
157 ("automake" ,automake)
158 ("libtool" ,libtool)
159 ("pkg-config" ,pkg-config)))
160 (home-page "https://github.com/swh/LRDF")
161 (synopsis "Lightweight RDF library for accessing LADSPA plugin metadata")
162 (description
163 "LRDF is a library to make it easy to manipulate RDF files describing
164 LADSPA plugins. It can also be used for general RDF manipulation. It can
165 read RDF/XLM and N3 files and export N3 files, and it also has a light
166 taxonomic inference capability.")
167 (license gpl2)))
168
169 (define-public rasqal
170 (package
171 (name "rasqal")
172 (version "0.9.33")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "http://download.librdf.org/source/" name
176 "-" version ".tar.gz"))
177 (sha256
178 (base32
179 "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939"))))
180 (build-system gnu-build-system)
181 (native-inputs
182 `(("perl" ,perl)
183 ("perl-xml-dom" ,perl-xml-dom) ; for the tests
184 ("pkg-config" ,pkg-config)))
185 (inputs
186 `(("libgcrypt" ,libgcrypt)
187 ("libxml2" ,libxml2)
188 ("mpfr" ,mpfr)
189 ("pcre" ,pcre)
190 ("util-linux" ,util-linux)))
191 (propagated-inputs
192 `(("raptor2" ,raptor2))) ; stipulated by rasqal.pc
193 (arguments
194 `(#:parallel-tests? #f
195 ; test failure reported upstream, see
196 ; http://bugs.librdf.org/mantis/view.php?id=571
197 #:tests? #f))
198 (home-page "http://librdf.org/rasqal/")
199 (synopsis "RDF query library")
200 (description "Rasqal is a C library that handles Resource Description
201 Framework (RDF) query language syntaxes, query construction and execution
202 of queries returning results as bindings, boolean, RDF graphs/triples or
203 syntaxes. The supported query languages are SPARQL Query 1.0,
204 SPARQL Query 1.1, SPARQL Update 1.1 (no executing) and the Experimental
205 SPARQL extensions (LAQRS). Rasqal can write binding query results in the
206 SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables, RDF/XML and
207 Turtle/N3 and read them in SPARQL XML, RDF/XML and Turtle/N3.")
208 (license lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
209
210 (define-public redland
211 (package
212 (name "redland")
213 (version "1.0.17")
214 (source (origin
215 (method url-fetch)
216 (uri (string-append "http://download.librdf.org/source/" name
217 "-" version ".tar.gz"))
218 (sha256
219 (base32
220 "109n0kp39p966dpiasad2bb7q66rwbcb9avjvimw28chnpvlf66y"))))
221 (build-system gnu-build-system)
222 (native-inputs
223 `(("perl" ,perl) ; needed for installation
224 ("pkg-config" ,pkg-config)))
225 (propagated-inputs
226 `(("rasqal" ,rasqal))) ; in Requires.private field of .pc
227 (inputs
228 `(("bdb" ,bdb)))
229 (home-page "http://librdf.org/")
230 (synopsis "RDF library")
231 (description "The Redland RDF Library (librdf) provides the RDF API
232 and triple stores.")
233 (license lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
234
235 (define-public serd
236 (package
237 (name "serd")
238 (version "0.26.0")
239 (source (origin
240 (method url-fetch)
241 (uri (string-append "http://download.drobilla.net/serd-"
242 version ".tar.bz2"))
243 (sha256
244 (base32
245 "164j43am4hka2vbzw4n52zy7rafgp6kmkgbcbvap368az644mr73"))))
246 (build-system waf-build-system)
247 (arguments
248 `(#:tests? #f ; no check target
249 #:phases
250 (modify-phases %standard-phases
251 (add-before
252 'configure 'set-ldflags
253 (lambda* (#:key outputs #:allow-other-keys)
254 (setenv "LDFLAGS"
255 (string-append "-Wl,-rpath="
256 (assoc-ref outputs "out") "/lib")))))))
257 (home-page "http://drobilla.net/software/serd/")
258 (synopsis "Library for RDF syntax supporting Turtle and NTriples")
259 (description
260 "Serd is a lightweight C library for RDF syntax which supports reading
261 and writing Turtle and NTriples. Serd is not intended to be a swiss-army
262 knife of RDF syntax, but rather is suited to resource limited or performance
263 critical applications (e.g. converting many gigabytes of NTriples to Turtle),
264 or situations where a simple reader/writer with minimal dependencies is
265 ideal (e.g. in LV2 implementations or embedded applications).")
266 (license isc)))
267
268 (define-public sord
269 (package
270 (name "sord")
271 (version "0.16.0")
272 (source (origin
273 (method url-fetch)
274 (uri (string-append "http://download.drobilla.net/sord-"
275 version ".tar.bz2"))
276 (sha256
277 (base32
278 "0nh3i867g9z4kdlnk82cg2kcw8r02qgifxvkycvzb4vfjv4v4g4x"))))
279 (build-system waf-build-system)
280 (arguments
281 `(#:tests? #f ; no check target
282 #:phases
283 (modify-phases %standard-phases
284 (add-before
285 'configure 'set-ldflags
286 (lambda* (#:key outputs #:allow-other-keys)
287 (setenv "LDFLAGS"
288 (string-append "-Wl,-rpath="
289 (assoc-ref outputs "out") "/lib")))))))
290 (inputs
291 `(("serd" ,serd)))
292 (native-inputs
293 `(("pkg-config" ,pkg-config)))
294 (home-page "http://drobilla.net/software/sord/")
295 (synopsis "C library for storing RDF data in memory")
296 (description
297 "Sord is a lightweight C library for storing RDF data in memory.")
298 (license isc)))
299
300 (define-public python-rdflib
301 (package
302 (name "python-rdflib")
303 (version "4.1.2")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (string-append
308 "https://pypi.python.org/packages/source/r/rdflib/rdflib-"
309 version
310 ".tar.gz"))
311 (patches
312 ;; The patch has no effect under Python 3.
313 (search-patches "python2-rdflib-drop-sparqlwrapper.patch"))
314 (sha256
315 (base32
316 "0kvaf332cqbi47rqzlpdx4mbkvw12mkrzkj8n9l19wk713d4py9w"))))
317 (build-system python-build-system)
318 (arguments
319 '(;; FIXME: Three test failures. Try uncommenting the below next update.
320 #:tests? #f))
321 ;; #:phases
322 ;; (modify-phases %standard-phases
323 ;; (replace 'check
324 ;; (lambda _
325 ;; ;; Run tests from the build directory so python3 only
326 ;; ;; sees the installed 2to3 version.
327 ;; (zero? (system* "nosetests" "--where=./build/src")))))
328 (native-inputs
329 `(("python-nose" ,python-nose)))
330 (propagated-inputs
331 `(("python-html5lib" ,python-html5lib)
332 ("python-isodate" ,python-isodate)
333 ("python-pyparsing" ,python-pyparsing)))
334 (home-page "https://github.com/RDFLib/rdflib")
335 (synopsis
336 "Python RDF library")
337 (description
338 "RDFLib is a Python library for working with RDF, a simple yet
339 powerful language for representing information.")
340 (license (non-copyleft "file://LICENSE"
341 "See LICENSE in the distribution."))))
342
343 (define-public python2-rdflib
344 (package-with-python2 python-rdflib))