Skip to content

change definition of rdf:JSON #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

pchampin
Copy link
Contributor

@pchampin pchampin commented Aug 7, 2025

to try and solve #116


Preview | Diff

@pfps
Copy link
Contributor

pfps commented Aug 7, 2025

Better would be

finite unordered maps from <a>strings</a> to values in the <a href="#JSON-value-space">value space</a>

with a note just after saying,

The finite unordered maps can be implemented as <a data-cite="INFRA#ordered-map">maps</a>
    from <a>strings</a> to values in the <a href="#JSON-value-space">value space</a>
where the key-value pairs are ordered by key (using <a data-cite="I18N-GLOSSARY#dfn-code-point" class="lint-ignore">Unicode code points</a> order).

This makes the definition correct with respect to JSON objects while retaining the potential use of INFRA.

@TallTed
Copy link
Member

TallTed commented Aug 8, 2025

@pfps — Can you make your comment(s) as a "suggested change" through the GitHub UI? It will be much easier to review the line(s) you're suggesting be added or changed, in the immediate context of the line(s) you're suggesting be changed or removed.

@pfps
Copy link
Contributor

pfps commented Aug 8, 2025

How can I make a suggested change to a place in the document that is not being changed?

@TallTed
Copy link
Member

TallTed commented Aug 8, 2025

"View the document" and click on the line number you want to discuss. Then ctrl-click on it. You'll get a menu of options, at least one of which should be relevant. (Probably you don't want to create a new issue, but you can just copy the link to the line, so we know what your suggested "Better would be" change should be applied to ... which is unknowable as things stand. )

Copy link
Member

@gkellogg gkellogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the small grammar change I suggested. I think @pfps suggestion is also useful to not completely throw people off who believe JSON objects are unordered.

spec/index.html Outdated
@@ -1931,6 +1902,9 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
</ul>
</dd>
</dl>
<p class="note">
The constraint to order map entries in the value space is only meant to make the order of object-member the lexical space irrelevant. In other word, it ensures that both lexical values <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code> are mapped to the same element of the value space. Implementations may omit to sort the entries, as long as they treat the maps in the value space as unordered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The constraint to order map entries in the value space is only meant to make the order of object-member the lexical space irrelevant. In other word, it ensures that both lexical values <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code> are mapped to the same element of the value space. Implementations may omit to sort the entries, as long as they treat the maps in the value space as unordered.
The constraint to order map entries in the value space is only meant to make the order of map entries in the lexical space irrelevant. In other words, it ensures that both lexical values <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code> are mapped to the same element of the value space. Implementations may omit to sort the entries, as long as they treat the maps in the value space as unordered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lexical space is made of strings, not of maps... So technically, there are no map entries in the lexical space. "object member" refers to the terms in the JSON grammar, and therefore is more appropriate for talking about the lexical space.

Copy link
Contributor Author

@pchampin pchampin Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from that, "object-member" should have been plural, and indeed "word" as well... This is fixed in 215a18e .

pchampin and others added 2 commits August 11, 2025 10:10
@pchampin pchampin requested a review from gkellogg August 11, 2025 08:45
Co-authored-by: Peter F. Patel-Schneider <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants