Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove rdflib_jsonld dependency #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions owlrl/AxiomaticTriples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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



2 changes: 1 addition & 1 deletion owlrl/Closure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/CombinedClosure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/DatatypeHandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/OWL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/OWLRL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/OWLRLExtras.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/RDFS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/RestrictedDatatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion owlrl/XsdDatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 4 additions & 24 deletions owlrl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


################################################################################################################

Expand All @@ -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"
Expand All @@ -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")

Expand Down Expand Up @@ -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")
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
pytest
sphinx
sphinx_rtd_theme
rdflib>=4.2.2
rdflib-jsonld
rdflib>=6.0.0
wheel
twine

#For debian packaging: (uncomment this line)
#stdeb

#Note, stdeb requires debian tools dpkg-buildpackage, python3-all, and debhelper (use apt-get)

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rdflib>=4.2.2
rdflib-jsonld>=0.4.0
rdflib>=6.0.0
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -76,4 +74,3 @@ def open_local(paths, mode='r', encoding='utf8'):
tests_require=['pytest']+requirements,
dependency_links=dependency_links
)