Skip to content
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

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

Open
melvincarvalho opened this issue May 4, 2023 · 3 comments
Open

Comments

@melvincarvalho
Copy link

melvincarvalho commented May 4, 2023

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

@TallTed

This comment was marked as resolved.

@Peeja
Copy link

Peeja commented Jun 4, 2023

@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.

@VladimirAlexiev
Copy link

Related: #428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants