w3c / json-ld-syntax

JSON-LD 1.1 Specification
https://w3c.github.io/json-ld-syntax/
Other
109 stars 38 forks source link

List of lists? #428

Open puckipedia opened 4 months ago

puckipedia commented 4 months ago

Section 4.3.1 of the JSON-LD 1.1 spec suggests that lists of lists are "fully supported", and this is also what the API implements. However, this section is non-normative, and what I believe to be the normative text for list objects and set objects suggests that it is, in fact, not possible to nest lists or sets in other lists or sets. What's going on here?

VladimirAlexiev commented 3 months ago

@puckipedia

puckipedia commented 3 months ago

No, it doesn't; as that bullet ("an array of zero or more of the above possibilities") allows the JSON-LD to contain both, say:

{
    "@list": "foo"
}

and

{
    "@list": ["bar", "baz"]
}

but, note the conspicuous lack of list objects and set objects that may be contained inside list and set objects. (and no, list and set objects aren't subsets of value ar node objects, I checked.) This also doesn't allow for arrays of arrays of e.g. value objects, as it says "of the above possibilities", which excludes itself.