[Question] How to do an array of arrays in a JSON-LD @context
Hi All
I need to create a context that models an array of arrays, and I was wondering how to do it.
Possibility 1: "tags": {"@container": "@list", "@type": "@list" }
{
"@context": {
"@version": 1.1,
"@vocab": "http://example.org/",
"tags": {
"@container": "@list",
"@type": "@list"
}
},
"tags": [
["A", "B", "C"],
["D", "E", "F"],
["G", "H", "I"]
]
}
Possibility 2: "tags": {"@container": "@list"}
{
"@context": {
"@vocab": "http://example.org/",
"tags": {"@container": "@list"}
},
"tags": [
["A", "B", "C"],
["D", "E", "F"],
["G", "H", "I"]
]
}
Possibility 3: Other (?)
Any help greatly appreciated
@melvincarvalho — Please return to your initial post, and code fence all the @blah entities, so those users are not spammed by comments on a thread they've not chosen to join...
That is, change
Possibility 1: "tags": {"@container": "@list", "@type": "@list" }
to
Possibility 1: `"tags": {"@container": "@list", "@type": "@list" }`
and
Possibility 2: tags": {"@container": "@list"}
to
Possibility 2: `"tags": {"@container": "@list"}`
(Note -- Your Possibility 2 also lacks an opening quote on tags", which I've included in my suggested change, above.)
@melvincarvalho Your Possibility 2 seems to work just fine. That models it as a list of lists. If you'd prefer to model them as a JSON array of JSON arrays, you can use {"@type": "@json"} instead.