diff --git a/pyproject.toml b/pyproject.toml index be8cdb0..a908e46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ include = [ [tool.poetry.dependencies] python = "^3.6.2" # Compatible python versions must be declared here -rdflib = ">=5.0.0,<7" +rdflib = ">=6.0.0,<7" owlrl = "^5.2.3" rdflib-jsonld = { version=">=0.4.0,<0.6", optional=true} pyduktape2 = {version="^0.4.1", python=">=3.6", optional=true} diff --git a/pyshacl/pyshacl-cli.spec b/pyshacl/pyshacl-cli.spec index 47158d2..e83183f 100644 --- a/pyshacl/pyshacl-cli.spec +++ b/pyshacl/pyshacl-cli.spec @@ -19,7 +19,6 @@ a = Analysis( 'rdflib.plugins', 'rdflib', 'urllib3', - 'rdflib_jsonld', 'win32com.gen_py', 'pkg_resources.py2_warn' ], diff --git a/pyshacl/rdfutil/load.py b/pyshacl/rdfutil/load.py index 67881b5..ba70788 100644 --- a/pyshacl/rdfutil/load.py +++ b/pyshacl/rdfutil/load.py @@ -18,13 +18,6 @@ GraphLike = Union[ConjunctiveLike, rdflib.Graph] -try: - import rdflib_jsonld # noqa: F401 - - has_json_ld = True -except ImportError: - has_json_ld = False - is_windows = platform.system() == "Windows" @@ -244,8 +237,6 @@ def load_from_source( source.close() source = new_bytes source_was_open = False - if (rdf_format == "json-ld" or rdf_format == "json") and not has_json_ld: - raise RuntimeError("Cannot load a JSON-LD file if rdflib_jsonld is not installed.") if rdf_format == 'turtle' or rdf_format == 'n3': # SHACL Shapes files and Data files can have extra RDF Metadata in the # Top header block, including #BaseURI and #Prefix. diff --git a/pyshacl/validate.py b/pyshacl/validate.py index bda0277..8ad409c 100644 --- a/pyshacl/validate.py +++ b/pyshacl/validate.py @@ -11,17 +11,8 @@ import owlrl import rdflib -from rdflib.util import from_n3 - -from .extras import check_extra_installed -from .pytypes import GraphLike -from .target import apply_target_types, gather_target_types - - -if owlrl.json_ld_available: - import rdflib_jsonld # noqa: F401 - from rdflib import BNode, Literal, URIRef +from rdflib.util import from_n3 from .consts import ( RDF_object, @@ -35,9 +26,11 @@ SH_ValidationReport, ) from .errors import ReportableRuntimeError, ValidationFailure +from .extras import check_extra_installed from .functions import apply_functions, gather_functions, unapply_functions from .inference import CustomRDFSOWLRLSemantics, CustomRDFSSemantics from .monkey import apply_patches, rdflib_bool_patch, rdflib_bool_unpatch +from .pytypes import GraphLike from .rdfutil import ( clone_blank_node, clone_graph, @@ -51,6 +44,7 @@ from .rdfutil.load import add_baked_in from .rules import apply_rules, gather_rules from .shapes_graph import ShapesGraph +from .target import apply_target_types, gather_target_types log_handler = logging.StreamHandler(stderr)