summary refs log tree commit diff
path: root/gnu/packages/rdf.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/rdf.scm')
-rw-r--r--gnu/packages/rdf.scm53
1 files changed, 42 insertions, 11 deletions
diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm
index e3a26cf734..03aecd1ee5 100644
--- a/gnu/packages/rdf.scm
+++ b/gnu/packages/rdf.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -398,9 +399,6 @@ powerful language for representing information.")
     ;; and this package is only transitional.
     (arguments '(#:tests? #f))))
 
-(define-public python2-rdflib
-  (package-with-python2 python-rdflib-5))
-
 ;; Note: This package is only needed for rdflib < 6.0; supersede when
 ;; the above are removed.
 (define-public python-rdflib-jsonld
@@ -470,27 +468,60 @@ RDF data that can also be queried for Triple Patterns.  This package provides a
 C++ library as well as various command-line tools to to work with HDT.")
 (license license:lgpl2.1+)))
 
+(define-public python-pyrdfa3
+  (package
+    (name "python-pyrdfa3")
+    (version "3.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyRdfa3" version))
+       (sha256
+        (base32 "1biif5lav3gswkhjzq882s4rgxzmvwsy5gb9dxdk9pw75fln6xhm"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;no test suite
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-python-3-issues
+            (lambda _
+              ;; Delete files that appear to be versions for older Pythons;
+              ;; they fail to byte compile (see:
+              ;; https://github.com/RDFLib/pyrdfa3/issues/41).
+              (with-directory-excursion "pyRdfaExtras/serializers"
+                (for-each delete-file
+                          (list "prettyXMLserializer_3.py"
+                                "prettyXMLserializer_3_2.py")))
+              ;; See https://github.com/RDFLib/pyrdfa3/issues/42.
+              (substitute* "pyRdfaExtras/__init__.py"
+                (("from StringIO import StringIO")
+                 "from io import StringIO")))))))
+    (propagated-inputs (list python-html5lib python-rdflib))
+    (home-page "https://www.w3.org/2012/pyRdfa/")
+    (synopsis "RDFa Python distiller/parser library")
+    (description "This library can extract RDFa 1.1 from (X)HTML, SVG, or XML.
+It can produce serialized versions of the extracted graph, or an RDFLib
+Graph.")
+    (license license:bsd-3)))
+
 (define-public python-sparqlwrapper
   (package
     (name "python-sparqlwrapper")
-    (version "1.8.5")
+    (version "2.0.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                     (url "https://github.com/RDFLib/sparqlwrapper.git")
+                     (url "https://github.com/RDFLib/sparqlwrapper")
                      (commit version)))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1ia5h06zf6kpw6gdi7f80pzx10m79brj08zrbffb5wn9hzz8x528"))))
+                "1b4vg754kcxvinwdv7pjfmwbnmgm50w8mb2naf2lwp27bpyllvkb"))))
     (build-system python-build-system)
     (arguments
      '(#:tests? #f)) ; The test suite simply queries external HTTP endpoints.
-    (native-inputs
-     ;; Build with setuptools <58 to get lib2to3 support.
-     (list python-nose python-setuptools))
-    (propagated-inputs
-     (list python-rdflib))
+    (propagated-inputs (list python-rdflib))
     (home-page "https://rdflib.dev/sparqlwrapper/")
     (synopsis "SPARQL Endpoint interface to Python")
     (description "Python wrapper around a SPARQL service.  It helps in creating