Closed danbri closed 2 years ago
Looks like RDFLib users have encountered this issue before, according to https://github.com/RDFLib/rdflib/issues/1423#issuecomment-939989021 and a fix was committed just a couple of weeks ago in https://github.com/RDFLib/rdflib/pull/1436 which should actually fetch the context doc via the link.
I just checked this using the latest master
branch and got:
def test_jsonld_conneg():
g = Graph().parse(location="https://gist.githubusercontent.com/danbri/0cc3fc147d6d34945d0f61dcc11bc409/raw/0aa0d1a7574495a8fe7f1297121afe921b048a8f/gistfile1.txt", format="json-ld")
assert len(g) == 35
So, if that's actually testing your issue (not necessarily the case, given the conneg implications) then please check with the current master branch (all tests passing as of 13 hrs ago at time of response).
Locally checked fix to identified problem in latest master branch and all seems OK.
Presume this will be in 6.2.x when it is released.
Closing this as 6.2.0 has been released, please re-open if the issue persists.
I have been trying different variations to parse a JSON-LD file into a Graph, but they're all failing.
The file seems OK (I tried several) and it parses ok with the JSON-LD playground. I tried a few variations for invoking the parser.
This was after entirely nuking and reinstalling Python/Anaconda, and was in a fresh Conda environment (python=3.8), and with only "pip3 install rdflib", i.e. no ageing version of the plugin version of the parser hanging around.
parsejsonld_A.py
parsejsonld_B.py
parsejsonld_A.py
The example file is just taken from Google documentation, see this Gist.
In each case I get this response:
As far as I can tell this is this something to do with the Schema.org @context URL, and our migration from http://schema.org/ + conneg, to https://schema.org/ and a JSON-LD 1.1-style HTTP header as the discovery mechanism for the context? But the error message is pretty uninformative.
If I change the schema.org context in the files to avoid a remote context, it parses.
The context lives here:
Would a PR be welcomed on this?
e.g.
Related discussion: https://github.com/schemaorg/schemaorg/issues/2578