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

Rules for dropping free-floating values in Expansion Algorithm #496

Open kal opened 4 years ago

kal commented 4 years ago

The wording of step 19.1 is:

If result is a map which is empty, or contains only the entries @value or @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?

gkellogg commented 4 years ago

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.

gkellogg commented 1 year ago

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 @value or @list (with the possible addition of @type, @language, or @index, as appropriate) set result to null.

gkellogg commented 1 year ago

@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.

pchampin commented 1 year ago

@gkellogg agreed

gkellogg commented 1 year ago

@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.