Skip to content

JSON-LD* thread #727

Open
Open
@gkellogg

Description

@gkellogg

Thinking about how RDF* might be expressed in JSON-LD. @pchampin and I came up with something last year at the W3C Data Workshop, but I can't seem to find right now. But, given that the point is the allow an RDF triple to be the subject (or object) of another triple, this might imply allowing a limited use of a node object as the value of @id.

Consider the canonical example from @hartig's position paper

<<:bob foaf:age 23>> ex:certainty 0.9 .

This might be rendered in JSON-LD as follows:

[{
  "@id": {
    "@id": "bob",
    "age": 23
  },
  "certainty": 0.9
}, {
  "@id": "bob",
  "name": "Bob"
}]

We currently don't allow an object as the value of @id (other than for a frame, where it's a wildcard), but this might be a reasonable extension, where the restriction would be that it can only define a single property value (with or without @id. Note that recursing on @id values is in-scope.

An alternative, using named graphs, would look like the following:

[{
  "@graph": {
    "@id": "bob",
    "age": 23,
  },
  "certainty": 0.9
}, {
  "@id": "bob",
  "name": "Bob"
}]

But, in this case, you'd need to overload the meaning of blank nodes, where the blank node which names the graph containing :bob foaf:age 23 identifies that statement so that it can be used as the subject of another statement.

Use in the object position is the same, but with an object just composed of {"@id": {...}}.

cc/ @danbri

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions