From a5955810ec0dbb7ba4d9c33a6b4d1e5425b3e515 Mon Sep 17 00:00:00 2001 From: Ralf Grubenmann Date: Wed, 8 Sep 2021 14:49:33 +0200 Subject: [PATCH] remove rdflib_jsonld dependency --- PKG-INFO | 4 +--- README.rst | 2 +- owlrl/AxiomaticTriples.py | 5 +---- owlrl/Closure.py | 2 +- owlrl/CombinedClosure.py | 2 +- owlrl/DatatypeHandling.py | 2 +- owlrl/OWL.py | 2 +- owlrl/OWLRL.py | 2 +- owlrl/OWLRLExtras.py | 2 +- owlrl/RDFS.py | 2 +- owlrl/RestrictedDatatype.py | 2 +- owlrl/XsdDatatypes.py | 2 +- owlrl/__init__.py | 28 ++++------------------------ requirements-dev.txt | 4 +--- requirements.txt | 3 +-- setup.py | 3 --- 16 files changed, 18 insertions(+), 49 deletions(-) diff --git a/PKG-INFO b/PKG-INFO index e709b24..d153016 100755 --- a/PKG-INFO +++ b/PKG-INFO @@ -26,7 +26,7 @@ Description: |Original Author DOI| * :code:`scripts/owlrl`: script that can be run locally on to transform a file into RDF (on the standard output). Run the script with :code:`-h` to get the available flags. - The package requires Python version 3.5 or higher; it depends on `RDFLib`_; version 4.2.2 or higher is required. If you need the python 2.7.x compatible version, see the @/py2 branch in this repository. + The package requires Python version 3.5 or higher; it depends on `RDFLib`_; version 6.0.0 or higher is required. If you need the python 2.7.x compatible version, see the @/py2 branch in this repository. .. _RDFLib: https://github.com/RDFLib @@ -46,8 +46,6 @@ Classifier: License :: OSI Approved :: W3C License Classifier: Natural Language :: English Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3 :: Only diff --git a/README.rst b/README.rst index 91a4d6d..0dc602a 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inferenc * :code:`scripts/owlrl`: script that can be run locally on to transform a file into RDF (on the standard output). Run the script with :code:`-h` to get the available flags. -The package requires Python version 3.5 or higher; it depends on `RDFLib`_; version 4.2.2 or higher is required. If you need the python 2.7.x compatible version, see the @/py2 branch in this repository. +The package requires Python version 3.5 or higher; it depends on `RDFLib`_; version 6.0.0 or higher is required. If you need the python 2.7.x compatible version, see the @/py2 branch in this repository. .. _RDFLib: https://github.com/RDFLib diff --git a/owlrl/AxiomaticTriples.py b/owlrl/AxiomaticTriples.py index d5bfeff..5073d40 100755 --- a/owlrl/AxiomaticTriples.py +++ b/owlrl/AxiomaticTriples.py @@ -3,7 +3,7 @@ """ Axiomatic triples to be (possibly) added to the final graph. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib @@ -672,6 +672,3 @@ #: some OWL specific datatypes OWLRL_D_Axiomatic_Triples = RDFS_D_Axiomatic_Triples + _OWL_D_Axiomatic_Triples_types + \ OWL_D_Axiomatic_Triples_subclasses + OWLRL_Datatypes_Disjointness - - - diff --git a/owlrl/Closure.py b/owlrl/Closure.py index 4ea08a7..9954a56 100755 --- a/owlrl/Closure.py +++ b/owlrl/Closure.py @@ -3,7 +3,7 @@ """ The generic superclasses for various rule based semantics and the possible extensions. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/CombinedClosure.py b/owlrl/CombinedClosure.py index 615b8eb..539e3da 100755 --- a/owlrl/CombinedClosure.py +++ b/owlrl/CombinedClosure.py @@ -7,7 +7,7 @@ triples concerning the container membership properties). Using this closure class the OWL 2 RL implementation becomes a full extension of RDFS. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/DatatypeHandling.py b/owlrl/DatatypeHandling.py index f6eb278..a5b1444 100755 --- a/owlrl/DatatypeHandling.py +++ b/owlrl/DatatypeHandling.py @@ -11,7 +11,7 @@ python datatype (or return the original string if this is not possible) which will be used, e.g., for comparisons (equalities). If the lexical value constraints are not met, exceptions are raised. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/OWL.py b/owlrl/OWL.py index 7fc1922..a40130a 100755 --- a/owlrl/OWL.py +++ b/owlrl/OWL.py @@ -2,7 +2,7 @@ OWL and OWL2 terms. Note that the set of terms is *complete*, I.e., it includes *all* OWL 2 terms, regardless of whether the term is used in OWL 2 RL or not. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/OWLRL.py b/owlrl/OWLRL.py index e298401..35528e3 100755 --- a/owlrl/OWLRL.py +++ b/owlrl/OWLRL.py @@ -10,7 +10,7 @@ removed from the graph before serialization to produce 'standard' RDF (which is o.k. for RL, too, because the consequent triples are all right, generalized triples might have had a role in the deduction steps only). -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/OWLRLExtras.py b/owlrl/OWLRLExtras.py index 1d89212..87c6142 100755 --- a/owlrl/OWLRLExtras.py +++ b/owlrl/OWLRLExtras.py @@ -17,7 +17,7 @@ 1. self restriction 1: :code:`?z owl:hasSelf ?x. ?x owl:onProperty ?p. ?y rdf:type ?z. => ?y ?p ?y.` 2. self restriction 2: :code:`?z owl:hasSelf ?x. ?x owl:onProperty ?p. ?y ?p ?y. => ?y rdf:type ?z.` -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/RDFS.py b/owlrl/RDFS.py index c7a7bbc..a9df3b1 100644 --- a/owlrl/RDFS.py +++ b/owlrl/RDFS.py @@ -2,7 +2,7 @@ RDF(S) terms. Note that the set of terms is *complete*, i.e., it includes *all* OWL 2 terms, regardless of whether the term is used in OWL 2 RL or not. -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/RestrictedDatatype.py b/owlrl/RestrictedDatatype.py index 1bd8999..728490b 100644 --- a/owlrl/RestrictedDatatype.py +++ b/owlrl/RestrictedDatatype.py @@ -33,7 +33,7 @@ - checking whether a facet is of a datatype that is allowed for that facet - handling of non-literals in the facets (ie, if the resource is defined to be of type literal, but whose value is defined via a separate :code:`owl:sameAs` somewhere else) -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/XsdDatatypes.py b/owlrl/XsdDatatypes.py index f441d14..113b063 100755 --- a/owlrl/XsdDatatypes.py +++ b/owlrl/XsdDatatypes.py @@ -3,7 +3,7 @@ """ Lists of XSD datatypes and their mutual relationships -**Requires**: `RDFLib`_, 4.0.0 and higher. +**Requires**: `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib diff --git a/owlrl/__init__.py b/owlrl/__init__.py index 964a910..0d3a750 100755 --- a/owlrl/__init__.py +++ b/owlrl/__init__.py @@ -135,14 +135,10 @@ **Requires**: - * `RDFLib`_, 4.0.0 and higher. + * `RDFLib`_, 6.0.0 and higher. .. _RDFLib: https://github.com/RDFLib/rdflib - * `rdflib_jsonld`_ - - .. _rdflib_jsonld: https://github.com/RDFLib/rdflib-jsonld - **License**: This software is available for use under the `W3C Software License`_ .. _W3C Software License: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 @@ -194,16 +190,6 @@ OWL = "owl" FULL = "full" -try: - from rdflib_jsonld.parser import JsonLDParser - from rdflib_jsonld.serializer import JsonLDSerializer - from rdflib.plugin import register, Serializer, Parser - register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') - register('json-ld', Serializer, 'rdflib_jsonld.serializer', 'JsonLDSerializer') - json_ld_available = True -except: - json_ld_available = False - ################################################################################################################ @@ -223,7 +209,7 @@ def __parse_input(iformat, inp, graph): else: if inp.endswith('.ttl') or inp.endswith('.n3'): format = "turtle" - elif json_ld_available and (inp.endswith('.json') or inp.endswith('.jsonld')): + elif inp.endswith('.json') or inp.endswith('.jsonld'): format = "json-ld" elif inp.endswith('.html'): format = "rdfa1.1" @@ -236,10 +222,7 @@ def __parse_input(iformat, inp, graph): elif iformat == RDFXML: format = "xml" elif iformat == JSON: - if json_ld_available: - format = "json-ld" - else: - raise Exception("JSON-LD parser is not available") + format = "json-ld" else: raise Exception("Unknown input syntax") @@ -587,9 +570,6 @@ def __check_yes_or_true(opt): if options.format == TURTLE: return graph.serialize(format="turtle") elif options.format == JSON: - if json_ld_available: - return graph.serialize(format="json-ld") - else: - raise Exception("JSON-LD serializer is not available") + return graph.serialize(format="json-ld") else: return graph.serialize(format="pretty-xml") diff --git a/requirements-dev.txt b/requirements-dev.txt index 85af8aa..8709d15 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,7 @@ pytest sphinx sphinx_rtd_theme -rdflib>=4.2.2 -rdflib-jsonld +rdflib>=6.0.0 wheel twine @@ -10,4 +9,3 @@ twine #stdeb #Note, stdeb requires debian tools dpkg-buildpackage, python3-all, and debhelper (use apt-get) - diff --git a/requirements.txt b/requirements.txt index c1698ed..7590365 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -rdflib>=4.2.2 -rdflib-jsonld>=0.4.0 \ No newline at end of file +rdflib>=6.0.0 diff --git a/setup.py b/setup.py index 34a41ff..4eadf9d 100755 --- a/setup.py +++ b/setup.py @@ -63,8 +63,6 @@ def open_local(paths, mode='r', encoding='utf8'): 'Natural Language :: English', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3 :: Only', @@ -76,4 +74,3 @@ def open_local(paths, mode='r', encoding='utf8'): tests_require=['pytest']+requirements, dependency_links=dependency_links ) -