challenge / use case
ResourceShapes already encode JSON-LD semantics — property IRIs (forward/reverse), @id/@type mappings, namespace prefixes, and language maps — but there's no built-in way to produce a JSON-LD @context object from a shape. Consumers needing JSON-LD interoperability must manually reconstruct context mappings, duplicating information already captured in the shape definition.
proposal
Add a function (e.g., context(shape: ResourceShape): object) that derives a JSON-LD 1.1 @context object from a ResourceShape, mapping:
- Property names to their forward/reverse IRIs
@id and @type entries
- Namespace prefixes
- Language maps (
@container: @language)
- Index maps (
@container: @index) for unions
alternatives
- Manual
@context construction alongside each shape definition (error-prone, duplicates information)
- External tooling to generate contexts from shape metadata (adds build complexity)
notes
The shape system already references JSON-LD 1.1 specs (§ 3.2, 3.3, 3.5, 4.6.1, 4.8, 9.8), so the mapping is well-defined.
challenge / use case
ResourceShapes already encode JSON-LD semantics — property IRIs (forward/reverse),
@id/@typemappings, namespace prefixes, and language maps — but there's no built-in way to produce a JSON-LD@contextobject from a shape. Consumers needing JSON-LD interoperability must manually reconstruct context mappings, duplicating information already captured in the shape definition.proposal
Add a function (e.g.,
context(shape: ResourceShape): object) that derives a JSON-LD 1.1@contextobject from a ResourceShape, mapping:@idand@typeentries@container: @language)@container: @index) for unionsalternatives
@contextconstruction alongside each shape definition (error-prone, duplicates information)notes
The shape system already references JSON-LD 1.1 specs (§ 3.2, 3.3, 3.5, 4.6.1, 4.8, 9.8), so the mapping is well-defined.