JSON-LD (JavaScript Object Notation for Linked Data) is a way of encoding linked data using JSON and of serializing data in a form similar to traditional JSON. It is designed to be easy to create by modifying existing JSON documents. It is a World Wide Web Consortium Recommendation, first developed by the JSON for Linking Data Community Group, then reviewed and standardized by the RDF Working Group, and now maintained by the JSON-LD Working Group.
Design and context
JSON-LD rests on the idea of a context, which maps JSON object properties to concepts in an ontology using the RDF model. To translate JSON-LD syntax into RDF, values can be coerced to a specified type or tagged with a language. A context may be embedded directly in a JSON-LD document or stored in a separate file and referenced from ordinary JSON documents through an HTTP Link header.
Example and linking
A typical example describes a person using the FOAF (friend of a friend) ontology. Properties such as name, homepage and the type Person are mapped to FOAF concepts, and the homepage value is declared as an IRI. This lets the person be identified unambiguously, and resolvable IRIs allow documents to link to further data, a principle known as Follow Your Nose. An RDF processor that understands FOAF can then recognize the person and which properties hold the name and homepage.
Uses
Schema.org and the Google Knowledge Graph use this encoding, which is mostly applied to search engine optimization. It has also been used in biomedical informatics and for representing provenance information. It underlies Activity Streams, a format for exchanging information about activities, and ActivityPub, a federated social networking protocol. In the Internet of Things, a Thing Description written in JSON-LD describes the network-facing interfaces of devices.