What is JSON-LD?

JSON-LD is a method of encoding (serializing), storing, and communicating Linked Data using JSON. JSON-LD requires a context to be defined that links elements of the document in a JSON document to concepts in the underlying ontology. The context can be embedded directly in a JSON-LD document or put into a separate linked resource.


  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "homepage": {
      "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage",
      "@type": "@id"
    "Person": "http://xmlns.com/foaf/0.1/Person"
  "@id": "https://me.example.com",
  "@type": "Person",
  "name": "John Smith",
  "homepage": "https://www.example.com/"

The example above describes a person, based on the FOAF vocabulary. First, the two JSON properties name and homepage and the type Person are mapped to concepts in the FOAF vocabulary.

By having all data semantically annotated as in the example, a structured data processor can identify that the document contains information about a person and if the processor understands the FOAF vocabulary, it can determine which properties specify the person’s name and homepage.

Linking JSON-LD documents

In the spirit of Linked Data, to be able to externally reference JSON-LD documents (as nodes in the Linked Data graph), it is important that they have an identifier (@id). For your JSON-LD document to be truly linked, other applications need to know its identifier. Dereferencing the identifier should result in a representation of that node on your website.

Cofactor provides a uniform identifier space for you to use. When you describe a particular entity in your JSON-LD document, you can use the associated Cofactor ID of that entity as an @id of the document. When someone else later uses the same Cofactor ID as a property value in their JSON-LD document, the two become semantically linked. When a third party dereferences the identifier, they get a representation of the original document (node).


The JSON-LD encoding is used by Schema.org and Google Knowledge Graph API. It is also commonly used by webmasters for search engine optimization.

Have feedback on this article? Let @g_11fhkb1_61 know.
Need help? Contact us.
See also: