W3C

JSON-LD Syntax 1.0

A Context-based JSON JSON-based Serialization for Linking Linked Data

W3C Last Call Working Draft 12 July 2012 11 April 2013

This version:
http://www.w3.org/TR/2012/WD-json-ld-syntax-20120712/ http://www.w3.org/TR/2013/WD-json-ld-20130411/
Latest published version:
http://www.w3.org/TR/json-ld-syntax/ http://www.w3.org/TR/json-ld/
Latest editor's draft:
http://dvcs.w3.org/hg/json-ld/raw-file/default/spec/latest/json-ld-syntax/index.html http://dvcs.w3.org/hg/json-ld/raw-file/default/spec/latest/json-ld/index.html
Previous version:
http://www.w3.org/TR/2012/WD-json-ld-20120712/
Editors:
Manu Sporny , Digital Bazaar
Gregg Kellogg , Kellogg Associates
Markus Lanthaler , Graz University of Technology
Authors:
Manu Sporny , Digital Bazaar
Dave Longley , Digital Bazaar
Gregg Kellogg , Kellogg Associates
Markus Lanthaler , Graz University of Technology
Mark Birbeck , Sidewinder Labs Niklas Lindström

This document is also available in this non-normative format: diff to previous version


Abstract

JSON has proven to be a highly useful object serialization and messaging format. In an attempt This specification defines JSON-LD, a JSON-based format to harmonize the representation of serialize Linked Data in Data. The syntax is designed to not disturb already deployed systems running on JSON, this specification outlines but provide a common smooth upgrade path from JSON representation format for expressing directed graphs; mixing both to JSON-LD. It is primarily intended to be a way to use Linked Data in Web-based programming environments, to build interoperable Web services, and non-Linked to store Linked Data in a single document. JSON-based storage engines.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document has been under development for over 18 25 months in the JSON for Linking Data Community Group. The document has recently been transferred to the RDF Working Group for review, improvement, and publication along the Recommendation track. While this is a First Public Working Draft publication, the publication. The specification has undergone significant development, review, and changes during the course of the last 18 months and is more mature than the First Public Working Draft status implies. 25 months. There are currently several independent five interoperable implementations of this specification. There is specification and a fairly complete test suite and a live JSON-LD editor that is capable of demonstrating the features described in this document. While development on implementations, the test suite and the live editor will continue, they are believed to be mature enough to be integrated into a non-production system at this point in time with the expectation that they could be used in a production system within the next year. There are a number of ways that one may participate in the development of this specification: If you want to make sure that your feedback is formally addressed by the RDF Working Group, you should send it to public-rdf-comments: public-rdf-comments@w3.org Ad-hoc technical discussion primarily occurs on the public community mailing list: public-linked-json@w3.org [ Public JSON-LD Community Group teleconferences are held on Tuesdays at 1500UTC every week. RDF Working Group teleconferences are held on Wednesdays at 1500UTC every week. Participation is limited to RDF Working Group members. Specification bugs and issues should be reported in the issue tracker JSON-LD-TESTS if you do not want to send an e-mail to the public-rdf-comments mailing list. Source code for the specification can be found on Github. The #json-ld IRC channel is available for real-time discussion on irc.freenode.net. ].

This document was published by the RDF Working Group as a First Public Last Call Working Draft. This document is intended to become a W3C Recommendation. If you wish to make comments regarding this document, please send them to public-rdf-comments@w3.org ( subscribe , archives ). The Last Call period ends 11 May 2013. All feedback is comments are welcome.

The Working Group welcomes reports of implementations, sent to the comments address. If we gather sufficient evidence of interoperable implementations, the group may request to skip Call for Implementations (Candidate Recommendation) drafts and have the next round of publications be Proposed Recommendations.

Publication as a Last Call Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This is a Last Call Working Draft and thus the Working Group has determined that this document has satisfied the relevant technical requirements and is sufficiently stable to advance through the Technical Recommendation process.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy . W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy .

Table of Contents

1. Introduction

This section is non-normative.

JSON, as specified in [ RFC4627 ], is a simple language for representing data on the Web. Linked Data is a technique for creating a network of inter-connected data across different Web documents and Web sites. A document in this data network is typically identified using an In general, Linked Data has four properties: 1) it uses IRI IRIs (Internationalized Resource Identifier). A software program can typically follow an IRI just like you follow a URL by putting to name things; 2) it into your browser's location bar. By following IRIs, a software program can find uses HTTP IRIs for those names; 3) the name IRIs , when dereferenced, provide more information about the document thing; and 4) the thing s that the document describes. data expresses links to data on other Web sites. These things may also be identified using IRI s. The IRI allows a software program properties allow data published on the Web to work much like Web pages do today. One can start at one document piece of Linked Data, and follow the links to other documents or things in order to learn more about all pieces of the documents and things described data that are hosted on different sites across the Web.

JSON-LD is designed as a lightweight syntax that can to serialize Linked Data in JSON [ RFC4627 ]. Its design allows existing JSON to be used transformed to express Linked Data . It with minimal changes. JSON-LD is primarily intended to be a way to use Linked Data in Javascript and other Web-based programming environments. It is also useful when building inter-operable environments, to build interoperable Web services services, and when storing to store Linked Data in JSON-based document storage engines. It Since JSON-LD is practical and designed to be as simple as possible, utilizing 100% compatible with JSON, the large number of JSON parsers and libraries available today. today can be reused. In addition to all the features JSON provides, JSON-LD introduces:

The syntax does not necessarily require applications

Developers that require any of the facilities listed above or need to easily add meaning by simply adding serialize an RDF graph or referencing dataset [ RDF11-CONCEPTS ] in a context. JSON-based syntax will find JSON-LD of interest. The syntax is designed to not disturb already deployed systems running on JSON, but provide a smooth upgrade path from JSON to JSON-LD. Finally, Since the format is intended to be easy to parse, efficient shape of such data varies wildly, JSON-LD features mechanisms to generate, and only requires reshape documents into a very small memory footprint in order to operate. deterministic structure which simplifies their processing.

1.1 How to Read this Document

This section is non-normative.

This document is a detailed specification for a serialization of Linked Data in JSON. The document is primarily intended for the following audiences:

This specification does not describe the programming interfaces for A companion document, the JSON-LD Syntax. The Processing Algorithms and API specification that describes the programming interfaces for JSON-LD documents is the JSON-LD Application Programming Interface [ JSON-LD-API ]. ], specifies how to work with JSON-LD at a higher level by providing a standard library interface for common JSON-LD operations.

To understand the basics in this specification you must first be familiar with JSON, which is detailed in [ RFC4627 ].

JSON [ RFC4627 ] defines several terms which are used throughout this document: JSON object An object structure is represented as a pair of curly brackets surrounding zero or more name-value pairs. A name is a string . A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object should be unique. array In JSON, an array is an ordered sequence of zero or more values. An array is represented as square brackets surrounding zero or more values that are separated by commas. While JSON-LD uses the same array representation as JSON, the collection is unordered by default. While order is preserved in regular JSON arrays, it is not in regular JSON-LD arrays unless specific markup is provided (see Sets and Lists ). string A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes (if necessary). A character is represented as a single character string. number A number is similar to that used in most programming languages, except that the octal and hexadecimal formats are not used and that leading zeros are not allowed. true and false Values that are used to express one of two possible boolean states. null The null value is used to make the JSON-LD processor "forget" any previously defined JSON key that is associated with the null value. If a previous definition doesn't exist, the entire key-value is ignored. If a previous definition of the key does exist, the previous definition is undefined. subject definition A JSON object used to represent a subject and one or more properties of that subject. A JSON object is a subject definition if it does not contain they keys @value , @list or @set and it has one or more keys other than @id . subject reference A JSON object used to reference a subject having only the @id key.

2. Design Goals and Rationale

This section is non-normative.

A number of design goals were established before JSON-LD satisfies the creation of this markup language: following design goals:

Simplicity
No extra processors or software libraries should be necessary to use JSON-LD in its most basic form. The language will provide developers with a very easy learning curve. Developers need only need to know JSON and two keywords ( @context and @id ) to use the basic functionality in JSON-LD.
Compatibility
The A JSON-LD markup document must be 100% compatible with JSON. This ensures that all of the standard JSON libraries work seamlessly with JSON-LD documents.
Expressiveness
The syntax must be able to express serialize directed graphs, which have been proven to be able to express graphs. This ensures that almost every real world data model. model can be expressed.
Terseness
The JSON-LD syntax must be very terse and human readable, requiring as little effort as possible from the developer.
Zero Edits, most of the time
JSON-LD must provide a mechanism that allows developers make the transition to specify context JSON-LD as simple as possible. In many cases, zero edits to the JSON document and the addition of one line to the HTTP response should suffice (see section 6.8 Interpreting JSON as JSON-LD in a way that is out-of-band. ). This allows organizations that have already deployed large JSON-based infrastructure to add meaning to their JSON documents use JSON-LD's features in a way that is not disruptive to their day-to-day operations and is transparent to their current customers. At times, However, there are times where mapping JSON to a graph representation can become difficult. is more complex than a simple one-line change. In these instances, rather than having extending JSON-LD to support an esoteric use case, we chose not to support the use case and support a simplified syntax instead. So, while case. While Zero Edits is a design goal, it is not always possible without adding great complexity to the language. One-pass Processing JSON-LD supports one-pass processing, which results in a very small memory footprint We should focus on simplicity when processing documents. For example, to expand a JSON-LD document from a compacted form, only one pass is required over the data. possible.

3. Basic Concepts Terminology

This section is normative. JSON-LD is designed to ensure that Linked Data concepts can be marked up in a way that is simple to understand and create by Web authors. In many cases, regular JSON markup can become Linked Data with the simple addition of a context . As more JSON-LD features are used, more semantics are added to the JSON markup.

3.1 Linking Data General Terminology

The following definition for Linked Data is This document uses the one that will be used for this specification. Linked Data is a set of documents, each containing a representation of a linked data graph . A linked data graph is an unordered labeled directed graph, where nodes are subject s or object s, and edges are labeled using properties . A subject is any node following terms as defined in a linked data graph with at least one outgoing edge. A subject should be labeled with an JSON [ IRI RFC4627 (an Internationalized Resource Identifier as described ]. Refer to the JSON Grammar section in [ RFC3987 RFC4627 ]). An ] for formal definitions.

JSON object is a node in a linked data graph with at least one incoming edge. An object may be labeled with an IRI
or a label that
An object structure is not an IRI such represented as plain text, internationalized text, or a strictly-typed data value. A node may be a subject and an object at the same time. pair of curly brackets surrounding zero or more key-value pairs. A property key is the label on an edge in a linked data graph string . A property should be an IRI . An IRI that is single colon comes after each key, separating the key from the value. A single comma separates a label in value from a linked data graph should be dereferencable following key. In contrast to a Linked Data document describing JSON, in JSON-LD the labeled subject , property or keys in an object . Issue 1 must be unique.
array
An illustration array structure is represented as square brackets surrounding zero or more values. Values are separated by commas. In JSON, an array is an ordered sequence of a linked data graph would probably help here. Issue 2 EricP suggests that zero or more values. While JSON-LD uses the definitions of subject same array representation as JSON, the collection is unordered by default. While order is preserved in regular JSON arrays, it is not in regular JSON-LD arrays unless specifically defined (see section 6.11 Sets and object, while being practical, are at odds with [ RDF-CONCEPTS Lists ).
] use in their roles within a triple. string
Note
A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes (if necessary).
number JSON-LD allows properties to be BNodes, while RDF does not. When used as just JSON-LD, this
A number is not unreasonable; it only becomes an issue (and could raise an exception) when transformed similar to RDF. Note that the definition for Linked Data above is silent on the topic of unlabeled nodes . Nevertheless, this specification allows for the expression of unlabeled nodes , as used in most graph-based data sets on the Web contain a number of associated nodes programming languages, except that the octal and hexadecimal formats are not named used and thus leading zeros are not directly de-referenceable. JSON-LD defines a mechanism to map JSON terms, i.e., keys allowed.
true and values, to IRIs. This does not mean false
Values that JSON-LD requires every key are used to express one of two possible boolean states.
null
The null value, which is typically used to clear or forget data. For example, A key-value pair in the @context where the value to be is null explicitly decouples a term 's association with an IRI , but rather ensures that keys and values can be mapped to IRIs if the developer desires to transform their data into Linked Data . There are a few techniques that can ensure that developers will generate good Linked Data for A key-value pair in the Web. body of a JSON-LD formalizes those techniques. We will be using document whose value is null has the following JSON markup same meaning as if the example for key-value pair was not defined. If @value , @list , or @set is set to null in expanded form, then the rest of this section: { "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "depiction": "http://twitter.com/account/profile_image/manusporny" } entire JSON object is ignored.

3.1.1 3.2 Syntax Tokens and Keywords

JSON-LD specifies a number of syntax tokens and keywords that are a core part of the language:

@context
Used to define the short-hand names that are used throughout a JSON-LD document. These short-hand names are called term terms s and help developers to express specific identifiers in a compact manner. The @context keyword is described in detail in the section titled 5.1 The Context .
@graph Used to explicitly label a linked data graph . This keyword is described in the section titled Named Graphs . @id
Used to uniquely identify things that are being described in the document. This keyword is described in the section titled Identifying the Subject 5.3 Node Identifiers .
@value
Used to specify the data that is associated with a particular property in the graph. This keyword is described in the sections titled section 6.9 String Internationalization and section 6.4 Typed Values .
@language
Used to specify the native natural (human) language for a particular value or the default language of a JSON-LD document. This keyword is described in the section titled 6.9 String Internationalization .
@type
Used to set the data type of a subject node or typed value . This keyword is described in the section titled 6.4 Typed Values .
@container
Used to set the default container of type for a particular value. term . This keyword is described in the section titled 6.11 Sets and Lists .
@list
Used to express an ordered set of data. This keyword is described in the section titled 6.11 Sets and Lists .
@set
Used to express an unordered set of data. data and to ensure that values are always represented as arrays. This keyword is described in the section titled 6.11 Sets and Lists .
@reverse
Used to express reverse properties. This keyword is described in section 6.12 Reverse Properties .
@index
Used to specify that a container is used to index information and that processing should continue deeper into a JSON data structure. This keyword is described in section 6.16 Data Indexing .
@base
Used to set the base IRI against which relative IRIs are resolved. This keyword is described in section 6.1 Base IRI .
@vocab
Used to expand properties and values in @type with a common prefix IRI . This keyword is described in section 6.2 Default Vocabulary .
@graph
Used to explicitly label a JSON-LD graph . This keyword is described in section 6.13 Named Graphs .
:
The separator for JSON keys and values that use compact IRIs .

For the avoidance of doubt, all All keys, keywords , and values in JSON-LD are case-sensitive.

3.1.2 4. The Context Conformance

In JSON-LD, a context This specification describes the conformance criteria for JSON-LD documents. This criteria is used relevant to map term authors and authoring tool implementers. As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

A JSON-LD document s, i.e., properties complies with associated values this specification if it follows the normative statements in an JSON document, to IRI s. A term is a short word that expands to an appendix IRI B. JSON-LD Grammar . Term s may JSON documents can be defined interpreted as any valid JSON-LD by following the normative statements in section 6.8 Interpreting JSON string other than a as JSON-LD keyword . To avoid forward-compatibility issues, term For convenience, normative statements for documents are often phrased as statements on the properties of the document.

The key words MUST , MUST NOT , REQUIRED , SHALL , SHALL NOT , SHOULD , SHOULD NOT , RECOMMENDED , NOT RECOMMENDED , MAY , and OPTIONAL in this specification have the meaning defined in [ RFC2119 s starting with an @ character should not ].

5. Basic Concepts

This section is non-normative. be used as they might be used as keywords

JSON [ RFC4627 in future versions of JSON-LD. ] is a lightweight, language-independent data-interchange format. It is easy to parse and easy to generate. However, it is difficult to integrate JSON from different sources as the data has just local meaning. Furthermore, JSON has no built-in support for hyperlinks - a fundamental building block on the use Web. Let's look at an example that we will be using for the rest of empty terms ( this section:

Example 1: Sample JSON document
{
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "image": "http://manu.sporny.org/images/manu.png"
}

It's obvious to humans that the data is about a person whose name is "Manu Sporny" and that the "" homepage ) property contains the URL of that person's homepage. A machine doesn't have such an intuitive understanding and sometimes, even for humans, it is discouraged as not all programming languages are able difficult to handle empty property names. resolve ambiguities in such representations. This problem can be solved by using unambiguous identifiers to denote the different concepts instead of tokens such as "name", "homepage", etc.

The Linked Data , and the Web in general, uses IRIs (Internationalized Resource Identifiers as described in [ RFC3987 ]) for unambiguous identification. The idea is that these term to assign IRIs s mean to something that may be of use to other developers and that it is useful to give them an unambiguous identifier. That is, it is useful for term terms s to expand to IRIs so that developers don't accidentally step on each other's vocabulary terms and other resources. terms. Furthermore, developers, developers and machines, machines are able to use this IRI (by plugging it directly into using a web browser, for instance) to go to the term and get a definition of what the term means. This mechanism is analogous to

Leveraging the way we can use WordNet today to see well-known schema.org vocabulary , the definition of words in example above could be unambiguously expressed as follows:

Example 2: Sample JSON-LD document using full IRIs instead of terms
{
  "http://schema.org/name": "Manu Sporny",
  "http://schema.org/url": { "@id": "http://manu.sporny.org/" },
  "http://schema.org/image": { "@id": "http://manu.sporny.org/images/manu.png" }
}

In the English language. Developers example above, every property is unambiguously identified by an IRI and machines need the same sort of definition of terms. all values representing IRIs provide a way to ensure that these terms are unambiguous. For example, explicitly marked as such by the term name @id may map directly to the IRI http://xmlns.com/foaf/0.1/name . This allows keyword . While this is a valid JSON-LD documents document that is very specific about its data, the document is also overly verbose and difficult to be constructed using work with for human developers. To address this issue, JSON-LD introduces the common JSON practice notion of simple name/value pairs while ensuring that a context as described in the data next section.

5.1 The Context

This section is useful outside of non-normative.

Simply speaking, a context is used to map terms to IRIs . Terms are case sensitive and any valid string that is not a reserved JSON-LD keyword can be used as a term .

For the page, API or database sample document in which it resides. The the previous section, a context would look something like this:

Example 3: Context for the sample document in the previous section
{  "@context":
  {
    "name": "http://schema.org/name",
    "image": {
      "@id": "http://schema.org/image",
      "@type": "@id"
    },
    "homepage": {
      "@id": "http://schema.org/url",
      "@type": "@id"
    }
  }
}

As the context above shows, the value of a term mapping must definition can either be either; 1) a simple string with string, mapping the lexical form of term to an absolute IRI or 2) compact IRI , or 3) an a JSON object .

When a JSON object containing is associated with a term, it is called an expanded term definition . The example above specifies that the values of @id , @type , @language , or image and @container homepage keyword (all other keywords terms are ignored by a JSON-LD processor). These Linked Data term IRIs . They also allow terms to be used for index maps s and to specify whether array values are typically collected in a context document that would look something like this: { "@context": { "name": "http://xmlns.com/foaf/0.1/name", "depiction": { "@id": "http://xmlns.com/foaf/0.1/depiction", "@type": "@id" }, "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" }, } } to be interpreted as sets or lists . Expanded term definitions may be defined using absolute or compact IRIs as keys, which is mainly used to associate type or language information with an absolute or compact IRI .

Contexts can either be directly embedded into the document or be referenced. Assuming that this the context document in the previous example can be retrieved at http://json-ld.org/contexts/person.jsonld , it can be referenced from a JSON-LD document by adding a single line. The JSON markup line and allows a JSON-LD document to be expressed much more concisely as shown in the previous section could be changed as follows: example below:

{
Example 4: Referencing a JSON-LD context
{
  "@context": "http://json-ld.org/contexts/person.jsonld",
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "depiction": "http://twitter.com/account/profile_image/manusporny"

  "image": "http://manu.sporny.org/images/manu.png"

}

The additions above transform the previous JSON document into a JSON document with added semantics because the @context referenced context not only specifies how the name , homepage , and depiction terms map to IRIs . Mapping those keys to IRIs gives in the data global context. If two developers use Schema.org vocabulary but also specifies that the same values of the homepage and image property can be interpreted as an IRI to describe a property, they are ( "@type": "@id" , see section 5.2 IRIs for more than likely expressing the same concept. details). This information allows both developers to re-use each others' other's data without having to agree to how their data will interoperate on a site-by-site basis. Contexts External JSON-LD context documents may also contain type extra information for certain located outside of the @context key, such as documentation about the term terms s as well as other processing instructions for declared in the document. Information contained outside of the @context value is ignored when the document is used as an external JSON-LD processor. context document.

Contexts may be specified in-line. This ensures that JSON-LD JSON documents can be processed when a transformed to JSON-LD processor does not have access without having to the Web. { "@context": { "name": "http://xmlns.com/foaf/0.1/name", "depiction": { "@id": "http://xmlns.com/foaf/0.1/depiction", "@type": "@id" }, "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" }, }, "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "depiction": "http://twitter.com/account/profile_image/manusporny" } Contexts may be used at any time modified by referencing a subject definition is defined. A subject definition may specify multiple contexts, using an array , which is processed in order. This is useful when an author would like to use an existing context and add application-specific terms to the existing context. Duplicate context term s must be overridden using a last-defined-overrides mechanism. Note If a term is re-defined within a context, all previous rules associated with the previous definition are removed. A term defined via an HTTP Link Header as described in a previous context must be removed, if it section 6.8 Interpreting JSON as JSON-LD . It is re-defined also possible to null . The set of contexts defined within apply a specific subject definition are referred to as local context s. Setting the context to null effectively sets the local context to the initial custom context (further explained in using the JSON-LD API, Appendix A, Initial Context API [ JSON-LD-API ] ). The active context refers to the accumulation of local context s that are in scope at a specific point within the document. The following example specifies an external context and then layers a local context on top of the external context: ].

{ "@context": [ "http://json-ld.org/contexts/person.jsonld", { "pic": "http://xmlns.com/foaf/0.1/depiction" } ], "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", } Note To ensure the best possible performance, it is a best practice to put the context definition at the top of the

In JSON-LD document. If it isn't listed first, processors have to save each key-value pair until the documents context contexts is processed. may also be specified in-line. This creates a memory and complexity burden for certain types of low-memory footprint JSON-LD processors. Note The null value is has the advantage that documents can be processed in a special way in JSON-LD. Unless otherwise specified, a JSON-LD processor must act as if a key-value pair even in the body absence of a JSON-LD document was never declared when the value equals null . If @value , @list , or @set is set to null in expanded form, then the entire JSON object is ignored. If @context is set connection to null , the active context is reset and when used within a context , it removes any definition associated with the key, unless otherwise specified. Web.

Example 5: In-line context definition
{
  "@context":
  {
    "name": "http://schema.org/name",
    "image": {
      "@id": "http://schema.org/image",
      "@type": "@id"
    },
    "homepage": {
      "@id": "http://schema.org/url",
      "@type": "@id"
    }
  },
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "image": "http://manu.sporny.org/images/manu.png"
}

3.1.3 5.2 From JSON to JSON-LD If a set of term s such as, name , homepage , and depiction , are defined in a context , and that context is used to resolve the names in JSON objects , machines are able to automatically expand the terms to something meaningful and unambiguous, like this: { "": "Manu Sporny", "": "http://manu.sporny.org" "": "http://twitter.com/account/profile_image/manusporny" } IRIs

Doing this allows JSON to be unambiguously machine-readable without requiring developers to drastically change their workflow. Note The example above does not use the @id keyword to set the subject of the node being described above. This type of node is called an unlabeled node . It is advised that all nodes described in JSON-LD are given unique identifiers via the @id keyword unless the data section is not intended to be linked to from other data sets. non-normative. A JSON object used to define property values is called a subject definition . Subject definitions do not require an @id . Subject definitions that do not contain an @id are known as an unlabeled nodes .

3.2 IRIs

IRIs (Internationalized Resource Identifiers [ IRI RFC3987 s ]) are fundamental to Linked Data as that is how most subject nodes s, all and properties and many object s are identified. IRI s can be expressed in a variety of different ways in JSON-LD. Except within a context definition, term s in the key position in a JSON object that have a mapping to an absolute IRI or another term in the active context are expanded to an IRI by JSON-LD processors. An IRI is generated for the string value specified using @id or @type . An IRI is generated for the string value of any key for which there are coercion rules in effect that identify the value as an @id . In JSON-LD, IRIs may be represented as an absolute IRI , a relative IRI , a term , or a compact relative IRI . An absolute IRI is defined in [ RFC3987 ] as containing a scheme along with path and optional query and fragment segments. A relative IRI is an IRI that is relative to some other absolute IRI . In JSON-LD all relative IRI IRIs s are resolved relative to the base IRI associated with the document (typically, document.

A string is interpreted as an IRI when it is the directory value of an @id member:

Example 6: Values of @id are interpreted as IRI
{
...
  "homepage": { "@id": "http://example.com/" }
...
}

Values that are interpreted as IRIs , can also be expressed as relative IRIs . For example, assuming that contains the following document or is located at http://example.com/about/ , the document itself). relative IRI ../ would expand to http://example.com/ (for more information on where relative IRIs can be used, please refer to appendix B. JSON-LD Grammar ).

Example 7: IRIs can be relative
{
...
  "homepage": { "@id": "../" }
...
}

Absolute IRIs can be expressed directly in the key position like so:

{
Example 8: IRI as a key
{
...
  "": "Manu Sporny",

  "http://schema.org/name": "Manu Sporny",

...
}

In the example above, the key http://xmlns.com/foaf/0.1/name http://schema.org/name is interpreted as an absolute IRI because it contains a colon ( : ) and the 'http' prefix does not exist in the context. Term expansion occurs for IRIs if the value matches a term defined within the active context : { "": { "" ... }, "": "Manu Sporny", "status": "trollin'", ... } Term s are case sensitive, and must be matched using it is neither a case-sensitive comparison. JSON keys that do not expand to an absolute compact IRI are ignored, or removed in some cases, by the [ JSON-LD-API ]. However, JSON keys that do not include nor a mapping in the context are still considered valid expressions in JSON-LD documents - the keys just don't have any machine-readable, semantic meaning. blank node identifier .

Prefix es are expanded when the form of the value is a compact Term-to- IRI represented as a prefix:suffix combination, and expansion occurs if the prefix key matches a term defined within the active context :

{
Example 9: Term expansion from context definition
{
  "@context":
  {
    ""
...

    "name": "http://schema.org/name"

  },
  "": "Manu Sporny",
...

  "name": "Manu Sporny",
  "status": "trollin'"

}

foaf:name above will automatically expand out to the IRI http://xmlns.com/foaf/0.1/name . See Compact IRIs for more details. An IRI is generated when a JSON object is used in the value position keys that contains an @id keyword: { ... "homepage": { "": "http://manu.sporny.org" } ... } Note Specifying a JSON object with an @id key is used do not expand to identify that object using an IRI . When the object has only the @id , it is called a subject reference . This facility may also be used to link to another subject definition using a mechanism called embedding , which is covered such as status in the section titled Embedding . example above, are not Linked Data and thus ignored when processed.

If type coercion rules are specified in the @context for a particular term or property IRI , an IRI is generated:

Example 10: Type coercion
{
  "@context":
  {
    ...
    "homepage":
    {
      "@id": "http://xmlns.com/foaf/0.1/homepage",

      "@id": "http://schema.org/homepage",

      "@type": "@id"
    }
    ...
  }
...
  "homepage": "http://manu.sporny.org/",
...
}

In the example above, even though the value http://manu.sporny.org/ is expressed as a JSON string , the type coercion rules will transform the value into an IRI when processed by a generating the JSON-LD Processor. graph . See section 6.5 Type Coercion for more details about this feature.

In summary, IRIs can be expressed in a variety of different ways in JSON-LD:

  1. JSON object keys that have a term mapping in the active context expand to an IRI (only applies outside of the context definition ).
  2. An IRI is generated for the string value specified using @id or @type .
  3. An IRI is generated for the string value of any key for which there are coercion rules that contain a @type key that is set to a value of @id or @vocab .

3.3 5.3 Identifying the Subject Node Identifiers

This section is non-normative.

To be able to externally reference nodes in a graph, graph , it is important that each node has nodes have an unambiguous identifier. IRI IRIs s are a fundamental concept of Linked Data , and nodes should have a de-referencable identifier used to name and locate them. For for nodes to be truly linked, de-referencing dereferencing the identifier should result in a representation of that node (for example, using a URL to retrieve a web page). Associating an IRI with a node tells . This may allow an application that the returned document contains a description of the node requested. JSON-LD documents may also contain descriptions of other nodes, so it is necessary to be able to uniquely identify each retrieve further information about a node which may be externally referenced. .

A subject of In JSON-LD, a JSON object node is a node identified using the @id key. The subject is the first piece of information needed by the JSON-LD processor in order to create the (subject, property, object) tuple, also known as a triple. keyword :

{
Example 11: Identifying a node
{
  "@context":
  {
    ...
    "homepage":
    {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id"
    }
    ...

    "name": "http://schema.org/name"

  },
  "",
  "homepage": "http://manu.sporny.org/",
...

  "@id": "http://me.markus-lanthaler.com/",
  "name": "Markus Lanthaler",
  ...

}

The example above would set the subject to the IRI http://example.org/people#joebob . A JSON object used to define property values is called contains a subject definition . Subject definitions do not require an @id . A subject definition that does not contain an @id property defines properties of an unlabeled node . Note To ensure the best possible performance, when possible, it is a best practice to put JSON-LD keyword s, such as @id and @context before other key-value pairs in a JSON object . However, keys in a JSON object are not ordered, so processors must not depend on key ordering. If keywords are not listed first, processors have to save each key-value pair until at least the @context and identified by the IRI @id are processed. Not specifying those keywords first creates a memory and complexity burden for low-memory footprint processors, forcing them to use more memory and computing cycles than necessary. http://me.markus-lanthaler.com/ .

3.4 5.4 Specifying the Type

This section is non-normative.

The type of a particular subject node can be specified using the @type keyword . Specifying the type in this way will generate a triple of the form (subject, type, type- IRI ). To be considered In Linked Data , types must be are uniquely identified by with an IRI .

{
Example 12: Specifying the type for a node
{
...
  "@id": "http://example.org/people#joebob",
  "",

  "@id": "http://example.org/places#BrewEats",
  "@type": "http://schema.org/Restaurant",

...
}

A node can be assigned more than one type by using an array :

Example 13: Specifying multiple types for a node
{
...
  "@id": "http://example.org/places#BrewEats",
  "@type": [ "http://schema.org/Restaurant", "http://schema.org/Brewery" ],
...
}
3.5 String Internationalization

At times, it is important to annotate a string with its language. In JSON-LD this is possible in a variety The value of ways. Firstly, it is possible to define a default language for a JSON-LD document by setting the @language @type key in the @context or in may also be a term definition: defined in the active context :

{ "@context": {
Example 14: Using a term to specify the type
{
  "@context": {

    ...
    "@language": "ja"
  },
  "name": ,
  "occupation":

    "Restaurant": "http://schema.org/Restaurant", 
    "Brewery": "http://schema.org/Brewery"
  }
  "@id": "http://example.org/places#BrewEats",
  "@type": [ "Restaurant", "Brewery" ],
  ...

}

6. Advanced Concepts

The example JSON-LD has a number of features that provide functionality above would associate the ja language code with and beyond the two string s core functionality described above. The following section describes this advanced functionality in more detail.

6.1 Base IRI

花澄 This section is non-normative.

Feature at Risk 1 : @base keyword

Note: This feature is "at risk" and 科学者 . Languages must may be well-formed language tags according removed from this specification based on feedback. Please send feedback to [ BCP47 public-rdf-comments@w3.org . For the current status see features "at risk" in JSON-LD 1.0 ].

It is possible to override Support for the default language by using @base keyword might be removed from JSON-LD 1.0 if implementation experience reveals that the expanded form of fact that a value: { "@context": { ... "@language": "ja" }, "name": "花澄", "occupation": { "@value": "Scientist", "@language": "en" } } document may have multiple base IRIs is confusing for developers. It is also possible to override the default language or specify a plain value by omitting the being discussed whether relative IRIs are allowed as values of @language @base tag or setting it whether the empty string should be used to null explicitly specify that there isn't a base IRI , which could be used to ensure that relative IRIs remain relative when expressing the expanded value: expanding.

{ "@context": { ... "@language": "ja" }, "name": { "@value": "Frank" }, "occupation": { "@value": "Ninja", "@language": "en" }, "speciality": "手裏剣" }
Note

JSON-LD allows IRI Please note that language associations must only be applied to plain literal string s. That is, typed value s or values that are subject to type coercion won't be language tagged. To clear specified in a relative form which is resolved against the default language for document base according section 5.1 Establishing a subtree, @language can Base URI of [ RFC3986 ]. The base IRI may be explicitly set to null in with a local context as follows: using the @base keyword.

{

For example, if a JSON-LD document was retrieved from http://example.com/document.jsonld , relative IRIs would resolve against that IRI :

Example 15: Use a relative IRI as node identifier
{
  "@context": {
    ...
    "@language": "ja"

    "label": "http://www.w3.org/2000/01/rdf-schema#label"

  },
  "name": "花澄",
  "details": {
    "@context": {
      "@language": null
    },
    "occupation": "Ninja"
  }

  "@id": "",
  "label": "Just a simple document"

}
Note JSON-LD allows one to associate language information with term s. See Expanded Term Definition for more details. 3.6 JSON-LD Syntax

A JSON-LD This document uses an empty @id , which resolves to the document base. However, if the document is first, and foremost, moved to a JSON document (as defined in [ different location, the IRI RFC5988 would change. To prevent this without having to use an absolute IRI ]), and any syntactically correct JSON document must be processed by , a conforming JSON-LD processor. However, JSON-LD describes context may define a specific syntax @base mapping, to use for expressing Linked Data. This includes overwrite the use of specific keywords, as identified in Syntax Tokens and Keywords base IRI for expressing subject definitions , values, and the context . See Appendix A for authoring guidelines and a BNF description of JSON-LD. document.

Example 16: Setting the document base in a document
{
  "@context": {
    "@base": "http://example.com/document.jsonld"
  },
  "@id": "",
  "label": "Just a simple document"
}

4. 6.2 Advanced Concepts Default Vocabulary

This section is normative. non-normative. JSON-LD has a number of features that provide functionality above and beyond the core functionality described above. The following section describes this advanced functionality in more detail. 4.1 Compact IRIs

Term s in Linked Data documents may draw from a number of different vocabularies . At times, declaring every single term that a document uses can require all properties and types may come from the developer same vocabulary. JSON-LD's @vocab keyword allows an author to declare tens, if set a common prefix to be used for all properties and types that do not hundreds of potential vocabulary match a term s that and are used across neither a compact IRI nor an application. This is absolute IRI (i.e., they do not contain a concern for at least two reasons: the first colon).

Example 17: Using a common vocabulary prefix
{
  "@context": {
    "@vocab": "http://schema.org/"
  }
  "@id": "http://example.org/places#BrewEats",
  "@type": "Restaurant",
  "name": "Brew Eats"
  ...
}

If @vocab is used but certain keys in an object should not be expanded using the cognitive load on the developer of remembering all of the vocabulary IRI , a term s, and the second is the serialized size of can be explicitly set to null in the context if it is specified inline. In order to address these issues, . For instance, in the concept of a compact example below the databaseId member would not expand to an IRI .

Example 18: Using the null keyword to ignore data
{
  "@context":
  {
     "@vocab": "http://schema.org/",
     "databaseId": null
  },
    "@id": "http://example.org/places#BrewEats",
    "@type": "Restaurant",
    "name": "Brew Eats",
    "databaseId": "23987520"
}

6.3 Compact IRIs

This section is introduced. non-normative.

A compact IRI is a way of expressing an IRI using a prefix and suffix separated by a colon ( : ) which is similar to the CURIE Syntax in [ RDFA-CORE ]. ). The prefix is a term taken from the active context and is a short string identifying a particular IRI in a JSON-LD document. For example, the prefix foaf may be used as a short hand for the Friend-of-a-Friend vocabulary, which is identified using the IRI http://xmlns.com/foaf/0.1/ . A developer may append any of the FOAF vocabulary terms to the end of the prefix to specify a short-hand version of the absolute IRI for the vocabulary term. For example, foaf:name would be expanded out to the IRI http://xmlns.com/foaf/0.1/name . Instead of having

Example 19: Prefix expansion
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/"
...
  },
  "@type": "foaf:Person"
  "foaf:name": "Dave Longley",
...
}

In the example above, foaf:name expands to remember and type out the entire IRI , the developer can instead use the prefix in their JSON-LD markup. http://xmlns.com/foaf/0.1/name and foaf:Person expands to http://xmlns.com/foaf/0.1/Person .

Terms Prefixes are interpreted as expanded when the form of the value is a compact IRI s if they contain at least one colon and the first colon is not followed by two slashes ( // , represented as in a http://example.com prefix:suffix ). To generate the full IRI , combination, the value is first split into a prefix matches a term defined within the active context , and the suffix at the first occurrence of a colon does not begin with two slashes ( : // ). If the active context contains a term mapping for prefix , an The compact IRI is generated expanded by prepending concatenating the IRI mapped to the prefix to the (possibly empty) suffix using textual concatenation. . If no the prefix mapping is defined, not defined in the active context , or the suffix begins with two slashes (such as in http://example.com ), the value is interpreted as an absolute IRI . instead. If the prefix is an underscore ( _ ), the IRI remains unchanged. This effectively means that every term containing a colon will be value is interpreted by a JSON-LD processor as an IRI . Consider the following example: { "@context": { }, "@id": "http://example.org/library", "@type": , : { "@id": "http://example.org/library/the-republic", "@type": , : "Plato", : "The Republic", : { "@id": "http://example.org/library/the-republic#introduction", "@type": , : "An introductory chapter on The Republic.", : "The Introduction" } } } In this example, two different vocabularies blank node identifier are referred to using prefixes. Those prefixes are then used as type and property values using the compact IRI prefix:suffix notation. instead.

It's also possible to use compact IRIs within the context as shown in the following example:

{
Example 20: Using vocabularies
{
  "@context":
  {
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "foaf": "http://xmlns.com/foaf/0.1/",

    "foaf": "http://xmlns.com/foaf/0.1/",
    "foaf:homepage": { "@type": "@id" },
    "picture": { "@id": "foaf:depiction", "@type": "@id" }
  },
  "@id": "http://me.markus-lanthaler.com/",
  "@type": "foaf:Person",
  "foaf:name": "Markus Lanthaler",
  "foaf:homepage": "http://www.markus-lanthaler.com/",
  "picture": "http://twitter.com/account/profile_image/markuslanthaler"
}

4.2 6.4 Typed Values

This section is non-normative.

A value with an associated type, also known as a typed value , , is indicated by associating a value with an IRI which indicates the value's type. Typed values may be expressed in JSON-LD in two three ways:

  1. By utilizing the @type keyword when defining a term within a @context section.
  2. By utilizing the expanded form for specifying objects. a value object .
  3. By using a native JSON type such as number , true , or false .

The first example uses the @type keyword to associate a type with a particular term in the @context :

{
Example 21: Expanded term definition with type coercion
{
  "@context":
  {
    "modified":
    {
      "@id": "http://purl.org/dc/terms/modified",
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
    }
  },
...
  "@id": "http://example.com/docs/1",

  "modified": "2010-05-29T14:17:39+02:00",
...
}

The modified key's value above is automatically type coerced to a datetime dateTime value because of the information specified in the @context . A JSON-LD processor will interpret the example above as follows:

Subject Property Value Value Type
http://example.com/docs/1 http://purl.org/dc/terms/modified 2010-05-29T14:17:39+02:00 http://www.w3.org/2001/XMLSchema#dateTime

The second example uses the expanded form of setting the type information in the body of a JSON-LD document:

{
Example 22: Expanded value with type
{
  "@context":
  {
    "modified":
    {
      "@id": "http://purl.org/dc/terms/modified"
    }
  },
...
  "modified":
  {
    "@value": "2010-05-29T14:17:39+02:00",
    "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
  }
...
}

Both examples above would generate an object with the value of 2010-05-29T14:17:39+02:00 and with the type of http://www.w3.org/2001/XMLSchema#dateTime . Note that it is also possible to use a term or a compact IRI to express the value of a type.

Note

The @type keyword is also used to associate a type with a subject node . Although the same keyword is used in both places, the The concept of an object a node type and a value type are different. This

Generally speaking, a node type specifies the type of thing that is similar to object-oriented programming languages where both scalar and structured types being described, like a person, place, event, or web page. A value type specifies the data type of a particular value, such as an integer, a floating point number, or a date.

Example 23: Example demonstrating the context-sensitivity for @type
{
...
  "@id": "http://example.org/posts#TripToWestVirginia",
  "@type": "http://schema.org/BlogPosting",   <- This is a node type
  "modified":
  {
    "@value": "2010-05-29T14:17:39+02:00",
    "@type": "http://www.w3.org/2001/XMLSchema#dateTime" <- This is a value type
  }
...
}

The first use of @type associates a node type ( http://schema.org/BlogPosting ) with the same class inheritance mechanism, even though scalar types node , which is expressed using the @id keyword . The second use of @type associates a value type ( http://www.w3.org/2001/XMLSchema#dateTime ) with the value expressed using the @value keyword . As a general rule, when @value and structured types @type are inherently different. used in the same JSON object , the @type keyword is expressing a value type . Otherwise, the @type keyword is expressing a node type . The example above expresses the following data:

Subject Property Value Value Type
http://example.org/posts#TripToWestVirginia http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://schema.org/BlogPosting -
http://example.org/posts#TripToWestVirginia http://purl.org/dc/terms/modified 2010-05-29T14:17:39+02:00 http://www.w3.org/2001/XMLSchema#dateTime

4.3 6.5 External Contexts Type Coercion

Authors may choose This section is non-normative.

JSON-LD supports the coercion of values to declare particular data types. Type coercion allows someone deploying JSON-LD context s in external documents to promote re-use coerce the incoming or outgoing values to the proper data type based on a mapping of contexts as well as reduce data type IRIs to terms . Using type coercion, value representation is preserved without requiring the size data type to be specified with each piece of JSON-LD documents. data.

In order to use an external context, Type coercion is specified within an author must specify expanded term definition using the @type key. The value of this key expands to an IRI . Alternatively, the keywords @id or @vocab may be used as value to indicate that within the body of a valid JSON-LD document. The referenced document must have document, a top-level subject definition . The string value of any a term coerced to @context @id or @vocab key within that object is substituted for the to be interpreted as an IRI within . The difference between @id and @vocab is how values are expanded to absolute IRIs . @vocab first tries to expand the referencing document value by interpreting it as term . If no matching term is found in the active context , it tries to have expand it as compact IRI or absolute IRI if there's a colon in the same effect value; otherwise, it will expand the value using the active context's vocabulary mapping, if present, or by interpreting it as relative IRI . Values coerced to @id in contrast are expanded as compact IRI or absolute IRI if a colon is present; otherwise, they are interpreted as relative IRI .

Terms or compact IRIs used as the value were specified inline of a @type key may be defined within the referencing document. same context. This means that one may specify a term like xsd and then use xsd:integer within the same context definition.

The following example below demonstrates the use of an external context: how a JSON-LD author can coerce values to typed values and IRIs .

{ , "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "depiction": "http://twitter.com/account/profile_image/manusporny"
Example 24: Expanded term definition with types
{
  "@context":
  {
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "http://xmlns.com/foaf/0.1/name",
    "age":
    {
      "@id": "http://xmlns.com/foaf/0.1/age",
      "@type": "xsd:integer"
    },
    "homepage":
    {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id"
    }
  },
  "@id": "http://example.com/people#john",
  "name": "John Smith",
  "age": "41",
  "homepage":
  [
    "http://personal.example.org/",
    "http://work.example.com/jsmith/"
  ]

}

Authors The example shown above would generate the following data.

Subject Property Value Value Type
http://example.com/people#john http://xmlns.com/foaf/0.1/name John Smith
http://example.com/people#john http://xmlns.com/foaf/0.1/age 41 http://www.w3.org/2001/XMLSchema#integer
http://example.com/people#john http://xmlns.com/foaf/0.1/homepage http://personal.example.org/ IRI
http://work.example.com/jsmith/ IRI

Terms may also import multiple contexts be defined using absolute IRIs or compact IRIs . This allows coercion rules to be applied to keys which are not represented as a combination of external and local contexts by specifying a list of contexts: simple term . For example:

{ "@context": [ "http://json-ld.org/contexts/person.jsonld",
Example 25: Term definitions using compact and absolute IRIs
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "foaf:age":

    {
      "foaf": "http://xmlns.com/foaf/0.1/"

      "@id": "http://xmlns.com/foaf/0.1/age",
      "@type": "xsd:integer"

    },
    "http://json-ld.org/contexts/event.jsonld"
  ],
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "foaf:depiction": "http://twitter.com/account/profile_image/manusporny",
  "celebrates":
  {
    "@type": "Event",
    "description": "International Talk Like a Pirate Day",
    "date": "R/2011-09-19"
  }

    "http://xmlns.com/foaf/0.1/homepage":
    {
      "@type": "@id"
    }
  },
  "foaf:name": "John Smith",
  "foaf:age": "41",
  "http://xmlns.com/foaf/0.1/homepage":
  [
    "http://personal.example.org/",
    "http://work.example.com/jsmith/"
  ]

}

Each context In this case the @id definition in a list will be evaluated in-order. Duplicate mappings among the context term definition is optional. If it does exist, the compact IRI s must or IRI representing the term will always be overwritten on a last-defined-overrides basis. The context list must contain either de-referenceable expanded to IRI s defined by the @id key—regardless of whether a prefix is defined or JSON object s not.

Type coercion is always performed using the unexpanded value of the key. In the example above, that conform to means that type coercion is done looking for foaf:age in the active context syntax and not for the corresponding, expanded IRI http://xmlns.com/foaf/0.1/age .

Note

Keys in the context are treated as described terms for the purpose of expansion and value coercion. At times, this may result in multiple representations for the same expanded IRI . For example, one could specify that dog and cat both expanded to http://example.com/vocab#animal . Doing this could be useful for establishing different type coercion or language specification rules. It also allows a compact IRI (or even an absolute IRI ) to be defined as something else entirely. For example, one could specify that the term http://example.org/zoo should expand to http://example.org/river , but this usage is discouraged because it would lead to a great deal of confusion among developers attempting to understand the JSON-LD document.

6.6 Embedding

An This section is non-normative.

Embedding is a JSON-LD feature that allows an author to use node objects as property values. This is a commonly used mechanism for creating a parent-child relationship between two nodes .

The example shows two nodes related by a property from the first node:

Example 26: Embedding a node object as property value of another node object
{
...
  "name": "Manu Sporny",
  "knows":
  {
    "@type": "Person",
    "name": "Gregg Kellogg",
  }
...
}

A node object , like the one used above, may be used in any value position in the body of a JSON-LD document.

6.7 Advanced Context Usage

This section is non-normative. nest contexts within subject definitions , with

Section 5.1 The Context introduced the basics of what makes JSON-LD work. This section expands on the basic principles of the context and demonstrates how more deeply nested advanced use cases can be achieved using JSON-LD.

In general, contexts overriding the values may be used at any time a JSON object is defined. The only time that one cannot express a context is inside a context definition itself. For example, a JSON-LD document may use more than one context at different points in previously defined contexts: a document:

{
Example 27: Using multiple contexts
[
  {
    "@context": "http://example.org/contexts/person.jsonld",
    "name": "Manu Sporny",
    "homepage": "http://manu.sporny.org/",
    "depiction": "http://twitter.com/account/profile_image/manusporny"
  },
  {
    "@context": "http://example.org/contexts/place.jsonld",
    "name": "The Empire State Building",
    "description": "The Empire State Building is a 102-story landmark in New York City.",
    "geo": {
      "latitude": "40.75",
      "longitude": "73.98"
    }
  }
]

Duplicate context terms are overridden using a most-recently-defined-wins mechanism.

Example 28: Scoped contexts within node objects
{
  "@context":
  {
    "name": "http://example.com/person#name",

    "name": "http://example.com/person#name,

    "details": "http://example.com/person#details"
  },

  }",

  "name": "Markus Lanthaler",
  ...
  "details":
  {
    "@context": {

    "@context":
    {

      "name": "http://example.com/organization#name"
    },

    },

    "name": "Graz University of Technology"
  }
}

In the example above, the name prefix term is overridden in the more deeply nested details structure. Note that this is rarely a good authoring practice and is typically used when working with legacy applications that depend on a specific structure of the JSON object has legacy applications using . If a term is redefined within a context, all previous rules associated with the structure previous definition are removed. If a term is redefined to null , the term is effectively removed from the list of terms defined in the object. active context .

External JSON-LD context documents Multiple contexts may contain extra information located outside be combined using an array , which is processed in order. The set of the @context key, such contexts defined within a specific JSON object are referred to as documentation about local contexts . The active context refers to the prefixes accumulation of local contexts declared that are in scope at a specific point within the document. When importing Setting a local context to @context null value from effectively resets the active context to an empty context. The following example specifies an external JSON-LD context document, any extra information contained outside and then layers an embedded context on top of the external context:

Example 29: Combining external and local contexts
{  "@context": [
    "http://json-ld.org/contexts/person.jsonld",
    {
      "pic": "http://xmlns.com/foaf/0.1/depiction"
    }
  ],
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "pic": "http://twitter.com/account/profile_image/manusporny"
}
Note

When possible, the context definition should be put at the top of a JSON-LD document. This makes the document easier to read and might make streaming parsers more efficient. Documents that do not have the context at the top are still conformant JSON-LD.

Note

To avoid forward-compatibility issues, terms starting with an @context @ value must character are to be discarded. It is also recommended avoided as they might be used as keywords in future versions of JSON-LD. Terms starting with an @ character that a human-readable document is served are not JSON-LD 1.0 keywords are treated as well any other term, i.e., they are ignored unless mapped to explain an IRI . Furthermore, the correct usage use of the JSON-LD context document. empty terms ( "" ) is not allowed as not all programming languages are able to handle empty JSON keys.

4.4 6.8 Referencing Contexts from Interpreting JSON Documents as JSON-LD

Ordinary JSON documents can be transformed into interpreted as JSON-LD documents by referencing to an external a JSON-LD context document in an HTTP Link Header. Doing this so allows JSON to be unambiguously machine-readable without requiring developers to drastically change their workflow documents and provides an upgrade path for existing infrastructure without breaking existing clients that rely on the application/json media type.

In order to use an external context with an ordinary JSON document, an author must MUST specify an IRI to a valid JSON-LD document in an HTTP Link Header [ RFC5988 ] using the describedby http://www.w3.org/ns/json-ld#context link relation. The referenced document must MUST have a top-level subject definition JSON object . The @context subtree within that object is added to the top-level subject definition JSON object of the referencing document. If an array is at the top-level of the referencing document and its items are subject definitions JSON objects , the @context subtree is added to all array items. All extra information located outside of the @context subtree in the referenced document must MUST be discarded. Effectively this means that the active context is initialized with the referenced external context .

The following example demonstrates the use of an external context with an ordinary JSON document:

GET /ordinary-json-document.json HTTP/1.1
Example 30: Referencing a JSON-LD context from a JSON document via an HTTP Link Header
GET /ordinary-json-document.json HTTP/1.1
Host: example.com
Accept: application/ld+json,application/json,*/*;q=0.1
====================================
HTTP/1.0 200 OK
...
Content-Type: application/json
Link: <http://json-ld.org/contexts/person.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
{
  "name": "Markus Lanthaler",
  "homepage": "http://www.markus-lanthaler.com/",
  "depiction": "http://twitter.com/account/profile_image/markuslanthaler"

  "image": "http://twitter.com/account/profile_image/markuslanthaler"

}
Note

Please note that JSON-LD documents served with the application/ld+json media type must MUST have all context information, including references to external contexts, within the body of the document. Contexts linked via a http://www.w3.org/ns/json-ld#context HTTP Link Header MUST be ignored for such documents.

4.5 6.9 Expanded Term Definition String Internationalization

Within a context definition, term s may This section is non-normative. be defined using an expanded notation to allow for additional information associated with the term to be specified (see also Type Coercion and Sets and Lists ).

Instead of using At times, it is important to annotate a string representation with its language. In JSON-LD this is possible in a variety of an IRI , the IRI may be specified using ways. First, it is possible to define a JSON object having an default language for a JSON-LD document by setting the @id @language key. key in the context :

Example 31: Setting the default language of a JSON-LD document
{  "@context":
  {
    ...
    "@language": "ja"
  },
  "name": "花澄",
  "occupation": "科学者"
}

The value of example above would associate the @id ja key must language code with the two strings 花澄 be either a term , a compact IRI and 科学者 . Languages codes are defined in [ , or an absolute IRI BCP47 ]. The default language applies to all string values that are not type coerced . Such an object is called

To clear the default language for a subject reference . subtree, @language can be set to null in a local context as follows:

{ "@context": { "foaf": , "name": , "homepage": , "depiction":
Example 32: Clearing default language
{
  "@context": {
    ...
    "@language": "ja"

  },
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/",
  "depiction": "http://twitter.com/account/profile_image/manusporny"

  "name": "花澄",
  "details": {
    "@context": {
      "@language": null
    },
    "occupation": "Ninja"
  }

}

This allows additional information to be associated with the term. This may be used for Type Coercion , Sets and Lists ), or Second, it is possible to associate a language information with a specific term as shown in the following example: using an expanded term definition :

{
Example 33: Expanded term definition with language
{
  "@context": {
    ...
    "ex": "http://example.com/",

    "ex": "http://example.com/vocab/",

    "@language": "ja",
    "name": { "@id": "ex:name", "@language": null },
    "occupation": { "@id": "ex:occupation" },
    "occupation_en": { "@id": "ex:occupation", "@language": "en" },
    "occupation_cs": { "@id": "ex:occupation", "@language": "cs" }
  },
  "name": "Yagyū Muneyoshi",
  "occupation": "忍者",
  "occupation_en": "Ninja",
  "occupation_cs": "Nindža",
  ...
}

The example above would associate 忍者 with the specified default language code ja , Ninja with the language code en , and Nindža with the language code cs . The value of name , Yagyū Muneyoshi wouldn't be associated with any language code since @language was reset to null in the expanded term definition. Expanded terms may also be defined using compact IRIs or absolute IRIs as keys. If the definition does not include an @id key, the expanded IRI is determined by performing expansion of the key within the current active context. This mechanism is mainly used to associate type or language information with a compact IRI or an absolute IRI .

Note

While it is possible to define a compact IRI , or an absolute IRI to expand to some other unrelated IRI (for example, foaf:name expanding Language associations are only applied to http://example.org/unrelated#species ), such usage is strongly discouraged. 4.6 Type Coercion JSON-LD supports the coercion of plain strings . Typed values to particular data types. Type coercion allows someone deploying JSON-LD to coerce the incoming or outgoing values that are subject to the proper data type based on a mapping of data type IRI s to term s. Using type coercion, value representation is preserved without requiring the data type to be specified with each piece of data. Type coercion is specified within an expanded term definition using the @type key. The value of this key represents a type IRI and must take the form of a term , compact IRI , absolute IRI , or the keyword @id . Specifying @id indicates that within the body of a JSON-LD document, a string value of a term coerced to @id is to be interpreted as an IRI . are not language tagged.

Terms or compact IRIs used

Just as in the example above, systems often need to express the value of a @type key may be defined within the same context. This means property in multiple languages. Typically, such systems also try to ensure that one may specify developers have a term like xsd and then use xsd:integer within the same context definition - the JSON-LD processor will be able programmatically easy way to determine navigate the proper expansion data structures for xsd:integer . The example below demonstrates how a JSON-LD author can coerce values to typed value the language-specific data. In this case, language maps s, IRIs and lists. may be utilized.

{
Example 34: Language map expressing a property in three languages
{
  "@context":
  {
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "http://xmlns.com/foaf/0.1/name",
    "age":
    {
      "@id": "http://xmlns.com/foaf/0.1/age",
      "@type": "xsd:integer"
    },
    "homepage":
    {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id",
      "@container": "@list"
    }

    ...
    "occupation": { "@id": "ex:occupation", "@container": "@language" }

  },
  "name": "John Smith",
  "age": ,
  "homepage":
  [
    "http://personal.example.org/",
    "http://work.example.com/jsmith/"
  ]

  "name": "Yagyū Muneyoshi",
  "occupation":
  {
    "ja": "忍者",
    "en": "Ninja",
    "cs": "Nindža"
  }
  ...

}

The example above would generate expresses exactly the following Turtle: @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . [ foaf:name "John Smith"; foaf:age "41"^^xsd:integer; foaf:homepage ( <http://personal.example.org/> <http://work.example.com/jsmith/> ) ] . Terms may also be defined using absolute IRIs or compact IRIs . This allows coercion rules to be applied to keys which are not represented same information as a simple term . For example: { "@context": { , "": { "@type": "xsd:integer" }, "": { "@type": "@id" } }, "foaf:name": "John Smith", "foaf:age": , "foaf:homepage": [ "http://personal.example.org/", "http://work.example.com/jsmith/" ] } In this case the @id definition is optional, previous example but if it does exist, the compact IRI or IRI is treated as a term (not consolidates all values in a prefix:suffix construct) so that single property. To access the actual definition of value in a prefix becomes unnecessary. Note Keys specific language in the context are treated as terms a programming language supporting dot-notation accessors for the purpose of expansion and value coercion. At times, this object properties, a developer may result in multiple representations for use the same expanded IRI . For example, one could specify that dog and cat property.language both expanded pattern. For example, to access the occupation in English, a developer would use the following code snippet: http://example.com/vocab#animal obj.occupation.en . Doing this could be useful for establishing different type coercion or

Third, it is possible to override the default language specification rules. It also allows by using a compact IRI (or even an absolute IRI value object :

Example 35: Overriding default language using an expanded value
{
  "@context": {
    ...
    "@language": "ja"
  },
  "name": "花澄",
  "occupation": {
    "@value": "Scientist",
    "@language": "en"
  }
}
)

This makes it possible to be defined as something else entirely. For example, one could specify that a plain string by omitting the term http://example.org/zoo @language should expand tag or setting it to http://example.org/river , but this usage is discouraged because null when expressing it would lead to using a great deal of confusion among developers attempting to understand the JSON-LD document. value object :

Example 36: Removing language information using an expanded value
{
  "@context": {
    ...
    "@language": "ja"
  },
  "name": {
    "@value": "Frank"
  },
  "occupation": {
    "@value": "Ninja",
    "@language": "en"
  },
  "speciality": "手裏剣"
}
Type coercion is performed using the unexpanded value of the key, which must have an exact match for an entry in the active context .

4.7 6.10 IRI Expansion Within within a Context

This section is non-normative.

In general, normal IRI expansion rules apply anywhere an IRI is expected (see section 5.2 IRIs ). Within a context definition, this can mean that terms defined within the context may also be used within that context as long as there are no circular dependencies. For example, it is common to use the xsd namespace when defining typed value s:

{
Example 37: IRI expansion within a context
{
  "@context":
  {
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "http://xmlns.com/foaf/0.1/name",
    "age":
    {
      "@id": "http://xmlns.com/foaf/0.1/age",
      "@type": "xsd:integer"
    },
    "homepage":
    {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id"
    }
  },
  ...
}

In this example, the xsd term is defined and used as a prefix for the @type coercion of the age property.

Term Terms s may also be used when defining the IRI of another term :

{
Example 38: Using a term to define the IRI of another term within a context
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "foaf:name",
    "age":
    {
      "@id": "foaf:age",
      "@type": "xsd:integer"
    },
    "homepage":
    {
      "@id": "foaf:homepage",
      "@type": "@id"
    }
  },
  ...
}

Compact IRIs and IRIs may be used on the left-hand side of a term definition.

{
Example 39: Using a compact IRI as a term
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "foaf:name",
    "foaf:age":
    {
      "@type": "xsd:integer"
    },
    "foaf:homepage":
    {
      "@type": "@id"
    }
  },
  ...
}

In this example, the compact IRI form is used in two different ways. In the first approach, foaf:age declares both the IRI for the term (using short-form) as well as the @type associated with the term . In the second approach, only the @type associated with the term is specified. The JSON-LD processor will derive the full IRI for foaf:homepage is determined by looking up the foaf prefix in the context .

Absolute IRIs may also be used in the key position in a context :

{
Example 40: Associating context definitions with absolute IRIs
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "name": "foaf:name",
    "foaf:age":
    {
      "@id": "foaf:age",
      "@type": "xsd:integer"
    },
    "http://xmlns.com/foaf/0.1/homepage":
    {
      "@type": "@id"
    }
  },
  ...
}

In order for the absolute IRI to match above, the absolute IRI must also needs to be used in the JSON-LD document. document . Also note that foaf:homepage will not use the { "@type": "@id" } declaration because foaf:homepage is not the same as http://xmlns.com/foaf/0.1/homepage . That is, a JSON-LD processor will use direct string comparison when looking up term terms s are looked up in a context using direct string comparison before it applies the prefix lookup mechanism. mechanism is applied.

Note

While it is possible to define a compact IRI , or an absolute IRI to expand to some other unrelated IRI (for example, foaf:name expanding to http://example.org/unrelated#species ), such usage is strongly discouraged.

The only exception for using terms in the context is that they must not be used in a circular manner. definitions are not allowed. That is, a definition of term-1 must not term1 cannot depend on the definition of term-2 term2 if term-2 term2 also depends on term-1 term1 . For example, the following context definition is illegal:

{
Example 41: Illegal circular definition of terms within a context
{
  "@context":
  {
    "term1": "term2:foo",
    "term2": "term1:bar"
  },
  ...
}

4.8 6.11 Sets and Lists

This section is non-normative.

A JSON-LD author can express multiple values in a compact way by using array s. arrays . Since graphs do not describe ordering for links between nodes, arrays in JSON-LD do not provide an ordering of the listed objects contained elements by default. This is exactly the opposite from regular JSON arrays, which are ordered by default. For example, consider the following simple document:

{
Example 42: Multiple values with no inherent order
{
...
  "@id": "http://example.org/people#joebob",
  "nick": ,

  "nick": [ "joe", "bob", "JB" ],

...
}

The markup example shown above would result in three triples the following data being generated, each relating the subject node to an individual object , value, with no inherent order:

<http://example.org/people#joebob> <http://xmlns.com/foaf/0.1/nick> "joe" . <http://example.org/people#joebob> <http://xmlns.com/foaf/0.1/nick> "bob" . <http://example.org/people#joebob> <http://xmlns.com/foaf/0.1/nick> "jaybee" .
Subject Property Value
http://example.org/people#joebob http://xmlns.com/foaf/0.1/nick joe
http://example.org/people#joebob http://xmlns.com/foaf/0.1/nick bob
http://example.org/people#joebob http://xmlns.com/foaf/0.1/nick JB

Multiple values may also be expressed using the expanded form:

{
Example 43: Using an expanded form to set multiple values
{
  "@id": "http://example.org/articles/8",
  "dc:title": 
  [
    {
      "@value": "Das Kapital",
      "@language": "de"
    },
    {
      "@value": "Capital",
      "@language": "en"
    }
  ]
}

The markup example shown above would generate the following triples, data, again with no inherent order:

<http://example.org/articles/8> <http://purl.org/dc/terms/title> "Das Kapital"@de . <http://example.org/articles/8> <http://purl.org/dc/terms/title> "Capital"@en .
Subject Property Value Language
http://example.org/articles/8 http://purl.org/dc/terms/title Das Kapital de
http://example.org/articles/8 http://purl.org/dc/terms/title Capital en

As the notion of ordered collections is rather important in data modeling, it is useful to have specific language support. In JSON-LD, a list may be represented using the @list keyword as follows:

{
Example 44: An ordered collection of values in JSON-LD
{
...
  "@id": "http://example.org/people#joebob",
  "foaf:nick":
  {
    "@list": [ "joe", "bob", "jaybee" ]
  },
...
}

This describes the use of this array as being ordered, and order is maintained when processing a document. If every use of a given multi-valued property is a list, this may be abbreviated by setting @container to @list in the context :

{
Example 45: Specifying that a collection is ordered in the context
{
  "@context":
  {
    ...
    "nick":
    {
      "@id": "http://xmlns.com/foaf/0.1/nick",
      "@container": "@list"
    }
  },
...
  "@id": "http://example.org/people#joebob",
  "nick": [ "joe", "bob", "jaybee" ],
...
}
Note

List of lists are not allowed in this version of JSON-LD. If a list of lists is detected, a JSON-LD processor will throw an exception. This decision was made due to the extreme amount of added complexity when processing lists of lists.

Similarly to While @list , there exists is used to describe ordered lists , the keyword @set keyword is used to describe unordered sets. While its sets . The use of @set in the body of a JSON-LD document represents just syntactic sugar that must be is optimized away when processing the document, as it is very just syntactic sugar. However, @set is helpful when used within the context of a document. Values of terms associated with a @set or @list container are always represented in the form of an array - , even if there is just a single value that would otherwise be optimized to a non-array form in a compacted document . compact form (see section 6.18 Compact Document Form ). This makes post-processing of the data JSON-LD documents easier as the data is always in array form, even if the array only contains a single value.

Note 6.12 Reverse Properties

This section is non-normative.

Feature at Risk 2 : Reverse properties
The use of @container in

Note: This feature is "at risk" and may be removed from this specification based on feedback. Please send feedback to public-rdf-comments@w3.org . For the body of a current status see features "at risk" in JSON-LD document, i.e., outside @context must 1.0

Reverse properties might be ignored by removed from JSON-LD processors. 1.0 if implementation experience reveals problems with supporting this feature.

4.9 Embedding

Object embedding is a JSON-LD feature serializes directed graphs . That means that allows an author to use subject definitions as every property values. This points from a node to another node or value . However, in some cases, it is desirable to serialize in the reverse direction. Consider for example the case where a commonly person and its children should be described in a document. If the used mechanism for creating vocabulary does not provide a parent-child relationship between two subject children property s. The example shows two subjects related by but just a parent property from , every node representing a child would have to be expressed with a property pointing to the first subject: parent as in the following example.

{ ... "name": "Manu Sporny", "":
Example 46: A document with children linking to their parent
[
  {
    "",
    "",

    "@id": "#homer",
    "http://example.com/vocab#name": "Homer"
  },
  {
    "@id": "#bart",
    "http://example.com/vocab#name": "Bart",
    "http://example.com/vocab#parent": { "@id": "#homer" }
  },
  {
    "@id": "#lisa",
    "http://example.com/vocab#name": "Lisa",
    "http://example.com/vocab#parent": { "@id": "#homer" }
  }
...
}

]

A subject definition , like the one used above, may be used in any value position in the body of a JSON-LD document. Expressing such data is much simpler by using JSON-LD's @reverse keyword :

Example 47: A person and its children using a reverse property
{
  "@id": "#homer",
  "http://example.com/vocab#name": "Homer",
  "@reverse": {    "http://example.com/vocab#parent": [
      {
        "@id": "#bart",
        "http://example.com/vocab#name": "Bart"
      },
      {
        "@id": "#lisa",
        "http://example.com/vocab#name": "Lisa"
      }
    ]
  }
}
4.10 Named Graphs

The @graph @reverse keyword is used to express a set of JSON-LD subject definition s that may not be directly related to one another through a property. The mechanism may can also be used where embedding in expanded term definitions is not desirable to create reverse properties as shown in the application. For following example:

{ "@context": ..., "": [
Example 48: Using @reverse to define reverse properties
{
  "@context": {
    "name": "http://example.com/vocab#name",
    "children": { "@reverse": "http://example.com/vocab#parent" }
  },
  "@id": "#homer",
  "name": "Homer",
  "children": [
    {
      "@id": "http://manu.sporny.org/i/public",
      "@type": "foaf:Person",
      "name": "Manu Sporny",
      "knows": "http://greggkellogg.net/foaf#me"

      "@id": "#bart",
      "name": "Bart"

    },
    {
      "@id": "http://greggkellogg.net/foaf#me",
      "@type": "foaf:Person",
      "name": "Gregg Kellogg",
      "knows": "http://manu.sporny.org/i/public"

      "@id": "#lisa",
      "name": "Lisa"

    }
  ]
}

6.13 Named Graphs

In this case, embedding doesn't work as each subject definition references the other. Using the @graph keyword allows multiple resources to be defined within an array , and allows the use of a shared context . When used in a JSON object that is not otherwise a subject definition , this describes resources in the default graph . This section is equivalent to using multiple subject definitions in array and defining the @context within each subject definition : { "@id": "http://manu.sporny.org/i/public", "@type": "foaf:Person", "name": "Manu Sporny", "knows": "http://greggkellogg.net/foaf#me" }, { "@id": "http://greggkellogg.net/foaf#me", "@type": "foaf:Person", "name": "Gregg Kellogg", "knows": "http://manu.sporny.org/i/public" } ] non-normative.

JSON-LD allows you At times, it is necessary to name things on the Web make statements about a JSON-LD graph itself, rather than just a single node . This can be done by assigning an grouping a set of nodes using the @id @graph to them, which is typically an IRI keyword . This notion extends to the ability to identify graphs in the same manner. A developer may also name data expressed using the @graph keyword by pairing it with an @id keyword . This enables the developer to make statements about a linked data graph itself, rather than just a single subject . as shown in the following example:

{ "@context": ...,
Example 49: Identifying and making statements about a graph
{
  "@context": {
    "generatedAt": {
      "@id": "http://www.w3.org/ns/prov#generatedAtTime",
      "@type": "http://www.w3.org/2001/XMLSchema#date"
    },
    "Person": "http://xmlns.com/foaf/0.1/Person",
    "name": "http://xmlns.com/foaf/0.1/name",
    "knows": "http://xmlns.com/foaf/0.1/knows"
  },

  "@id": "http://example.org/graphs/73",
  "asOf": { "@value": "2012-04-09", "@type": "xsd:date" },

  "generatedAt": "2012-04-09",

  "@graph":
  [
    {
      "@id": "http://manu.sporny.org/i/public",
      "@type": "foaf:Person",

      "@type": "Person",

      "name": "Manu Sporny",
      "knows": "http://greggkellogg.net/foaf#me"
    },
    {
      "@id": "http://greggkellogg.net/foaf#me",
      "@type": "foaf:Person",

      "@type": "Person",

      "name": "Gregg Kellogg",
      "knows": "http://manu.sporny.org/i/public"
    }
  ]
}

The example above expresses a named linked data graph that is identified by the IRI http://example.org/graphs/73 . That graph is composed of the statements about Manu and Gregg. Meta-data Metadata about the graph itself is also expressed via the asOf generatedAt property, which specifies when the information graph was retrieved from generated. An alternative view of the Web. information above is represented in table form below:

Issue 3
Graph Subject Property Value Value Type
http://example.org/graphs/73 http://www.w3.org/ns/prov#generatedAtTime 2012-04-09 http://www.w3.org/2001/XMLSchema#date
http://example.org/graphs/73 http://manu.sporny.org/i/public http://www.w3.org/2001/XMLSchema#type http://xmlns.com/foaf/0.1/Person
http://example.org/graphs/73 http://manu.sporny.org/i/public http://xmlns.com/foaf/0.1/name Manu Sporny These examples could all have TriG definitions
http://example.org/graphs/73 http://manu.sporny.org/i/public http://xmlns.com/foaf/0.1/knows http://greggkellogg.net/foaf#me
http://example.org/graphs/73 http://greggkellogg.net/foaf#me http://www.w3.org/2001/XMLSchema#type http://xmlns.com/foaf/0.1/Person
http://example.org/graphs/73 http://greggkellogg.net/foaf#me http://xmlns.com/foaf/0.1/name Gregg Kellogg
http://example.org/graphs/73 http://greggkellogg.net/foaf#me http://xmlns.com/foaf/0.1/knows http://manu.sporny.org/i/public

When a JSON-LD document's top-level structure is an object that contains no other properties than @graph and optionally @context (properties that are not mapped to an IRI or a keyword are ignored), @graph is considered to express the otherwise implicit default graph . This mechanism can be useful when a number of their RDF results, but nodes exist at the document's top level that would involve adding RDF earlier share the same context , which is, e.g., the case when a document is flattened . The @graph keyword collects such nodes in an array and allows the document. use of a shared context.

Example 50: Using @graph to explicitly express the default graph
{
  "@context": ...,
  "@graph":
  [
    {
      "@id": "http://manu.sporny.org/i/public",
      "@type": "foaf:Person",
      "name": "Manu Sporny",
      "knows": "http://greggkellogg.net/foaf#me"
    },
    {
      "@id": "http://greggkellogg.net/foaf#me",
      "@type": "foaf:Person",
      "name": "Gregg Kellogg",
      "knows": "http://manu.sporny.org/i/public"
    }
  ]
}

In this case, embedding doesn't work as each node object references the other. This is equivalent to using multiple node objects in array and defining the @context within each node object :

Example 51: Context needs to be duplicated if @graph is not used
[
  {
    "@context": ...,
    "@id": "http://manu.sporny.org/i/public",
    "@type": "foaf:Person",
    "name": "Manu Sporny",
    "knows": "http://greggkellogg.net/foaf#me"
  },
  {
    "@context": ...,
    "@id": "http://greggkellogg.net/foaf#me",
    "@type": "foaf:Person",
    "name": "Gregg Kellogg",
    "knows": "http://manu.sporny.org/i/public"
  }
]

4.11 6.14 Identifying Unlabeled Blank Nodes

This section is non-normative.

At times, it becomes necessary to be able to express information without being able to specify uniquely identify the subject. Typically, this node with an IRI . This type of node is called an unlabeled node or a blank node (see [ RDF-CONCEPTS ] Section 3.4: Blank Nodes ). In JSON-LD, unlabeled node identifiers are automatically created if a subject is . JSON-LD does not specified require all nodes to be identified using the @id keyword . . However, authors some graph topologies may provide require identifiers for unlabeled nodes by to be serializable. Graphs containing loops, e.g., cannot be serialized using embedding alone, @id must be used to connect the special nodes. In these situations, one can use blank node identifiers , which look like IRIs using an underscore ( _ (underscore) prefix . ) as scheme. This allows one to reference the node locally within the document, but makes it impossible to reference the node from an external document. The unlabeled blank node identifier is scoped to the document in which it is used.

{ ... "@id": "", ...
Example 52: Specifying a local blank node identifier
{
   ...
   "@id": "_:n1",
   "name": "Secret Agent 1",
   "knows":
     {
       "name": "Secret Agent 2",
       "knows": { "@id": "_:n1" }
     }

}

The example above would set the subject contains information about to _:foo , which secrete agents that cannot be identified with an IRI . While expressing that agent 1 knows agent 2 is possible without using blank node identifiers , it is necessary assign agent 1 an identifier so that it can then be used elsewhere in the JSON-LD document to refer back to the unlabeled referenced from agent 2 .

It is worth nothing that blank node . identifiers may be relabeled during processing. If a developer finds that they refer to the unlabeled blank node more than once, they should consider naming the node using a de-referenceable dereferenceable IRI so that it can also be referenced also from other documents.

4.12 6.15 Aliasing Keywords

This section is non-normative.

Each of the JSON-LD keywords , except for @context , may be aliased to application-specific keywords. This feature allows legacy JSON content to be utilized by JSON-LD by re-using JSON keys that already exist in legacy documents. This feature also allows developers to design domain-specific implementations using only the JSON-LD context .

{
Example 53: Aliasing keywords
{
  "@context":
  {
     "url": "@id",
     "a": "@type",
     "name": "http://schema.org/name"

     "name": "http://xmlns.com/foaf/0.1/name"

  },
  "url": "http://example.com/about#gregg",
  "": "http://schema.org/Person",

  "a": "http://xmlns.com/foaf/0.1/Person",

  "name": "Gregg Kellogg"
}

In the example above, the @id and @type keywords have been given the aliases url and a , respectively.

Since keywords cannot be redefined, they can also not be aliased to other keywords.

4.13 6.16 Data Indexing

This section is non-normative.

Databases are typically used to make access to data more efficient. Developers often extend this sort of functionality into their application data to deliver similar performance gains. Often this data does not have any meaning from a Linked Data standpoint, but is still useful for an application.

JSON-LD introduces the notion of index maps that can be used to structure data into a form that is more efficient to access. The data indexing feature allows an author to structure data using a simple key-value map where the keys do not map to IRIs . This enables direct access to data instead of having to scan an array in search of a specific item. In JSON-LD such data can be specified by associating the @index keyword with a @container declaration in the context:

Example 54: Indexing data in JSON-LD
{
  "@context":
  {
     "schema": "http://schema.org/",
     "name": "schema:name",
     "body": "schema:articleBody",
     "words": "schema:wordCount",
     "post": {
       "@id": "schema:blogPost",
       "@container": "@index"
     }
  },
  "@id": "http://example.com/",
  "@type": "schema:Blog",
  "name": "World Financial News",
  "post": {
     "en": {
       "@id": "http://example.com/posts/1/en",
       "body": "World commodities were up today with heavy trading of crude oil...",
       "words": 1539
     },
     "de": {
       "@id": "http://example.com/posts/1/de",
       "body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...",
       "words": 1204
     }
  }
}

In the example above, the blogPost term has been marked as an index map . The en , de , and ja keys will be ignored semantically, but preserved syntactically, by the JSON-LD Processor. This allows a developer to access the German version of the blogPost using the following code snippet: obj.blogPost.de .

The interpretation of the data above is expressed in the table below. Note how the index keys do not appear in the Linked Data below, but would continue to exist if the document were compacted or expanded (see section 6.18 Compact Document Form and section 6.17 Expanded Document Form ) using a JSON-LD processor:

Subject Property Value
http://example.com/ http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://schema.org/Blog
http://example.com/ http://schema.org/name World Financial News
http://example.com/ http://schema.org/blogPost http://example.com/posts/1/en
http://example.com/ http://schema.org/blogPost http://example.com/posts/1/de
http://example.com/posts/1/en http://schema.org/articleBody World commodities were up today with heavy trading of crude oil...
http://example.com/posts/1/en http://schema.org/wordCount 1539
http://example.com/posts/1/de http://schema.org/articleBody Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...
http://example.com/posts/1/de http://schema.org/wordCount 1204

6.17 Expanded Document Form

This section is non-normative.

The JSON-LD Processing Algorithms and API specification [ JSON-LD-API ] defines an a method for expanding a JSON-LD document. Expansion is the process of taking a JSON-LD document and applying a @context such that all IRIs, types, and values are expanded so that the @context is no longer necessary.

For example, assume the following JSON-LD input document:

{
Example 55: Sample JSON-LD document
{
   "@context":
   {
      "name": "http://xmlns.com/foaf/0.1/name",
      "homepage": {
        "@id": "http://xmlns.com/foaf/0.1/homepage",
        "@type", "@id"

        "@type": "@id"

      }
   },
   "name": "Manu Sporny",
   "homepage": "http://manu.sporny.org/"
}

Running the JSON-LD Expansion algorithm against the JSON-LD input document provided above would result in the following output:

[
Example 56: Expanded form for the previous example
[
  {
    "http://xmlns.com/foaf/0.1/name": [
      { "@value": "Manu Sporny" }
    ],
    "http://xmlns.com/foaf/0.1/homepage": [
      { "@id": "http://manu.sporny.org/" }
    ]
  }
]
Expanded document form is useful when an application has to process input data in a deterministic form. It has been optimized to ensure that the code that developers have to write is minimized compared to the code that would have to be written to operate on compact document form .

4.14 6.18 Compact Document Form

This section is non-normative.

The JSON-LD Processing Algorithms and API specification [ JSON-LD-API ] defines a method for compacting a JSON-LD document. Compaction is the process of taking a JSON-LD document and applying a developer-supplied context such that the most to shorten IRIs to terms or compact form of the document is generated. JSON is typically IRIs and JSON-LD values expressed in a very compact, key-value format. That is, full IRIs are rarely used expanded form to simple values such as keys. At times, a JSON-LD strings or numbers . Often this makes it simpler to work with document may be received that as the data is not expressed in its most compact form. JSON-LD, via the API, provides a way application-specific terms. Compacted documents are also typically easier to compact a JSON-LD document. read for humans.

For example, assume the following JSON-LD input document:

[
Example 57: Sample expanded JSON-LD document
[
  {
    "http://xmlns.com/foaf/0.1/name": [ "Manu Sporny" ],
    "http://xmlns.com/foaf/0.1/homepage": [
      {
       "@id": "http://manu.sporny.org/"
      }
    ]
  }
]

Additionally, assume the following developer-supplied JSON-LD context:

{
Example 58: Sample context
{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "homepage": {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id"
    }
  }
}

Running the JSON-LD Compaction algorithm given the context supplied above against the JSON-LD input document provided above would result in the following output:

{
Example 59: Compact form of the sample document once sample context has been applied
{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "homepage": {
      "@id": "http://xmlns.com/foaf/0.1/homepage",
      "@type": "@id"
    }
  },
  "name": "Manu Sporny",
  "homepage": "http://manu.sporny.org/"
}

6.19 Flattened Document Form

This section is non-normative.

The compaction algorithm enables JSON-LD Processing Algorithms and API specification [ JSON-LD-API ] defines a developer method for flattening a JSON-LD document. Flattening collects all properties of a node in a single JSON object and labels all blank nodes with blank node identifiers . This ensures a shape of the data and consequently may drastically simplify the code required to map any document into an application-specific compacted form by first expanding process JSON-LD in certain applications.

For example, assume the following JSON-LD input document:

Example 60: Sample JSON-LD document
{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "knows": "http://xmlns.com/foaf/0.1/knows"
  },
  "@id": "http://me.markus-lanthaler.com/",
  "name": "Markus Lanthaler",
  "knows": [
    {
      "@id": "http://manu.sporny.org/",
      "name": "Manu Sporny"
    },
    {
      "name": "Dave Longley"
    }
  ]
}

Running the JSON-LD Flattening algorithm against the JSON-LD input document . While in the context provided example above mapped http://xmlns.com/foaf/0.1/name to name , it could have also mapped it to any arbitrary string provided by and using the developer. This powerful mechanism, along with another same context would result in the following output:

Example 61: Flattened and compacted form for the previous example
{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "knows": "http://xmlns.com/foaf/0.1/knows"
  },
  "@graph": [
    {
      "@id": "_:b0",
      "name": "Dave Longley"
    },
    {
      "@id": "http://manu.sporny.org/",
      "name": "Manu Sporny"
    },
    {
      "@id": "http://me.markus-lanthaler.com/",
      "name": "Markus Lanthaler",
      "knows": [
        { "@id": "http://manu.sporny.org/" },
        { "@id": "_:b0" }
      ]
    }
  ]
}

6.20 Embedding JSON-LD API technique called in HTML Documents

framing , allows This section is non-normative.

HTML script tags can be used to embed blocks of data in documents. This way, JSON-LD content can be easily embedded in HTML by placing it in a script element with the developer type attribute set to re-shape application/ld+json .

Example 62: Embedding JSON-LD in HTML
<script type="application/ld+json">
{
  "@context": "http://json-ld.org/contexts/person.jsonld",
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}

</script>

Depending on how the incoming JSON HTML document is served, certain strings may need to be escaped.

Defining how such data into a format that may be used is optimized for their application. beyond the scope of this specification. The embedded JSON-LD document might be extracted as is or, e.g., be converted to RDF.

If JSON-LD content is extracted as RDF [ RDF11-CONCEPTS ], it should be expanded into an RDF dataset using the Convert to RDF Algorithm [ JSON-LD-API ].

A. JSON-LD Authoring Guidelines Data Model

Since JSON-LD is a serialization format for Linked Data based on JSON. It is therefore important to distinguish between the syntax, which is defined by JSON in [ RFC4627 ], and JSON-LD's data model which is defined as follows:

Issue 4 Feature at Risk 3 : Allow blank nodes to be used as graph name or property
The final details of

Note: This feature is "at risk" and may be removed from this specification based on feedback. Please send feedback to public-rdf-comments@w3.org . For the guidelines are still being discussed ( ISSUE-114 current status see features "at risk" in JSON-LD 1.0 ),

RDF does not currently allow a blank node to be used as well graph name or property , while JSON-LD does. JSON-LD to RDF converters can work around this restriction, when converting JSON-LD to RDF, by converting such blank nodes to IRIs , minting new "Skolem IRIs" as per Replacing Blank Nodes with IRIs of [ RDF11-CONCEPTS ]. Based on feedback from implementors the best mechanism Working Group may decide to express these restrictions. EBNF doesn't quite capture what these guidelines are attempting disallow blank nodes as graph names and properties in JSON-LD. If this change would affect you, be sure to do - which is strongly express what constitutes send in a well-formed comment.

JSON-LD document. For documents MAY contain data that cannot be represented by the time being, data model defined above. Unless otherwise specified, such data is ignored when a simple list of plain English guidelines JSON-LD document is being processed. This means, e.g., that properties which are provided. not mapped to an IRI or blank node will be ignored.

An illustration of JSON-LD's data model

Figure 1: An illustration of JSON-LD's data model.

B. JSON-LD Grammar

This appendix restates the syntactic conventions described in the previous sections more formally.

A JSON-LD document MUST be a valid JSON document as described in [ RFC4627 ].

A JSON-LD document MUST be a single node object or an array whose elements are each node objects at the top level.

In contrast to JSON, in JSON-LD the keys in objects MUST be unique.

Issue 5 Note

Per Andy S's comment , consider making JSON-LD allows keywords to be aliased (see section 6.15 Aliasing Keywords for details). Whenever a keyword is discussed in this grammar, the statements also apply to an alias for that keyword . For example, if the active context defines the term id as an alias for @id , that alias may be legitimately used as a normative syntax definition along with EBNF. substitution for @id . Note that keyword aliases are not expanded during context processing.

B.1 Terms

A JSON-LD document term is composed of a single subject definition short-hand string that expands to an IRI or a blank node identifier .

A term MUST NOT equal any of the JSON-LD keywords .

To avoid forward-compatibility issues, a term SHOULD NOT start with an array @ character as future versions of JSON-LD may introduce additional keywords . Furthermore, the term MUST NOT be an empty string ( "" ) as not all programming languages are able to handle empty JSON keys.

See section 5.1 The Context and section 5.2 IRIs for further discussion on mapping terms to IRIs .

B.2 Node Objects

A node object represents zero or more properties of subject definitions a node in the JSON-LD graph serialized by the JSON-LD document . A JSON object is a node object if it exists outside of a JSON-LD context and:

The properties of a node in a JSON-LD graph may be spread among different node objects within a document. When that happens, the keys of the different node objects need to be merged to create the properties of the resulting node .

A node object MUST be a JSON object . All keys which are not IRIs , compact IRIs , term terms valid in the active context , or one of the following keywords MUST be ignored when processed:

If the node object contains the @context key, its value MUST be null , an absolute IRI , a compact relative IRI , a context definition , or an array composed of any of these.

If the node object contains the @id key, its value MUST be an absolute IRI , a relative IRI , or a compact IRI . An (including blank node identifiers ). See section 5.3 Node Identifiers , section 6.3 Compact IRIs , and section 6.14 Identifying Blank Nodes for further discussion on @id keyword and a values.

If the node object contains the @language @graph keyword must not key, its value MUST exist in the same JSON be a node object or an array of zero or more node objects . An If the node object contains an @id keyword and keyword, its value is used as the label of a named graph. See section 6.13 Named Graphs for further discussion on @container @graph keyword must not exist in the same values. As a special case, if a JSON object . A subject definition may contain a contains no keys other than @context @graph property. A and @context , and the JSON object is the root of the JSON-LD document, the JSON object is not treated as a node object ; this is used as a way of defining node definitions that may not form a connected graph. This allows a context to be defined which is shared by all of the constituent node objects .

If the node object contains the @type key, its value must not MUST contain be either an embedded absolute IRI , a relative IRI , a compact IRI (including blank node identifiers ), a term defined in the active context expanding into an absolute IRI , or an array of any of these. See section 5.4 Specifying the Type for further discussion on @context @type definition. The value associated with values.

If the node object contains the @context @reverse keyword must key, its value MUST be a string expanding to JSON object containing members representing reverse properties. Each value of such a reverse property MUST be an absolute IRI , a relative IRI , a JSON object compact IRI , null, a blank node identifier , a node object or an array containing a combination of these.

If the allowed values. The value associated with node object contains the keys used in a @context @index must key, its value MUST be a string . See section 6.16 Data Indexing for further discussion on null , @index values.

Keys in a node object that are not keywords MAY expand to an absolute IRI using the active context . The values associated with keys that expand to an absolute IRI MUST be one of the following:

B.3 Value Objects

A value that object is used to explicitly associate a type or a language with a value to create a typed value or a language-tagged string .

A value object MUST be a JSON object that is associated with containing the @value key. It MAY also contain a key in @type , a @language , an @index , or an @context : key but MUST NOT contain both a @id @type and a @type @language must key at the same time. A value object MUST NOT be contain any other keys that expand to an absolute IRI or keyword .

The value associated with the @value key MUST be either a string , a number , true , false or null .

The value associated with the @type key MUST be a term , a compact IRI , an absolute IRI , a relative IRI , or null .

The value associated with the @container @language must key MUST have the lexical form described in [ BCP47 ], or be null .

The value associated with the @index key MUST be a string .

See section 6.4 Typed Values and section 6.9 String Internationalization for more information on value objects .

B.4 Lists and Sets

A list represents an ordered set of either values. A set represents an unordered set of values. Unless otherwise specified, arrays are unordered in JSON-LD. As such, the @set keyword, when used in the body of a JSON-LD document, represents just syntactic sugar which is optimized away when processing the document. However, it is very helpful when used within the context of a document. Values of terms associated with a @set or @list . @language must container will always be represented in the form of an array when a string expressed document is processed—even if there is just a single value that would otherwise be optimized to a non-array form in [ BCP47 compact document form . This simplifies post-processing of the data as the data is always in a deterministic form.

A list object MUST be a JSON object that contains no keys that expand to an absolute IRI ] or keyword other than null @list , @context , and @index . Any other property must

A set object MUST be ignored by a JSON-LD processor JSON object that contains no keys that expand to an absolute IRI or keyword other than @list , @context , and must @index . Please note that the @index key will be preserved in compaction ignored when being processed.

In both cases, the value associated with the keys @list and framing. @set MUST be one of the following types:

See section 6.11 Sets and Lists for further discussion on sets and lists.

B.5 Language Maps

A subject definition language map is used to associate a language with a value in a way that allows easy programmatic access. A language map may have an be used as a term value within a node object if the term is defined with @graph @container property. set to @language . The value keys of a @graph property must language map MUST be a subject definition strings representing [ BCP47 ] language codes with and the values MUST be any of the following types:

See section 6.9 String Internationalization containing for further discussion on language maps.

B.6 Index Maps

An index map allows keys that have no semantic meaning, but should be preserved regardless, to be used in JSON-LD documents. An index map may be used as a term value within a node object if the term is defined with @set @container key must not set to @index . The values of the members of an index map MUST have any other keys. be one of the following types:

See section 6.16 Data Indexing for further information on this topic.

B.7 Context Definitions

A context definition defines a local context in a node object .

A context definition MUST be a JSON object containing whose keys MUST either be terms , compact IRIs , absolute IRIs , or the keywords @language , @base , and @vocab .

If the context definition has a @list @language key must not key, its value MUST have any other keys. The the lexical form described in [ BCP47 ] or be null .

If the context definition has a @base key, its value of MUST be an absolute IRI or null .

Feature at Risk 1 : @base keyword

Note: This feature is "at risk" and may be removed from this specification based on feedback. Please send feedback to public-rdf-comments@w3.org . For the current status see features "at risk" in JSON-LD 1.0

This feature is at risk as the fact that a document may have multiple base IRIs is potentially confusing for developers. It is also being discussed whether relative IRIs are allowed as values of @set @base or whether the empty string should be used to explicitly specify that there isn't a base IRI , which could be used to ensure that relative IRIs remain relative when expanding.

If the context definition has a @list @vocab key can key, its value MUST be a string, absolute IRI , a number, compact IRI , a JSON object term , or null .

The value of keys that are not keywords MUST be either an array absolute IRI , a compact IRI , a term , a blank node identifier , a keyword , null , or an expanded term definition .

An expanded term definition containing is used to describe the mapping between a combination term and its expanded identifier, as well as other properties of the allowed values. For each JSON object value associated with the term that contains when it is used as key in a @value key: It may node object .

An expanded term definition MUST have be a JSON object composed of zero or more keys from @id , @reverse , @type , @language or @type property and must not @container . An expanded term definition SHOULD NOT have contain any other properties. It must keys.

If an expanded term definition has an @reverse member, @id , @type , and @language are not allowed. If an @container member exists, its value MUST contain both be null or @index .

If the term being defined is not a compact IRI or absolute IRI and the active context does not have an @language @vocab and mapping, the expanded term definition MUST include the @type @id keys at key.

If the same time. The value of expanded term definition contains the @value @id key must keyword , its value MUST be null , an absolute IRI , a string blank node identifier , a compact IRI , or a number. The value of term .

If the expanded term definition contains the @language @type key must keyword , its value MUST be an absolute IRI , a compact IRI , a blank node identifier , a term or the active context , null , or the one of the keywords @id or a string @vocab .

If the expanded term definition contains the @language keyword , its value MUST have the lexical form described in [ BCP47 ] format. The value of or be null .

If the expanded term definition contains the @type @container must keyword , its value MUST be either @list , @set , @language , @index , or be null . If the value is @language , when the term is used outside of the @context , the associated value MUST be a language map . If the value is @index , when the term , is used outside of the @context , the associated value MUST be an index map .

Terms MUST NOT be used in a compact IRI circular manner. That is, the definition of a term cannot depend on the definition of another term if that other term also depends on the first term.

See section 5.1 The Context for further discussion on contexts.

, an C. Relationship to RDF

The RDF data model, as outlined in [ IRI RDF11-CONCEPTS , a JSON object , or ], is an array containing abstract syntax for representing a combination directed graph of information. It is a subset of JSON-LD's data model with a few additional constraints. The differences between the allowed values. two data models are:

Summarized these differences mean that JSON-LD is capable of @type must serializing any RDF graph or dataset and most, but not all, JSON-LD documents can be @id . This directly transformed to RDF. It is in contrast possible to the use work around this restriction, when converting JSON-LD to RDF, by converting blank nodes used as graph names or properties to IRIs , minting new "Skolem IRIs" as per Replacing Blank Nodes with IRIs of @type [ RDF11-CONCEPTS ]. A complete description of the algorithms to convert from RDF to JSON-LD and from JSON-LD to RDF is included in the @context , where this JSON-LD Processing Algorithms and API specification [ JSON-LD-API ].

Even though JSON-LD serializes RDF datasets, it can also be used as a RDF graph source. In that case, a consumer MUST only use the default graph and ignore all named graphs. This allows servers to expose data in, e.g., both Turtle and JSON-LD using content negotiation.

Note

Publishers supporting both dataset and graph syntaxes have to ensure that the primary data is allowed. stored in the default graph to enable consumers that do not support datasets to process the information.

B. C.1 Relationship Transformation from JSON-LD to other RDF Formats

This section is non-normative.

Issue 6

The intent of the Working Group and the Editors process of this specification is to eventually align terminology used in this turning a JSON-LD document with depends on executing the terminology used algorithms defined in the RDF Concepts document Conversion Algorithms in the JSON-LD Processing Algorithms and API specification [ RDF-CONCEPTS JSON-LD-API ] to ]. It is beyond the extent to which it makes sense scope of this document to do so. In general, if there detail these algorithms any further, but a summary of the necessary operations is an analogue provided to terminology used in illustrate the process.

The procedure involves the following steps:

  1. Expand the JSON-LD document, removing any context; this document ensures that properties, types, and values are given their full representation as IRIs and expanded values. Expansion is discussed further in section 6.17 Expanded Document Form .
  2. Flatten the RDF Concepts document, which turns the preference document into an array of node objects . Flattening is to use the terminology discussed further in the section 6.19 Flattened Document Form .
  3. Turn each node object into a series of RDF Concepts document. triples .

For example, consider the following JSON-LD document in compact form:

Example 63: Sample JSON-LD document
{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name",
    "knows": "http://xmlns.com/foaf/0.1/knows"
  },
  "@id": "http://me.markus-lanthaler.com/",
  "name": "Markus Lanthaler",
  "knows": [
    {
      "@id": "http://manu.sporny.org/",
      "name": "Manu Sporny"
    },
    {
      "name": "Dave Longley"
    }
  ]
}

Running the JSON-LD Expansion and Flattening algorithms against the JSON-LD input document in the example above would result in the following output:

Example 64: Flattened and expanded form for the previous example
[
  {
    "@id": "_:b0",
    "http://xmlns.com/foaf/0.1/name": "Dave Longley"
  },
  {
    "@id": "http://manu.sporny.org/",
    "http://xmlns.com/foaf/0.1/name": "Manu Sporny"
  },
  {
    "@id": "http://me.markus-lanthaler.com/",
    "http://xmlns.com/foaf/0.1/name": "Markus Lanthaler",
    "http://xmlns.com/foaf/0.1/knows": [
      { "@id": "http://manu.sporny.org/" },
      { "@id": "_:b0" }
    ]
  }
]

Transforming this to RDF now is a specification for representing Linked Data in JSON. A common way straightforward process of working with Linked Data is through RDF , the Resource Description Framework. turning each node object into one or more RDF triples. This can be expressed using JSON-LD by associating JSON-LD concepts such in Turtle as @id and @type with the equivalent follows:

Example 65: Turtle representation of expanded/flattend document
_:b0 <http://xmlns.com/foaf/0.1/name> "Dave Longley" .
IRI

<http://manu.sporny.org/> <http://xmlns.com/foaf/0.1/name> "Manu Sporny" .

s
in
RDF.
Further
information
about

<http://me.markus-lanthaler.com/> <http://xmlns.com/foaf/0.1/name> "Markus Lanthaler" ;
<http://xmlns.com/foaf/0.1/knows>
<http://manu.sporny.org/>,
_:b0
.

The process of turning RDF may into JSON-LD can be found in thought of as the [ RDF-PRIMER inverse of this last step, creating an expanded JSON-LD document closely matching the triples from RDF, using a single node object for all triples having a common subject, and a single property for those triples also having a common predicate.

D. Relationship to Other Linked Data Formats

This section is non-normative. ].

The JSON-LD markup examples below demonstrate how JSON-LD can be used to express semantic data marked up in other languages and linked data models formats such as RDF, Turtle, RDFa, Microformats, and Microdata. These sections are merely provided as evidence that JSON-LD is very flexible in what it can express across different Linked Data approaches. Further information on transforming JSON-LD into RDF are detailed in the [ JSON-LD-API ].

B.1 D.1 RDF Turtle

This section is non-normative.

The RDF data model, as outlined in [ RDF-CONCEPTS ], is an abstract syntax for representing a directed graph of information. JSON-LD is capable of serializing any RDF graph, and performing full RDF to JSON-LD to RDF round-tripping. A complete description of how JSON-LD maps to RDF and algorithms detailing how one can convert from RDF to JSON-LD and from JSON-LD to RDF are included in the JSON-LD API [ JSON-LD-API ] specification. B.2 Turtle The following are examples of converting RDF expressed in Turtle [ TURTLE-TR TURTLE ] into JSON-LD.

B.2.1

Prefix definitions

This section is non-normative.

The JSON-LD context has direct equivalents for the Turtle @prefix declaration:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
Example 66: A set of statements serialized in Turtle
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://manu.sporny.org/i/public> a foaf:Person;
  foaf:name "Manu Sporny";
foaf:homepage
<http://manu.sporny.org/>
.
{
Example 67: The same set of statements serialized in JSON-LD
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/"
  },
  "@id": "http://manu.sporny.org/i/public",
  "@type": "foaf:Person",
  "foaf:name": "Manu Sporny",
  "foaf:homepage": { "@id": "http://manu.sporny.org/" }
}
Note
JSON-LD has no equivalent for the Turtle @base declaration. Instead, authors may use a prefix definition to resolve relative IRI s: { "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": , "@type": "foaf:Person", "foaf:name": "Manu Sporny", "foaf:homepage": { "@id": } } B.2.2

Embedding

Both Turtle and JSON-LD allow embedding of objects, embedding, although Turtle only allows embedding of objects which use unlabeled node identifiers. blank nodes .

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
Example 68: Embedding in Turtle
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://manu.sporny.org/i/public>
  a foaf:Person;
  foaf:name "Manu Sporny";
foaf:knows
[
a
foaf:Person;
foaf:name
"Gregg
Kellogg"
]
.
{
Example 69: Same embedding example in JSON-LD
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/"
  },
  "@id": "http://manu.sporny.org/i/public",
  "@type": "foaf:Person",
  "foaf:name": "Manu Sporny",
  "foaf:knows":
  {
    "@type": "foaf:Person",
    "foaf:name": "Gregg Kellogg"
  }
}

Conversion of native data types

In JSON-LD numbers and boolean values are native data types. While Turtle has a shorthand syntax to express such values, RDF's abstract syntax requires that numbers and boolean values are represented as typed literals. Thus, to allow full round-tripping, the JSON-LD Processing Algorithms and API specification [ B.2.3 JSON-LD-API ] defines conversion rules between JSON-LD's native data types and RDF's counterparts. Numbers without fractions are converted to xsd:integer -typed literals, numbers with fractions to xsd:double -typed literals and the two boolean values true and false to a xsd:boolean -typed literal. All typed literals are in canonical lexical form.

Example 70: JSON-LD using native data types for numbers and boolean values
{
  "@context":
  {
    "ex": "http://example.com/vocab#"
  },
  "@id": "http://example.com/",
  "ex:numbers": [ 14, 2.78 ],
  "ex:booleans": [ true, false ]
}
Example 71: Same example in Turtle using typed literals
@prefix ex: <http://example.com/vocab#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.com/>
  ex:numbers "14"^^xsd:integer, "2.78E0"^^xsd:double ;
ex:booleans
"true"^^xsd:boolean,
"false"^^xsd:boolean
.

Lists

Both JSON-LD and Turtle can represent sequential lists of values.

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
Example 72: A list of values in Turtle
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://example.org/people#joebob> a foaf:Person;
  foaf:name "Joe Bob";
foaf:nick
(
"joe"
"bob"
"jaybee"
)
.
{
Example 73: Same example with a list of values in JSON-LD
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/"
  },
  "@id": "http://example.org/people#joebob",
  "@type": "foaf:Person",
  "foaf:name": "Joe Bob",
  "foaf:nick":
  {
    "@list": [ "joe", "bob", "jaybee" ]
  }
}

B.3 D.2 RDFa

This section is non-normative.

The following example describes three people with their respective names and homepages. homepages in RDFa [ RDFA-CORE ].

>
Example 74: RDFa fragment that describes three people
<div prefix="foaf: http://xmlns.com/foaf/0.1/">
   <ul>
      <li typeof="foaf:Person">
        <a >Bob</a>

        <a rel="foaf:homepage" href="http://example.com/bob/" property="foaf:name">Bob</a>

      </li>
      <li typeof="foaf:Person">
        <a >Eve</a>

        <a rel="foaf:homepage" href="http://example.com/eve/" property="foaf:name">Eve</a>

      </li>
      <li typeof="foaf:Person">
        <a >Manu</a>

        <a rel="foaf:homepage" href="http://example.com/manu/" property="foaf:name">Manu</a>

      </li>
   </ul>
</div>

An example JSON-LD implementation using a single context is described below.

{
Example 75: Same description in JSON-LD (context shared among node objects)
{
  "@context":
  {
    "foaf": "http://xmlns.com/foaf/0.1/"
  },
  "@graph":
  [
    {
      "@type": "foaf:Person",
      "foaf:homepage": "http://example.com/bob/",
      "foaf:name": "Bob"
    },
    {
      "@type": "foaf:Person",
      "foaf:homepage": "http://example.com/eve/",
      "foaf:name": "Eve"
    },
    {
      "@type": "foaf:Person",
      "foaf:homepage": "http://example.com/manu/",
      "foaf:name": "Manu"
    }
  ]
}

B.4 D.3 Microformats

This section is non-normative.

The following example uses a simple Microformats hCard example to express how the Microformat is Microformats [ MICROFORMATS ] are represented in JSON-LD.

<div class="vcard">
Example 76: HTML fragment with a simple Microformats hCard
<div class="vcard">
 <a class="url fn" href="http://tantek.com/">Tantek Çelik</a>
</div>

The representation of the hCard expresses the Microformat terms in the context and uses them directly for the url and fn properties. Also note that the Microformat to JSON-LD processor has generated the proper URL type for http://tantek.com/ .

{
Example 77: Same hCard representation in JSON-LD
{
  "@context":
  {
    "vcard": "http://microformats.org/profile/hcard#vcard",
    "url":
    {
      "@id": "http://microformats.org/profile/hcard#url",
      "@type": "@id"
    },
    "fn": "http://microformats.org/profile/hcard#fn"
  },
  "@type": "vcard",
  "url": "http://tantek.com/",
  "fn": "Tantek Çelik"
}

B.5 D.4 Microdata

This section is non-normative.

The microdata HTML Microdata [ MICRODATA ] example below expresses book information as a microdata Microdata Work item.

<dl itemscope
Example 78: HTML fragments that describes a book using microdata
<dl itemscope
    itemtype="http://purl.org/vocab/frbr/core#Work"
    itemid="http://purl.oreilly.com/works/45U8QJGZSQKDH8N">
 <dt>Title</dt>
 <dd><cite itemprop="http://purl.org/dc/terms/title">Just a Geek</cite></dd>
 <dt>By</dt>
 <dd><span itemprop="http://purl.org/dc/terms/creator">Wil Wheaton</span></dd>
 <dt>Format</dt>
 <dd itemprop="http://purl.org/vocab/frbr/core#realization"
     itemscope
     itemtype="http://purl.org/vocab/frbr/core#Expression"
     itemid="http://purl.oreilly.com/products/9780596007683.BOOK">
  <link itemprop="http://purl.org/dc/terms/type" href="http://purl.oreilly.com/product-types/BOOK">
  Print
 </dd>
 <dd itemprop="http://purl.org/vocab/frbr/core#realization"
     itemscope
     itemtype="http://purl.org/vocab/frbr/core#Expression"
     itemid="http://purl.oreilly.com/products/9780596802189.EBOOK">
  <link itemprop="http://purl.org/dc/terms/type" href="http://purl.oreilly.com/product-types/EBOOK">
  Ebook
 </dd>
</dl>

Note that the JSON-LD representation of the Microdata information stays true to the desires of the Microdata community to avoid contexts and instead refer to items by their full IRI .

[
Example 79: Same book description in JSON-LD (avoiding contexts)
[
  {
    "@id": "http://purl.oreilly.com/works/45U8QJGZSQKDH8N",
    "@type": "http://purl.org/vocab/frbr/core#Work",
    "http://purl.org/dc/terms/title": "Just a Geek",
    "http://purl.org/dc/terms/creator": "Whil Wheaton",
    "http://purl.org/vocab/frbr/core#realization":
    [
      "http://purl.oreilly.com/products/9780596007683.BOOK",
      "http://purl.oreilly.com/products/9780596802189.EBOOK"
    ]
  },
  {
    "@id": "http://purl.oreilly.com/products/9780596007683.BOOK",
    "@type": "http://purl.org/vocab/frbr/core#Expression",
    "http://purl.org/dc/terms/type": "http://purl.oreilly.com/product-types/BOOK"
  },
  {
    "@id": "http://purl.oreilly.com/products/9780596802189.EBOOK",
    "@type": "http://purl.org/vocab/frbr/core#Expression",
    "http://purl.org/dc/terms/type": "http://purl.oreilly.com/product-types/EBOOK"
  }
]

C. E. IANA Considerations

This section is non-normative.

This section is included merely for standards community review and will be submitted to the Internet Engineering Steering Group if (IESG) as part of the Last Call announcement for this specification becomes a W3C Recommendation. specification.

application/ld+json

Type name:
application
Subtype name:
ld+json
Required parameters:
None
Optional parameters:
form profile
Determines

A a non-empty list of space-separated URIs identifying specific constraints or conventions that apply to a JSON-LD document according [ RFC6906 ]. A profile does not change the serialization form for semantics of the JSON-LD document. resource representation when processed without profile knowledge, so that clients both with and without knowledge of a profiled resource can safely use the same representation. The only valid value at profile parameter may be used by clients to express their preferences in the moment content negotiation process. It is RECOMMENDED that profile URIs are dereferenceable and provide useful documentation at that URI. For more information and background please refer to [ RFC6906 ].

This specification defines three values for the expanded . If no form is specified in an HTTP profile parameter. To request header to an HTTP server, or specify Expanded JSON-LD document form, the server may URI http://www.w3.org/ns/json-ld#expanded SHOULD choose any form. If no form is specified be used. To request or specify Compacted JSON-LD document form, the URI http://www.w3.org/ns/json-ld#compacted SHOULD be used. To request or specify Flattened JSON-LD document form, the URI http://www.w3.org/ns/json-ld#flattened SHOULD be used. Please note that, according [ HTTP11 ], the value of the profile parameter has to be enclosed in an HTTP response, quotes ( " ) because it contains special characters and, if multiple profiles are combined, whitespace.

When processing the form must "profile" media type parameter, it is important to note that its value is contains one or more URIs and not IRIs. In some cases it might therefore be assumed necessary to take any particular form. convert between IRIs and URIs as specified in section 3 Relationship between IRIs and URIs of [ RFC3987 ].

Encoding considerations:
The same as the application/json MIME media type. See RFC 6839, section 3.1.
Security considerations:
Since JSON-LD is intended to be a pure data exchange format for directed graphs, the serialization should not SHOULD NOT be passed through a code execution mechanism such as JavaScript's eval() function. function to be parsed.
JSON-LD contexts that are loaded from the Web over non-secure connections, such as HTTP, run the risk of modifying the JSON-LD active context in a way that could compromise security. It is recommended advised that any application that depends on a conforming parser does not attempt remote context for mission critical purposes vet and cache the remote context before allowing the system to directly evaluate use it.
Given that JSON-LD allows the substitution of long IRIs with short terms, JSON-LD serialization and instead purely parse documents may expand considerably when processed and, in the input into a language-native worst case, the resulting data structure. might consume all of the recipient's resources. Applications should treat any data with due skepticism.
Interoperability considerations:
Not Applicable
Published specification:
The JSON-LD specification. http://www.w3.org/TR/json-ld
Applications that use this media type:
Any programming environment that requires the exchange of directed graphs. Implementations of JSON-LD have been created for JavaScript, Python, Ruby, PHP PHP, and C++.
Additional information:
Magic number(s):
Not Applicable
File extension(s):
.jsonld
Macintosh file type code(s):
TEXT
Person & email address to contact for further information:
Manu Sporny <msporny@digitalbazaar.com>
Intended usage:
Common
Restrictions on usage:
None
Author(s):
Manu Sporny, Dave Longley, Gregg Kellogg, Markus Lanthaler, Dave Longley Niklas Lindström
Change controller:
W3C

Fragment identifiers used with application/ld+json resources may identify a node in the linked data graph expressed in the resource. This idiom, which is also used are treated as in RDF syntaxes, as per RDF 1.1 Concepts and Abstract Syntax [ RDF-CONCEPTS RDF11-CONCEPTS ], gives a simple way to "mint" new, document-local IRIs to label nodes and therefore contributes considerably to the expressive power of JSON-LD. ].

D. F. Acknowledgements

This section is non-normative.

The editors authors would like to thank extend a deep appreciation and the most sincere thanks to Mark Birbeck, who provided contributed foundational concepts to JSON-LD via his work on RDFj. JSON-LD uses a great deal number of core concepts introduced in RDFj, such as the initial push behind context as a mechanism to provide an environment for interpreting JSON data. Mark had also been very involved in the JSON-LD work via his on RDFa as well. RDFj built upon that work. JSON-LD exists because of the work and ideas he started nearly a decade ago in 2004.

A large amount of thanks goes out to the JSON-LD Community Group participants who worked through many of the technical issues on RDFj, Dave the mailing list and the weekly telecons - of special mention are François Daoust, Stéphane Corlosquet, Lin Clark, and Zdenko 'Denny' Vrandečić.

The work of David I. Lehn and Mike Johnson who reviewed, provided feedback, are appreciated for reviewing, and performed performing several early implementations of the specification, and specification. Thanks also to Ian Davis, who created Davis for this work on RDF/JSON.

Thanks also to Nathan Rixham, Bradley P. Allen, Kingsley Idehen, Glenn McDonald, the following individuals, in order of their first name, for their input on the specification: Adrian Walker, Alexandre Passant, Andy Seaborne, Ben Adida, Blaine Cook, Bradley Allen, Brian Peterson, Bryan Thompson, Conal Tuohy, Dan Brickley, Danny Ayers, Ted Thibodeau Jr., Olivier Grisel, Josh Mandel, Eric Prud'hommeaux, Daniel Leja, Dave Reynolds, David I. Lehn, David Wood, Dean Landolt, Ed Summers, elf Pavlik, Eric Prud'hommeaux, Erik Wilde, Fabian Christ, Jon A. Frost, Gavin Carothers, Glenn McDonald, Guus Schreiber, Henri Bergius, Jose María Alvarez Rodríguez, Ivan Herman, Jack Moffitt, Josh Mandel, KANZAKI Masahide, Kingsley Idehen, Kuno Woudt, Larry Garfield, Mark Baker, Mark MacGillivray, Marko Rodriguez, Melvin Carvalho, Nathan Rixham, Olivier Grisel, Paolo Ciccarese, Pat Hayes, Patrick Logan, Paul Kuykendall, Pelle Braendgaard, Peter Williams, Pierre-Antoine Champin, Richard Cyganiak, Roy T. Fielding, Sandro Hawke, Srecko Joksimovic, Stephane Fellah, Steve Harris, Ted Thibodeau Jr., Thomas Steiner, Tim Bray, Tom Morris, Tristan King, Sergio Fernández, Werner Wilms, and Richard Cyganiak for their input on the specification. William Waites.

E. G. References

E.1 G.1 Normative references

[BCP47]
A. Phillips; M. Davis. Tags for Identifying Languages . September 2009. IETF Best Current Practice. URL: http://tools.ietf.org/html/bcp47
[JSON-LD-API]
[RFC2119]
S. Bradner. The JSON-LD API 1.0 Manu Sporny, Gregg Kellogg, Dave Longley, Markus Lanthaler, Editors. World Wide Web Consortium (work Key words for use in progress). 24 May 2012. Editor's Draft. This edition of the JSON-LD Syntax specification is http://json-ld.org/spec/ED/json-ld-api/20120524/. The latest edition of the JSON-LD Syntax is available at http://json-ld.org/spec/latest/json-ld-api/ [RDF-CONCEPTS] RFCs to Indicate Requirement Levels. RDF 1.1 Concepts and Abstract Syntax Richard Cyganiak, David Wood, Editors. World Wide Web Consortium (work in progress). 30 May 2012. Editor's Draft. This edition of the JSON-LD Syntax specification is http://www.w3.org/TR/2011/WD-rdf11-concepts-20110830/. The latest edition of the JSON-LD Syntax March 1997. Internet RFC 2119. URL: http://www.ietf.org/rfc/rfc2119.txt is available at http://www.w3.org/TR/rdf11-concepts/
[RFC3987]
M. Dürst; M. Suignard. Internationalized Resource Identifiers (IRIs). (IRIs) (RFC 3987) . January 2005. Internet RFC 3987. RFC. URL: http://www.ietf.org/rfc/rfc3987.txt
[RFC4627]
D. Crockford. The application/json Media Type for JavaScript Object Notation (JSON) (RFC 4627) . July 2006. Internet RFC 4627. RFC. URL: http://www.ietf.org/rfc/rfc4627.txt
[RFC5988]
M. Nottingham. Web Linking . M. Nottingham. Editor. October 2010. IETF Standard. Internet RFC 5988. URL: http://tools.ietf.org/rfc/rfc5988.txt http://www.ietf.org/rfc/rfc5988.txt

E.2 G.2 Informative references

[RDF-PRIMER]
[HTTP11]
Frank Manola; Eric Miller.
R. Fielding et al. RDF Primer. Hypertext Transfer Protocol - HTTP/1.1 . June 1999. RFC 2616. URL: http://www.ietf.org/rfc/rfc2616.txt
[JSON-LD-API]
Markus Lanthaler, Gregg Kellogg, Manu Sporny, Editors. JSON-LD 1.0 Processing Algorithms and API . W3C Working Draft (work in progress). URL: http://www.w3.org/TR/2013/WD-json-ld-api-20130411/ . The latest edition is available at http://www.w3.org/TR/json-ld-api/
[JSON-LD-TESTS]
JSON-LD 1.0 Test Suite . W3C Test Suite (work in progress). URL: http://www.w3.org/2013/json-ld-tests/
[MICRODATA]
Ian Hickson, Editor. HTML Microdata . 25 October 2012. W3C Working Draft (work in progress). URL: http://www.w3.org/TR/2012/WD-microdata-20121025/ . The latest edition is available at http://www.w3.org/TR/microdata/
[MICROFORMATS]
Microformats . URL: http://microformats.org
[RDF-SCHEMA]
Dan Brickley; Ramanathan V. Guha. RDF Vocabulary Description Language 1.0: RDF Schema . 10 February 2004. W3C Recommendation. URL: http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ http://www.w3.org/TR/2004/REC-rdf-schema-20040210
[RDF11-CONCEPTS]
Richard Cyganiak, David Wood, Editors. RDF 1.1 Concepts and Abstract Syntax. 15 January 2013. W3C Working Draft (work in progress). URL: http://www.w3.org/TR/2013/WD-rdf11-concepts-20130115/ . The latest edition is available at http://www.w3.org/TR/rdf11-concepts/
[RDFA-CORE]
Shane McCarron; McCarron et al. RDFa Core 1.1: Syntax and processing rules for embedding RDF through attributes. attributes . 7 June 2012. W3C Recommendation. URL: http://www.w3.org/TR/rdfa-core/ http://www.w3.org/TR/2012/REC-rdfa-core-20120607/
[TURTLE-TR]
[RFC3986]
T. Berners-Lee; R. Fielding; L. Masinter. Uniform Resource Identifier (URI): Generic Syntax (RFC 3986) . January 2005. RFC. URL: http://www.ietf.org/rfc/rfc3986.txt
[RFC6906]
Erik Wilde. The 'profile' Link Relation Type . March 2013. Internet RFC 6906. URL: http://www.ietf.org/rfc/rfc6906.txt
[TURTLE]
Eric Prud'hommeaux, Gavin Carothers. Carothers, Editors. Turtle: Terse RDF Triple Language. 09 August 2011. 19 February 2013. W3C Working Draft. Candidate Recommendation (work in progress). URL: http://www.w3.org/TR/2011/WD-turtle-20110809/ http://www.w3.org/TR/2013/CR-turtle-20130219/ . The latest edition is available at http://www.w3.org/TR/turtle/