json-ld-api icon indicating copy to clipboard operation
json-ld-api copied to clipboard

Rules for dropping free-floating values in Expansion Algorithm

Open kal opened this issue 5 years ago • 5 comments

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?

kal avatar Jun 15 '20 20:06 kal

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 avatar Jun 15 '20 21:06 gkellogg

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 avatar Oct 16 '22 20:10 gkellogg

@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 avatar Oct 16 '22 20:10 gkellogg

@gkellogg agreed

pchampin avatar Oct 18 '22 22:10 pchampin

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

gkellogg avatar Oct 18 '22 22:10 gkellogg