Current Slide

Small screen detected. You are viewing the mobile version of SlideWiki. If you wish to edit slides you will need to use a larger device.

JSON-LD Contexts

  • @context is a special keyword to make explicit the semantic context in which some JSON data is communicated.
  • The context includes, e.g., name-to-IRI mappings.
  • The @id keyword assigns IRIs to things.
{ "@context":
  { "name": "http://schema.org/name",
    "born": { "@id": "http://schema.org/birthDate",
              "@type": "http://www.w3.org/2001/XMLSchema#date" },
    "spouse": { "@id": "http://schema.org/spouse",
                "@type": "@id" } }
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon" }
  • Note that the remaining JSON remained unchanged.
  • It is possible to centralise context definitions in external locations and point to them:
{ "@context": "http://json-ld.org/contexts/person.jsonld",
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon", ... }

Content Tools

Sources

There are currently no sources for this slide.