-
Notifications
You must be signed in to change notification settings - Fork 71
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
In which places is list ordering intended to be significant? #87
Comments
IMO same
…On Sat, Jun 24, 2017 at 8:46 PM jdougan ***@***.***> wrote:
eg. Is "*class*":["foo","bar"] supposed mean the same as "*class*":["bar","foo"]
?
Same thing for *entities*, *links*, *actions*, and *fields*.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#87>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAtrNpBF2_d5LmLA5OjYkkBbyazqSd0ks5sHdf7gaJpZM4OEgUm>
.
|
From Siren's perspective, there's no priority or significance to the array item position for strings in the Siren doesn't prescribe how clients should process classes; the spec only defines the semantic meaning. Your implementation gets to make the decision if it's significant. |
I'm not sure how to read that. Either the semantics are such that "class":["foo","bar"] has the same meaning as as "class":["bar","foo"] (collection interpreted as a Set), the semantics say they are not the same (interpreted as an Array), or order must be preserved because it could be important (which is a restricted version of the second). There are no other choices, at least if you care about interoperability. |
These are all deliberately outside the scope of the specification. Prior work in this space includes the If we look at SVG, the specification of the
The same is true for items in a Siren |
The W3C does put extra semantics beyond the encoding provided ones for their attributes in general and the class attribute is one of them. Specifically in HTML class, "duplicates are ignored", which appears to be a low-level processing instruction to me. This is the same kind of issue as ordering. Looking at that HTML spec text more closely regarding "set of space-separated tokens" referenced by the class attribute, they very carefully put ordered collection semantics around what is, in the XML model, a raw string. They also carefully defined unordered collection semantics for use elsewhere, as well as taking note that case-sensitivity will be defined elsewhere on a case-by-case basis. The SVG spec you reference is unfortunately less clear. However a quick glance shows "set of class names" which may imply duplicates are removed and possibly, if less likely, that order is unimportant. With a quick search, the string "sequence of" is used 21 times in that SVG doc, so it is far from imposssible they are making the distinction, but not conclusive. Looking at the current SVG2 draft to see if it is any clearer, they are deprecating the SVG class attribute in favour of the one on the more general Element, and make specific reference to the WHATWG HTML spec's definition of "set of space-separated tokens". I think you are misunderstanding the level of semantic clarification I'm trying to ask about. I am thinking about a low-ish level data model, suitable for mapping into and out of other encodings (without just pointlessly writing JSON in the other encoding) and for non-specialized tools for processing and generating Siren. I asked about class because it (incorrectly?) seemed like a simple place to start. I could have asked about class element duplication. I could have asked about ordering in the fields attribute. (For compatibiity with older HTML forms processing, it is probably useful to assume sequence matters there as it far too often does in real systems, under the terms of Postel's Law.) And, as I started this thread with, entities, links and actions are also where I am asking if the sequence is incidental to their representation, or core? |
eg. Is "class":["foo","bar"] supposed mean the same as "class":["bar","foo"] ?
Same thing for entities, links, actions, and fields.
The text was updated successfully, but these errors were encountered: