w3c / w3c/json-ld-syntax

Included blocks + node identifier indexing

Open
#486 0 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

From https://github.com/w3c/json-ld-syntax/issues/19#issuecomment-515636158

If we chose too, we could even allow a term definition aliasing @included that used @container: @id to get the form of an id map

did this never happen?

it looks like what made it into json-ld 1.1 is

"included": [{
    "@id": "enum:c6", "type": "Type", "label": "Classification 6"
  }, {
    "@id": "enum:s2", "type": "Service", "label": "Login Service"
  }]

but i can't seem to get this to work in the json-ld playground:

"included": {
    "enum:c6": {"type": "Type", "label": "Classification 6"},
    "enum:s2": {"type": "Service", "label": "Login Service"}
  }

for context, i am working with some JSON data and trying to write a JSON-LD context for it using both @included and @container: @id:

{
  "@context": {
    "ns1": "https://namespace.example/",
    "id": "@id",
    "refersTo": {
      "@id": "ns1:refersTo",
      "@type": "@id"
    },
    "included": {
      "@id": "@included",
      "@container": "@id"  // this part only works if i change the @id to something else, which changes the semantics
    }
  },
  "id": "foo",
  "refersTo": ["bar", "baz"]
  "included": {
    "bar": {
      "//": "statements about bar go here; bar is the subject of all triples"
    },
    "baz": {
      "//": "statements about baz go here; baz is the subject of all triples"
    }
  }
}

currently i have to go through an annoying pre-processsing phase before i can do any jsonld processing; this phase involves converting the map to an array, purely to please the jsonld processor:

"included": [
{
  "id": "bar",
  "//": "statements about bar go here; bar is the subject of all triples"
},
{
  "id": "baz":,
  "//": "statements about baz go here; baz is the subject of all triples"
}
]

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

Start with the JSON-LD 1.1 syntax and the JSON-LD playground examples in the issue, comparing the array form of @included with the proposed @container: @id map form. Determine whether the map form is intended to be supported and document the expected behavior or specification change; completion should clarify the normative syntax and its processing result.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.