Skip to content

Included blocks + node identifier indexing #486

@trwnh

Description

@trwnh

From #19 (comment)

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"
}
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions