w3c / json-ld-api

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

context overflow definition seems like it is off by 1 #576

Open dclements opened 10 months ago

dclements commented 10 months ago

The Context Overflow definition from the Context Processing Algorithm, 5.2.3 reads as follows:

If the number of entries in the remote contexts array exceeds a processor defined limit, a context overflow error has been detected and processing is aborted; otherwise, add context to remote contexts.

Technically what this would seem to mean is that if your processor defined limit is 3 then:

In this edge case this could produce a valid resulting context that has a remote contexts array one larger than the processor defined limit.

It would seem that one of three things should happen here:

  1. Switch the order of the statements. Add context to remote contexts and then make the statement that "if the number of entries in the remote contexts array exceeds…"
  2. Change the language to be "equal to" instead of "exceeds." So it would now read "if the number of entries in the remote contexts array is equal to a processor defined limit…" This does not allow for duplicate entries in the array to be merged together if read strictly (and there is no indication of deduplication anywhere I can see in the description of remote contexts at this time)
  3. Define the size of the remote context array as having an event (possibly expressed somewhere else) that reads "if the size of the remote contexts array is ever made to be greater than a processor defined limit, then generate a context overflow error…"