-
Notifications
You must be signed in to change notification settings - Fork 23
Support recursive @list usage #36
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
Comments
I'm actively working on tests and algorithms to support this now; compaction and expansion are reasonably easy. A review of Flattening shows some errors in that algorithm, and potentially missing tests. Biggest changes will be to the FromRDF algorithm, as the list support there is complicated already. |
…tion, flattening and to/from RDF conversion. Also adds tests. For w3c/json-ld-syntax#36.
There are numerous tests in the API PR w3c/json-ld-api#16 that show how this looks. Compacted list containing embedded lists, simply continues to expand embedded arrays: {
"@context": {"foo": {"@id": "http://example.com/foo", "@container": "@list"}},
"foo": [["baz"]]
} expands to [{
"http://example.com/foo": [{"@list": [{"@list": [{"@value": "baz"}]}]}]
}] which is equivalent to the following Turtle [<http://example.com/foo> (("baz"))] . Algorithms support arbitrary depth and mixed elements. |
I do not have any problem having this but I think the syntax document should include some explicit statements and examples for the case of lists of lists. It is not clear from the text in the syntax document whether the syntax above is permitted or not... |
I started with the API, to make sure I had a solution that worked. I still need to update the syntax document for grammar, explanation and examples, which I’ll do presently. |
Given this issue is syntax, and we agreed to include it in the syntax, flagging as editorial and removing needs discussion. |
…tion, flattening and to/from RDF conversion. Also adds tests. For w3c/json-ld-syntax#36.
From Should we support lists of lists?
We did not support recursive RDF lists in 1.0 due to perceived complexity and lack of a use case. Since then there are numerous use cases that can make use of recursive lists in JSON-LD, and it goes further towards full idiomatic support of RDF 1.1 in JSON-LD.
Changes to the syntax document are minimal, there are substantial API implications.
The text was updated successfully, but these errors were encountered: