JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding
linked data
In computing, linked data (often capitalized as Linked Data) is structured data which is interlinked with other data so it becomes more useful through semantic queries. It builds upon standard Web technologies such as HTTP, RDF and URIs, but r ...
using
JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
. 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 metaphysics, ontology is the philosophical study of being, as well as related concepts such as existence, becoming, and reality.
Ontology addresses questions like how entities are grouped into categories and which of these entities exis ...
. 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
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
Link
header).
Example
The example above describes a person, based on the
FOAF (friend of a friend) ontology. First, the two JSON properties
name
and
homepage
and the type
Person
are mapped to concepts in the FOAF vocabulary and the value of the
homepage
property is specified to be of the type
@id
. In other words, the homepage id is specified to be an
IRI
IRI or I.R.I. refers to:
Businesses and organizations
* Iringa Airport, an airport in Tanzania serving Iringa and the surrounding Iringa Region by IATA airport code
* India Rejuvenation Initiative, an Indian anti-corruption organization forme ...
in the context definition. Based on the RDF model, this allows the person described in the document to be unambiguously identified by an
IRI
IRI or I.R.I. refers to:
Businesses and organizations
* Iringa Airport, an airport in Tanzania serving Iringa and the surrounding Iringa Region by IATA airport code
* India Rejuvenation Initiative, an Indian anti-corruption organization forme ...
. 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 (
@type
) 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
Schema.org is a reference website that publishes documentation and guidelines for using structured data mark-up on web-pages (called microdata). Its main objective is to standardize HTML tags to be used by webmasters for creating rich results (di ...
,
Google Knowledge Graph
The Google Knowledge Graph is a knowledge base from which Google serves relevant information in an infobox beside its search results. This allows the user to see the answer in a glance. The data is generated automatically from a variety of so ...
, and used mostly for
search engine optimization
Search engine optimization (SEO) is the process of improving the quality and quantity of Web traffic, website traffic to a website or a web page from web search engine, search engines. SEO targets unpaid traffic (known as "natural" or "Organ ...
activities. It has also been used for applications such as
biomedical informatics
Health informatics is the field of science and engineering that aims at developing methods and technologies for the acquisition, processing, and study of patient data, which can come from different sources and modalities, such as electronic hea ...
, and representing
provenance
Provenance (from the French ''provenir'', 'to come from/forth') is the chronology of the ownership, custody or location of a historical object. The term was originally mostly used in relation to works of art but is now used in similar senses i ...
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
ActivityPub is an open, decentralized social networking protocol based on Pump.io's ActivityPump protocol. It provides a client/server API for creating, updating, and deleting content, as well as a federated server-to-server API for deliver ...
, 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.
See also
*
Hypertext Application Language
Hypertext Application Language (HAL) is an Internet Draft (a "work in progress") standard convention for defining hypermedia such as links to external resources within JSON or XML code (however, the latest version of HAL Internet-Draft expired on ...
JSON Graph Format
References
External links
JSON-LD.org
{{W3C standards
Resource Description Framework
Data serialization formats
Markup languages
JSON
Semantic Web