RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.13k stars 554 forks source link

Support out-of-band Context and embedded JSON-LD objects in parsing #1993

Open rob-metalinkage opened 2 years ago

rob-metalinkage commented 2 years ago

Two implementation patterns observed in the wild seem to be within fairly easy reach, possible addressed by pyld option proposed?

1: use of a header specifiying the context for plain JSON, or programatically binding a context to a JSON source during parsing.

2: parsing embedded JSON-LD objects within a plain JSON structure

(a nuanced approach would allow binding of contexts to specific objects rather than the entire JSON file - very useful for typical container patterns of no interest to the consumer of the contained objects)

rob-metalinkage commented 2 years ago

see #2010

rob-metalinkage commented 1 year ago

I've looked into PyLD and raised a question there to see whether this can be supported in general - it looks like it make be supported when accessing a remote URL and headers are set, generally we need to be able to do the same thing for any supported source.

see https://github.com/digitalbazaar/pyld/issues/166