w3c / json-ld-api

JSON-LD 1.1 Processing Algorithms and API Specification
https://w3c.github.io/json-ld-api/
Other
76 stars 29 forks source link

Unused `@context` reference policy #615

Open filip26 opened 1 day ago

filip26 commented 1 day ago

Hi, I've noticed real world examples of JSON-LD documents declaring an array of context URIs from which some of those contexts are not effectively applicable, the terms are not present in the compacted JSON-LD. 

This is probably the result of blindly setting the @context URI array to all "variations" of a document. 

Extending the compaction algorithm of a new policy on how to proceed unused contexts (Warn|Drop|Keep)? could help with documents generated from RDF. 

Does there exist consensus on unused @context declared as dereferenceable URIs? A bad practice or OK? 

gkellogg commented 1 day ago

I think it’s akin to declaring prefixes which are unused, which is also a common practice. I don’t consider it a bug, although it might be nice to get some feedback that there a contexts which are unused, although this could be complicated due to the way in which contexts interact.

filip26 commented 1 day ago

I'm not sure it's an alike case, unused prefixes and unused @context. There is almost no work with unused prefixes, but you have to dereference and pre-process an unused @context no matter if it's later applied or not.

+1 to get feedback