summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-03 15:55:35 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-31 14:52:33 -0400
commit0999af5b42540f2d5f4b52c65a7e350f071d2f3c (patch)
treed12567b0f8dca0ddd5cfa8051de6445c3753eaca
parentc5dd41afc6659b96c86efea512ee7ecc0bbf6604 (diff)
gnu: Add python-pyrdfa3.
* gnu/packages/rdf.scm (python-pyrdfa3): New variable.
-rw-r--r--gnu/packages/rdf.scm37
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm
index 826330585d..6712c2c237 100644
--- a/gnu/packages/rdf.scm
+++ b/gnu/packages/rdf.scm
@@ -471,6 +471,43 @@ 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")