-
Notifications
You must be signed in to change notification settings - Fork 63
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
Array of Forms ordering #1188
Comments
As an aside comment, when a TD containing an array is translated into RDF such array becomes an object property which cardinality is not known beforehand (it should be specified in the ontology code and validated with a shacl shape). In addition, since it is translated into an object property the different resources in the range of such property are unsorted. As a result, if an array is translated into RDF and back the second array will contain the same elements than the former but not necessarily in the same order. On the other hand, if the arrays must retain their order then they should be translated as rdfs:List instead of object properties. Otherwise there is no way to know their order in the translation back from RDF to JSON-LD framed. |
I think that So to wrap up in my opinion it makes sense to maintain the order and change from |
Ok, however if the order is maintained, and thus marked as |
@vcharpenay would be this ok to change @set to @list ? |
We discussed this further in discovery while trying to wrap up #1981 and we really really really want arrays to be ordered. Also, it's a requirement of TD processors in order to support canonicalization now, but if arrays are treated as sets any RDF processor will break canonicalization (and therefore signing, etc.) So... PLEASE change |
Note this should apply to ALL arrays, not just Forms. This includes things like the "security" field, etc. Basically, don't use |
Closing this as part of canonicalization issues. They will be reconsidered in 2.0 by searching for the label |
The spec is vague on the ordering of forms Arrays. The context sets
"@container": "@set"
which indicates that the array is "unordered set of data", but this is hard to know without looking at the context and being able to understand it.Why is it unordered? Isn't it better to set
"@container": "@list"
and maintain the order? Otherwise a triple-store may return the array in a different order. This would disallow picking the right form by index and requires a lookup every time (see #877). It also makes canonicalization and implementation testing much harder.From https://w3c.github.io/wot-thing-description/#canonicalization-serialization-json
From https://w3c.github.io/wot-thing-description/#preliminary-definitions
From https://w3c.github.io/wot-thing-description/#sec-td-serialization
The text was updated successfully, but these errors were encountered: