JSON-LD

JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON. One goal for JSON-LD was to require as little effort as possible from developers to transform their existing JSON to JSON-LD. JSON-LD allows data to be serialized in a way that is similar to traditional JSON. It was initially developed by the JSON for Linking Data Community Group before being transferred to the RDF Working Group for review, improvement, and standardization, and is currently maintained by the JSON-LD Working Group. JSON-LD is a World Wide Web Consortium Recommendation.

Design
JSON-LD is designed around the concept of a "context" to provide additional mappings from JSON to an RDF model. The context links object properties in a JSON document to concepts in an ontology. In order to map the JSON-LD syntax to RDF, JSON-LD allows values to be coerced to a specified type or to be tagged with a language. A context can be embedded directly in a JSON-LD document or put into a separate file and referenced from different documents (from traditional JSON documents via an HTTP Link header).

Example
The example above describes a person, based on the FOAF (friend of a friend) ontology. First, the two JSON properties  and   and the type   are mapped to concepts in the FOAF vocabulary and the value of the   property is specified to be of the type. In other words, the homepage id is specified to be an IRI in the context definition. Based on the RDF model, this allows the person described in the document to be unambiguously identified by an IRI. The use of resolvable IRIs allows RDF documents containing more information to be transcluded which enables clients to discover new data by simply following those links; this principle is known as 'Follow Your Nose'.

By having all data semantically annotated as in the example, an RDF 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.

Use
The encoding is used by Schema.org, Google Knowledge Graph, and used mostly for search engine optimization activities. It has also been used for applications such as biomedical informatics, and representing provenance information. It is also the basis of Activity Streams, a format for "the exchange of information about potential and completed activities", and is used in ActivityPub, the federated social networking protocol. Additionally, it is used in the context of Internet of Things (IoT), where a Thing Description, which is a JSON-LD document, describes the network facing interfaces of IoT devices.