json-ld-api
json-ld-api copied to clipboard
Rules for dropping free-floating values in Expansion Algorithm
The wording of step 19.1 is:
If result is a map which is empty, or contains only the entries
@valueor@list, set result to null.
That only indicates that only an untyped (string) literal or a list should be suppressed during expansion of a null or @graph active property. However the test suite indicates that this should also happen for language-tagged strings and for typed literals (which completely makes sense!).
Does that test at step 19.1 need to be broadened to include data-typed or language-tagged literals or have I missed something in the preceding part of the algorithm that would have caused the free-floating value to be dropped before step 19.1?
This should be read as if the result contains @value or @list, as it could indeed have both @value and @type or @language, and could also have @index.
This could be considered an erratum for 1.1.
Summary:
Step 19.1 of the Expansion Algorithm should be changed to the following:
19.1) If result is a map which is empty, or contains only the entries
@valueor@list(with the possible addition of@type,@language, or@index, as appropriate) set result tonull.
@pchampin It's questionable if this is really a normative change, as we've long held that the test results are what matters, and they remain unchanged. If considered editorial, we can actually update the ED.
@gkellogg agreed
@pchampin This came up in https://github.com/w3c/json-ld-api/issues/518#issuecomment-748567302 where @iherman made the case that such changes are, indeed, normative. I'll keep it as is.