1

What does mean this statement in json-ld context?

{
  "@context": {
      "@version": 1.1,
      "id": "@id",
      "type": "@type"
  }
}

and

{ 
   "@context": {
       "id":   {"@type": "@id", "@id": "@id"},
       "type": {"@type": "@id", "@id": "@type"}
   }
}

I do not figure out that expression means what.

eastdino
  • 23
  • 3

1 Answers1

1

Json-Ld is designed to be interoperable with rdf. Therefore it introduces certain keywords marked with @. This keywords are needed to create rdf-statements from the json document.

A good starting point to get familar with the underlying concepts is to play around with the Json-Ld Playground. You will find some examples there. You can use the examples to create conversions from one format into another.

Getting rid of the '@'-character

Sometimes the '@'-character can become unhandy, e.g. when working with Javascript. In such situations it is possible to define an alias for an '@'-keyword. Like shown in your context:

{
  "@context": {
      "id": "@id",
      "type": "@type"
  }
}

By defining aliases for '@'-keywords the actual json document is easier to consume by non-rdf applications while it is still possible to process the data as rdf.

jschnasse
  • 8,526
  • 6
  • 32
  • 72