rdf.scm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2015, 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  5. ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
  6. ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
  7. ;;; Copyright © 2020 Pjotr Prins <pjotr.guix@thebird.nl>
  8. ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
  10. ;;;
  11. ;;; This file is part of GNU Guix.
  12. ;;;
  13. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  14. ;;; under the terms of the GNU General Public License as published by
  15. ;;; the Free Software Foundation; either version 3 of the License, or (at
  16. ;;; your option) any later version.
  17. ;;;
  18. ;;; GNU Guix is distributed in the hope that it will be useful, but
  19. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. ;;; GNU General Public License for more details.
  22. ;;;
  23. ;;; You should have received a copy of the GNU General Public License
  24. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  25. (define-module (gnu packages rdf)
  26. #:use-module ((guix licenses) #:prefix license:)
  27. #:use-module (guix packages)
  28. #:use-module (guix git-download)
  29. #:use-module (guix download)
  30. #:use-module (guix build-system cmake)
  31. #:use-module (guix build-system gnu)
  32. #:use-module (guix build-system python)
  33. #:use-module (guix build-system waf)
  34. #:use-module (gnu packages)
  35. #:use-module (gnu packages autotools)
  36. #:use-module (gnu packages boost)
  37. #:use-module (gnu packages check)
  38. #:use-module (gnu packages compression)
  39. #:use-module (gnu packages curl)
  40. #:use-module (gnu packages cyrus-sasl)
  41. #:use-module (gnu packages documentation)
  42. #:use-module (gnu packages dbm)
  43. #:use-module (gnu packages gnupg)
  44. #:use-module (gnu packages linux)
  45. #:use-module (gnu packages multiprecision)
  46. #:use-module (gnu packages pcre)
  47. #:use-module (gnu packages perl)
  48. #:use-module (gnu packages pkg-config)
  49. #:use-module (gnu packages python)
  50. #:use-module (gnu packages python-web)
  51. #:use-module (gnu packages python-xyz)
  52. #:use-module (gnu packages qt)
  53. #:use-module (gnu packages time)
  54. #:use-module (gnu packages tls)
  55. #:use-module (gnu packages xml))
  56. (define-public raptor2
  57. (package
  58. (name "raptor2")
  59. (version "2.0.15")
  60. (source (origin
  61. (method url-fetch)
  62. (uri (string-append "https://download.librdf.org/source/" name
  63. "-" version ".tar.gz"))
  64. (patches
  65. (search-patches "raptor2-heap-overflow.patch"))
  66. (sha256
  67. (base32
  68. "1vc02im4mpc28zxzgli68k6j0dakh0k3s389bm436yvqajxg19xd"))))
  69. (build-system gnu-build-system)
  70. (inputs
  71. `(("curl" ,curl)
  72. ("libxml2" ,libxml2)
  73. ("libxslt" ,libxslt)
  74. ("zlib" ,zlib)))
  75. (arguments
  76. `(#:parallel-tests? #f))
  77. (home-page "https://librdf.org/raptor/")
  78. (synopsis "RDF syntax library")
  79. (description "Raptor is a C library providing a set of parsers and
  80. serialisers that generate Resource Description Framework (RDF) triples
  81. by parsing syntaxes or serialise the triples into a syntax. The supported
  82. parsing syntaxes are RDF/XML, N-Quads, N-Triples 1.0 and 1.1, TRiG,
  83. Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup including all versions
  84. of RSS, Atom 1.0 and 0.3, GRDDL and microformats for HTML, XHTML and
  85. XML. The serialising syntaxes are RDF/XML (regular, abbreviated, XMP),
  86. Turtle 2013, N-Quads, N-Triples 1.1, Atom 1.0, RSS 1.0, GraphViz DOT,
  87. HTML and JSON.")
  88. (license license:lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
  89. (define-public clucene
  90. (package
  91. (name "clucene")
  92. (version "2.3.3.4")
  93. (source (origin
  94. (method url-fetch)
  95. (uri (string-append "mirror://sourceforge/clucene/"
  96. "clucene-core-unstable/2.3/clucene-core-"
  97. version ".tar.gz"))
  98. (sha256
  99. (base32
  100. "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx"))
  101. (patches (search-patches "clucene-pkgconfig.patch"
  102. "clucene-contribs-lib.patch"))))
  103. (build-system cmake-build-system)
  104. (inputs
  105. `(("boost" ,boost) ; could also use bundled copy
  106. ("zlib" ,zlib)))
  107. (arguments
  108. `(#:test-target "cl_test"
  109. #:configure-flags '("-DBUILD_CONTRIBS_LIB=ON")
  110. #:tests? #f)) ; Tests do not compile, as TestIndexSearcher.cpp uses
  111. ; undeclared usleep. After fixing this, one needs to run
  112. ; "make test" in addition to "make cl_test", then
  113. ; SimpleTest fails.
  114. ; Notice that the library appears to be unmaintained
  115. ; with no reaction to bug reports.
  116. (home-page "http://clucene.sourceforge.net/")
  117. (synopsis "C text indexing and searching library")
  118. (description "CLucene is a high-performance, scalable, cross platform,
  119. full-featured indexing and searching API. It is a port of the very popular
  120. Java Lucene text search engine API to C++.")
  121. (license license:lgpl2.1)))
  122. (define-public lucene++
  123. (package
  124. (name "lucene++")
  125. (version "3.0.7")
  126. (source (origin
  127. (method git-fetch)
  128. (uri (git-reference
  129. (url "https://github.com/luceneplusplus/LucenePlusPlus")
  130. (commit (string-append "rel_" version))))
  131. (file-name (git-file-name name version))
  132. (sha256
  133. (base32
  134. "06b37fly6l27zc6kbm93f6khfsv61w792j8xihfagpcm9cfz2zi1"))))
  135. (build-system cmake-build-system)
  136. (arguments
  137. `(#:configure-flags
  138. ;; CXX_FLAGS suggested in a closed issue on github:
  139. ;; https://github.com/luceneplusplus/LucenePlusPlus/issues/100
  140. (list "-Wno-dev" "-DCMAKE_CXX_FLAGS=-DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT"
  141. ;; Install in lib64 break rpath
  142. "-DCMAKE_INSTALL_LIBDIR:PATH=lib")))
  143. (native-inputs
  144. `(("pkg-config" ,pkg-config)))
  145. (inputs
  146. `(("boost" ,boost)))
  147. (home-page "https://github.com/luceneplusplus/LucenePlusPlus")
  148. (synopsis "Text search engine")
  149. (description "Lucene++ is an up to date C++ port of the popular Java
  150. Lucene library, a high-performance, full-featured text search engine.")
  151. (license (list license:asl2.0 license:lgpl3+)))); either asl or lgpl.
  152. (define-public lrdf
  153. (package
  154. (name "lrdf")
  155. (version "0.6.1")
  156. (source (origin
  157. (method git-fetch)
  158. (uri (git-reference
  159. (url "https://github.com/swh/LRDF")
  160. (commit (string-append "v" version))))
  161. (file-name (git-file-name name version))
  162. (sha256
  163. (base32
  164. "00wzkfb8y0aqd519ypz067cq099dpc89w69zw8ln39vl6f9x2pd4"))))
  165. (build-system gnu-build-system)
  166. (arguments
  167. '(#:phases
  168. (modify-phases %standard-phases
  169. (add-after 'unpack 'remove-out-of-tree-references
  170. (lambda _
  171. ;; remove_test depends on an out-of-tree RDF file
  172. (substitute* "examples/Makefile.am"
  173. (("instances_test remove_test") "instances_test")
  174. (("\\$\\(TESTS\\) remove_test") "$(TESTS)"))
  175. #t))
  176. ;; The default bootstrap phase executes autogen.sh, which fails.
  177. (replace 'bootstrap
  178. (lambda _ (invoke "autoreconf" "-vif") #t)))))
  179. (inputs
  180. `(("raptor" ,raptor2)
  181. ("cyrus-sasl" ,cyrus-sasl)
  182. ("zlib" ,zlib)))
  183. (native-inputs
  184. `(("autoconf" ,autoconf)
  185. ("automake" ,automake)
  186. ("libtool" ,libtool)
  187. ("pkg-config" ,pkg-config)))
  188. (home-page "https://github.com/swh/LRDF")
  189. (synopsis "Lightweight RDF library for accessing LADSPA plugin metadata")
  190. (description
  191. "LRDF is a library to make it easy to manipulate RDF files describing
  192. LADSPA plugins. It can also be used for general RDF manipulation. It can
  193. read RDF/XLM and N3 files and export N3 files, and it also has a light
  194. taxonomic inference capability.")
  195. (license license:gpl2)))
  196. (define-public rasqal
  197. (package
  198. (name "rasqal")
  199. (version "0.9.33")
  200. (source (origin
  201. (method url-fetch)
  202. (uri (string-append "http://download.librdf.org/source/" name
  203. "-" version ".tar.gz"))
  204. (sha256
  205. (base32
  206. "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939"))))
  207. (build-system gnu-build-system)
  208. (native-inputs
  209. `(("perl" ,perl)
  210. ("perl-xml-dom" ,perl-xml-dom) ; for the tests
  211. ("pkg-config" ,pkg-config)))
  212. (inputs
  213. `(("libgcrypt" ,libgcrypt)
  214. ("libxml2" ,libxml2)
  215. ("mpfr" ,mpfr)
  216. ("pcre" ,pcre)
  217. ("util-linux" ,util-linux "lib")))
  218. (propagated-inputs
  219. `(("raptor2" ,raptor2))) ; stipulated by rasqal.pc
  220. (arguments
  221. `(#:parallel-tests? #f
  222. ; test failure reported upstream, see
  223. ; http://bugs.librdf.org/mantis/view.php?id=571
  224. #:tests? #f))
  225. (home-page "http://librdf.org/rasqal/")
  226. (synopsis "RDF query library")
  227. (description "Rasqal is a C library that handles Resource Description
  228. Framework (RDF) query language syntaxes, query construction and execution
  229. of queries returning results as bindings, boolean, RDF graphs/triples or
  230. syntaxes. The supported query languages are SPARQL Query 1.0,
  231. SPARQL Query 1.1, SPARQL Update 1.1 (no executing) and the Experimental
  232. SPARQL extensions (LAQRS). Rasqal can write binding query results in the
  233. SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables, RDF/XML and
  234. Turtle/N3 and read them in SPARQL XML, RDF/XML and Turtle/N3.")
  235. (license license:lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
  236. (define-public redland
  237. (package
  238. (name "redland")
  239. (version "1.0.17")
  240. (source (origin
  241. (method url-fetch)
  242. (uri (string-append "http://download.librdf.org/source/" name
  243. "-" version ".tar.gz"))
  244. (sha256
  245. (base32
  246. "109n0kp39p966dpiasad2bb7q66rwbcb9avjvimw28chnpvlf66y"))))
  247. (build-system gnu-build-system)
  248. (native-inputs
  249. `(("perl" ,perl) ; needed for installation
  250. ("pkg-config" ,pkg-config)))
  251. (propagated-inputs
  252. `(("rasqal" ,rasqal))) ; in Requires.private field of .pc
  253. (inputs
  254. `(("bdb" ,bdb)))
  255. (home-page "http://librdf.org/")
  256. (synopsis "RDF library")
  257. (description "The Redland RDF Library (librdf) provides the RDF API
  258. and triple stores.")
  259. (license license:lgpl2.1+))) ; or any choice of gpl2+ or asl2.0
  260. (define-public serd
  261. (package
  262. (name "serd")
  263. (version "0.30.8")
  264. (source (origin
  265. (method url-fetch)
  266. (uri (string-append "https://download.drobilla.net/serd-"
  267. version ".tar.bz2"))
  268. (sha256
  269. (base32
  270. "11zs53yx40mv62vxsl15mvdh7s17y5v6lgcgahdvzxgnan7w8bk7"))))
  271. (build-system waf-build-system)
  272. (arguments
  273. `(#:tests? #f ; no check target
  274. #:phases
  275. (modify-phases %standard-phases
  276. (add-before
  277. 'configure 'set-ldflags
  278. (lambda* (#:key outputs #:allow-other-keys)
  279. (setenv "LDFLAGS"
  280. (string-append "-Wl,-rpath="
  281. (assoc-ref outputs "out") "/lib"))
  282. #t)))))
  283. (home-page "https://drobilla.net/software/serd/")
  284. (synopsis "Library for RDF syntax supporting Turtle and NTriples")
  285. (description
  286. "Serd is a lightweight C library for RDF syntax which supports reading
  287. and writing Turtle and NTriples. Serd is not intended to be a swiss-army
  288. knife of RDF syntax, but rather is suited to resource limited or performance
  289. critical applications (e.g. converting many gigabytes of NTriples to Turtle),
  290. or situations where a simple reader/writer with minimal dependencies is
  291. ideal (e.g. in LV2 implementations or embedded applications).")
  292. (license license:isc)))
  293. (define-public sord
  294. (package
  295. (name "sord")
  296. (version "0.16.8")
  297. (source (origin
  298. (method url-fetch)
  299. (uri (string-append "https://download.drobilla.net/sord-"
  300. version ".tar.bz2"))
  301. (sha256
  302. (base32
  303. "052y7zllrg0bzyky2rmrrwnnf16p6bk7q40rq9mgm0mzm8p9sa3w"))))
  304. (build-system waf-build-system)
  305. (arguments
  306. `(#:tests? #f ; no check target
  307. #:phases
  308. (modify-phases %standard-phases
  309. (add-before
  310. 'configure 'set-ldflags
  311. (lambda* (#:key outputs #:allow-other-keys)
  312. (setenv "LDFLAGS"
  313. (string-append "-Wl,-rpath="
  314. (assoc-ref outputs "out") "/lib"))
  315. #t)))))
  316. (inputs
  317. `(("pcre" ,pcre)))
  318. (native-inputs
  319. `(("pkg-config" ,pkg-config)))
  320. (propagated-inputs
  321. `(("serd" ,serd))) ; required by sord-0.pc
  322. (home-page "https://drobilla.net/software/sord/")
  323. (synopsis "C library for storing RDF data in memory")
  324. (description
  325. "Sord is a lightweight C library for storing RDF data in memory.")
  326. (license license:isc)))
  327. (define-public python-rdflib
  328. (package
  329. (name "python-rdflib")
  330. (version "4.2.2")
  331. (source
  332. (origin
  333. (method url-fetch)
  334. (uri (pypi-uri "rdflib" version))
  335. (sha256
  336. (base32
  337. "0398c714znnhaa2x7v51b269hk20iz073knq2mvmqp2ma92z27fs"))))
  338. (build-system python-build-system)
  339. (arguments
  340. '(;; FIXME: Three test failures. Should be fixed next release.
  341. #:tests? #f))
  342. ;; #:phases
  343. ;; (modify-phases %standard-phases
  344. ;; (replace 'check
  345. ;; (lambda _
  346. ;; ;; Run tests from the build directory so python3 only
  347. ;; ;; sees the installed 2to3 version.
  348. ;; (invoke "nosetests" "--where=./build/src"))))))
  349. (native-inputs
  350. `(("python-nose" ,python-nose)))
  351. (propagated-inputs
  352. `(("python-html5lib" ,python-html5lib)
  353. ("python-isodate" ,python-isodate)
  354. ("python-pyparsing" ,python-pyparsing)))
  355. (home-page "https://github.com/RDFLib/rdflib")
  356. (synopsis "Python RDF library")
  357. (description
  358. "RDFLib is a Python library for working with RDF, a simple yet
  359. powerful language for representing information.")
  360. (license (license:non-copyleft "file://LICENSE"
  361. "See LICENSE in the distribution."))))
  362. (define-public python2-rdflib
  363. (package-with-python2 python-rdflib))
  364. (define-public python-rdflib-jsonld
  365. (package
  366. (name "python-rdflib-jsonld")
  367. (version "0.5.0")
  368. (source
  369. (origin
  370. (method url-fetch)
  371. (uri (pypi-uri "rdflib-jsonld" version))
  372. (sha256
  373. (base32
  374. "1v85f4hdlrrk0l1najmqmm79ijrvcj259kwsrrxiq1q5chr5azag"))))
  375. (build-system python-build-system)
  376. (native-inputs
  377. `(("python-nose" ,python-nose)))
  378. (propagated-inputs
  379. `(("python-rdflib" ,python-rdflib)))
  380. (home-page "https://github.com/RDFLib/rdflib-jsonld")
  381. (synopsis "rdflib extension adding JSON-LD parser and serializer")
  382. (description "This package provides an rdflib extension adding JSON-LD
  383. parser and serializer.")
  384. (license license:bsd-3)))
  385. (define-public python-cfgraph
  386. (package
  387. (name "python-cfgraph")
  388. (version "0.2.1")
  389. (source
  390. (origin
  391. (method url-fetch)
  392. (uri (pypi-uri "CFGraph" version))
  393. (sha256
  394. (base32
  395. "0x7yz0lvqb6mkhl5fbml27sppmscgpf8v2ism9jzzf0h982ffzxm"))))
  396. (build-system python-build-system)
  397. (propagated-inputs
  398. `(("python-rdflib" ,python-rdflib)))
  399. (home-page "https://github.com/hsolbrig/CFGraph")
  400. (synopsis "RDF Collections flattener for rdflib")
  401. (description
  402. "This package contains RDF Collections flattener for @code{rdflib}.")
  403. (license license:asl2.0)))
  404. (define-public hdt-cpp
  405. (package
  406. (name "hdt-cpp")
  407. (version "1.3.3")
  408. (source (origin
  409. (method git-fetch)
  410. (uri (git-reference
  411. (url "https://github.com/rdfhdt/hdt-cpp")
  412. (commit (string-append "v" version))))
  413. (file-name (git-file-name name version))
  414. (sha256
  415. (base32
  416. "1vsq80jnix6cy78ayag7v8ajyw7h8dqyad1q6xkf2hzz3skvr34z"))))
  417. (build-system gnu-build-system)
  418. (inputs
  419. `(("serd" ,serd)
  420. ("zlib" ,zlib)))
  421. (native-inputs
  422. `(("autoconf" ,autoconf)
  423. ("automake" ,automake)
  424. ("libtool" ,libtool)
  425. ("pkg-config" ,pkg-config)))
  426. (home-page "https://github.com/rdfhdt/hdt-cpp")
  427. (synopsis "C++ implementation of the HDT compression format")
  428. (description "Header Dictionary Triples (HDT) is a compression format for
  429. RDF data that can also be queried for Triple Patterns. This package provides a
  430. C++ library as well as various command-line tools to to work with HDT.")
  431. (license license:lgpl2.1+)))
  432. (define-public python-sparqlwrapper
  433. (package
  434. (name "python-sparqlwrapper")
  435. (version "1.8.5")
  436. (source (origin
  437. (method git-fetch)
  438. (uri (git-reference
  439. (url "https://github.com/RDFLib/sparqlwrapper.git")
  440. (commit version)))
  441. (file-name (git-file-name name version))
  442. (sha256
  443. (base32
  444. "1ia5h06zf6kpw6gdi7f80pzx10m79brj08zrbffb5wn9hzz8x528"))))
  445. (build-system python-build-system)
  446. (arguments
  447. '(#:tests? #f)) ; The test suite simply queries external HTTP endpoints.
  448. (native-inputs
  449. `(("python-nose" ,python-nose)))
  450. (propagated-inputs
  451. `(("python-rdflib" ,python-rdflib)))
  452. (home-page "https://rdflib.dev/sparqlwrapper/")
  453. (synopsis "SPARQL Endpoint interface to Python")
  454. (description "Python wrapper around a SPARQL service. It helps in creating
  455. the query URI and, possibly, convert the result into a more manageable
  456. format.")
  457. (license license:w3c)))