@cwebber hi, I'm trying to implement the jsonld expansion algorithm (, But I'm having trouble understanding how {"": {"@list": "a"}} gets expanded to [{"": [{"@list": [{"@value": "a"}]}]}]

more specifically, why is @list associated to an array, and not the value object directly? When I expand {"@list": "a"}, I have to do 7.4.9 which gives me the value object. Then 7.4.12 associates that to @list, not an array.

@roptat It's been a while since I touched this but I'll attempt to respond.

What's the purpose of @list, as opposed to just an array? It distinguishes between an unordered set and an ordered collection. So ok... fine... so {"@list": ["a", "b", "c"]} should clearly indicate that it's a list as opposed to ["a", "b", "c"] is a set; got it.

But what should {"@list": "a"} do? There wasn't an array there. Effectively, json-ld says "guess that's a list of one item then" and expands that item.

Thanks for the help! I ended up adding a special case, even if it's not specifiied.

Inscrivez-vous pour prendre part à la conversation

Le réseau social de l'avenir : Pas d'annonces, pas de surveillance institutionnelle, conception éthique et décentralisation ! Possédez vos données avec Mastodon !