RDFLib / pySHACL

A Python validator for SHACL
Apache License 2.0
245 stars 63 forks source link

metashacl flag raises TypeError with rdflib 6.2.0 #153

Closed ajnelson-nist closed 2 years ago

ajnelson-nist commented 2 years ago

I gave --metashacl a whirl this morning, and was informed of a non-halting error. The rough shell transcript includes some detail that might not be necessary for reproduction (e.g. this is the repository I was testing this in; and, this was an experimental change to /tests/Makefile), but I haven't dug into which flag combination could cause the error if something aside from --metashacl is required, so here are the flags I used for the sake of reproduction:

# Review UCO for SHACL conformance.
source venv/bin/activate \
      && pyshacl \
        --data-file-format json-ld \
        --format turtle \
        --inference none \
        --metashacl \
        --ont-file-format turtle \
        --ont-graph __uco_monolithic.ttl \
        --shacl __uco_monolithic.ttl \
        --shacl-file-format turtle \
        examples/hash_PASS.json
caught a TypeError, retrying call to <class 'pyshacl.monkey.memory2.Memory2'>.bind without override, see https://github.com/RDFLib/rdflib/issues/1880 for more info
Traceback (most recent call last):
  File "/private/tmp/UCO/tests/venv/lib/python3.9/site-packages/rdflib/namespace/__init__.py", line 627, in _store_bind
    return self.store.bind(prefix, namespace, override=override)
TypeError: bind() got an unexpected keyword argument 'override'

I don't see this error without the --metashacl flag.

pyshacl did successfully retry and proceed. But, this is probably a behavior that probably shouldn't make it into the pending release.

ashleysommer commented 2 years ago

This for reporting. This will be fixed in the next version of PySHACL.

Due to the rather large changes in RDFLib v6.2.0, and the changes required in PySHACL, it is likely that the next version of PySHACL will work only with rdflib v6.2.0 and drop support for v5, v6, and v6.1.

ashleysommer commented 2 years ago

This is fixed in PySHACL v0.20.0 https://pypi.org/project/pyshacl/0.20.0/