Open teledyn opened 5 years ago
I found my work-around: if I copy the @context into each of the @graph items and parse them one at a time, then combine the results, it resolves as expected
I had the same issue when writing tests: the json-ld that was generated by the rdflib-jsonld serializer could not be directly parsed with the rdflib-jsonld parser.
It seems I get this problem only when the @graph
key is in the json object.
and the length is zero.
If I use
for item in json.loads(js).get('@graph'):
I can build a graph, but it doesn't resolve properly, we are missing connected data and the rdf:type is missing the context:which clearly isn't going to work ... if I inspect the
item
members of the graph, the missing information is nested:Is there something I am missing here? This application reads json+ld found in the wild, so I can't control the input, but is there be some reliable way to massage the input so that it would work with the rdflib parser?
The json+ld works fine for Google