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

expansion algorithm checking language map value against BCP47 #563

Open Johann150 opened 1 year ago

Johann150 commented 1 year ago

In the expansion algorithm, while processing language mappings in step 13.7 and substeps, a variable name seems to be swapped:

Step 13.7.4.2.3 says to check item as being well-formed accoding to BCP47. This implies that item is a language tag. However, it is defined in step 13.7.4.2 that item comes from the language value, i.e. the value which is mapped to a language tag, not the language tag itself. The language tag is actually in language, which should thus be checked instead of item.

I think <var>item</var> should be replaced with <var>language</var> on the following line:

https://github.com/w3c/json-ld-api/blob/9e5eae38b68656671dfc60042b98e1bffb45197a/index.html#L2882

gkellogg commented 1 year ago

Summary: in 13.7.4.2.3 the tex erroneously says "If item is neither @none nor well-formed according to section 2.2.9 of [BCP47]," It should be checking for "language" which is the intention of the algorithm step.

gkellogg commented 1 year ago

Thanks, @Johann150, good catch. It should how show up as an erratum.