Skip to content

Commit

Permalink
Remove dependency on rdflib-jsonld
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius authored and Ralf Grubenmann committed Sep 13, 2021
1 parent 3720c68 commit b92da76
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -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.1"
rdflib-jsonld = ">=0.4.0,<0.6"
pyduktape2 = {version="^0.4.1", python=">=3.6", optional=true}
Expand Down
1 change: 0 additions & 1 deletion pyshacl/pyshacl-cli.spec
Expand Up @@ -19,7 +19,6 @@ a = Analysis(
'rdflib.plugins',
'rdflib',
'urllib3',
'rdflib_jsonld',
'win32com.gen_py',
'pkg_resources.py2_warn'
],
Expand Down
9 changes: 0 additions & 9 deletions pyshacl/rdfutil/load.py
Expand Up @@ -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"


Expand Down Expand Up @@ -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.
Expand Down
14 changes: 4 additions & 10 deletions pyshacl/validate.py
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit b92da76

Please sign in to comment.