w3c / w3c/json-ld-syntax

[Question] How to do an array of arrays in a JSON-LD @context

Open
#414 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
139
Forks
23
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the issue's three JSON-LD @context examples and the JSON-LD 1.1 specification, focusing on how nested arrays and @list are defined. Determine which form, if any, is valid and document the expected representation or clarify that the question needs maintainer guidance; no repository file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.