Add static PR specs and diffs
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 22 Oct 2013 18:58:43 +0200
changeset 2048 f898fc0dbe1b
parent 2047 497a5904c236
child 2049 ea9ca435c90f
Add static PR specs and diffs

There have been some minor issues in the static syntax PR spec so I've recreated that one as well. I've also reverted the editor's drafts to use the ED template.
spec/PR/json-ld-api/20131105/diff-20130910.html
spec/PR/json-ld-api/20131105/index.html
spec/PR/json-ld/20131105/diff-20130910.html
spec/PR/json-ld/20131105/index.html
spec/latest/json-ld-api/index.html
spec/latest/json-ld/index.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/PR/json-ld-api/20131105/diff-20130910.html	Tue Oct 22 18:58:43 2013 +0200
@@ -0,0 +1,35946 @@
+<html lang="en" dir="ltr" typeof="bibo:Document w3p:PR" about="" property="dcterms:language" content="en" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>JSON-LD 1.0 Processing Algorithms and API</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<style type="text/css">
+/*<![CDATA[*/
+  .highlight {
+    font-weight: bold;
+    color: #0a3;
+  }
+  .comment {
+    color: #999;
+  }
+  .error a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+  }
+  ol.algorithm {
+    counter-reset: numsection;
+    list-style-type: none;
+  }
+  ol.algorithm li {
+    margin: 0.5em 0;
+  }
+  ol.algorithm li:before {
+    font-weight: bold;
+    counter-increment: numsection;
+    content: counters(numsection, ".") ") ";
+  }
+/*]]>*/
+</style>
+
+<style type="text/css">
+/*<![CDATA[*/
+/* --- INLINES --- */
+em.rfc2119 {
+    text-transform:     lowercase;
+    font-variant:       small-caps;
+    font-style:         normal;
+    color:              #900;
+}
+
+h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
+h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
+    border: none;
+}
+
+dfn {
+    font-weight:    bold;
+}
+
+a.internalDFN {
+    color:  inherit;
+    border-bottom:  1px solid #99c;
+    text-decoration:    none;
+}
+
+a.externalDFN {
+    color:  inherit;
+    border-bottom:  1px dotted #ccc;
+    text-decoration:    none;
+}
+
+a.bibref {
+    text-decoration:    none;
+}
+
+cite .bibref {
+    font-style: normal;
+}
+
+code {
+    color:  #ff4500;
+}
+
+/* --- TOC --- */
+.toc a, .tof a {
+    text-decoration:    none;
+}
+
+a .secno, a .figno {
+    color:  #000;
+}
+
+ul.tof, ol.tof {
+    list-style: none outside none;
+}
+
+.caption {
+    margin-top: 0.5em;
+    font-style:   italic;
+}
+
+/* --- TABLE --- */
+table.simple {
+    border-spacing: 0;
+    border-collapse:    collapse;
+    border-bottom:  3px solid #005a9c;
+}
+
+.simple th {
+    background: #005a9c;
+    color:  #fff;
+    padding:    3px 5px;
+    text-align: left;
+}
+
+.simple th[scope="row"] {
+    background: inherit;
+    color:  inherit;
+    border-top: 1px solid #ddd;
+}
+
+.simple td {
+    padding:    3px 10px;
+    border-top: 1px solid #ddd;
+}
+
+.simple tr:nth-child(even) {
+    background: #f0f6ff;
+}
+
+/* --- DL --- */
+.section dd > p:first-child {
+    margin-top: 0;
+}
+
+.section dd > p:last-child {
+    margin-bottom: 0;
+}
+
+.section dd {
+    margin-bottom:  1em;
+}
+
+.section dl.attrs dd, .section dl.eldef dd {
+    margin-bottom:  0;
+}
+/*]]>*/
+</style>
+
+<style type="text/css">
+/*<![CDATA[*/
+/* --- EXAMPLES --- */
+div.example-title {
+    min-width: 7.5em;
+    color: #b9ab2d;
+}
+div.example-title span {
+    text-transform: uppercase;
+}
+aside.example, div.example, div.illegal-example {
+    padding: 0.5em;
+    margin: 1em 0;
+    position: relative;
+    clear: both;
+}
+div.illegal-example { color: red }
+div.illegal-example p { color: black }
+aside.example, div.example {
+    padding: .5em;
+    border-left-width: .5em;
+    border-left-style: solid;
+    border-color: #e0cb52;
+    background: #fcfaee;
+}
+
+aside.example div.example {
+    border-left-width: .1em;
+    border-color: #999;
+    background: #fff;
+}
+aside.example div.example div.example-title {
+    color: #999;
+}
+/*]]>*/
+</style>
+
+<style type="text/css">
+/*<![CDATA[*/
+/* --- ISSUES/NOTES --- */
+div.issue-title, div.note-title {
+    padding-right:  1em;
+    min-width: 7.5em;
+    color: #b9ab2d;
+}
+div.issue-title { color: #e05252; }
+div.note-title { color: #2b2; }
+div.issue-title span, div.note-title span {
+    text-transform: uppercase;
+}
+div.note, div.issue {
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+.note > p:first-child, .issue > p:first-child { margin-top: 0 }
+.issue, .note {
+    padding: .5em;
+    border-left-width: .5em;
+    border-left-style: solid;
+}
+div.issue, div.note {
+    padding: 1em 1.2em 0.5em;
+    margin: 1em 0;
+    position: relative;
+    clear: both;
+}
+span.note, span.issue { padding: .1em .5em .15em; }
+
+.issue {
+    border-color: #e05252;
+    background: #fbe9e9;
+}
+.note {
+    border-color: #52e052;
+    background: #e9fbe9;
+}
+
+
+/*]]>*/
+</style>
+
+<style type="text/css">
+/*<![CDATA[*/
+/* --- WEB IDL --- */
+pre.idl {
+    border-top: 1px solid #90b8de;
+    border-bottom: 1px solid #90b8de;
+    padding:    1em;
+    line-height:    120%;
+}
+
+pre.idl::before {
+    content:    "WebIDL";
+    display:    block;
+    width:      150px;
+    background: #90b8de;
+    color:  #fff;
+    font-family:    initial;
+    padding:    3px;
+    font-weight:    bold;
+    margin: -1em 0 1em -1em;
+}
+
+.idlType {
+    color:  #ff4500;
+    font-weight:    bold;
+    text-decoration:    none;
+}
+
+/*.idlModule*/
+/*.idlModuleID*/
+/*.idlInterface*/
+.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
+    font-weight:    bold;
+    color:  #005a9c;
+}
+a.idlEnumItem {
+    color:  #000;
+    border-bottom:  1px dotted #ccc;
+    text-decoration: none;
+}
+
+.idlSuperclass {
+    font-style: italic;
+    color:  #005a9c;
+}
+
+/*.idlAttribute*/
+.idlAttrType, .idlFieldType, .idlMemberType {
+    color:  #005a9c;
+}
+.idlAttrName, .idlFieldName, .idlMemberName {
+    color:  #ff4500;
+}
+.idlAttrName a, .idlFieldName a, .idlMemberName a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+}
+
+/*.idlMethod*/
+.idlMethType, .idlCallbackType {
+    color:  #005a9c;
+}
+.idlMethName {
+    color:  #ff4500;
+}
+.idlMethName a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+}
+
+/*.idlCtor*/
+.idlCtorName {
+    color:  #ff4500;
+}
+.idlCtorName a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+}
+
+/*.idlParam*/
+.idlParamType {
+    color:  #005a9c;
+}
+.idlParamName, .idlDefaultValue {
+    font-style: italic;
+}
+
+.extAttr {
+    color:  #666;
+}
+
+/*.idlSectionComment*/
+.idlSectionComment {
+    color: gray;
+}
+
+/*.idlConst*/
+.idlConstType {
+    color:  #005a9c;
+}
+.idlConstName {
+    color:  #ff4500;
+}
+.idlConstName a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+}
+
+/*.idlException*/
+.idlExceptionID {
+    font-weight:    bold;
+    color:  #c00;
+}
+
+.idlTypedefID, .idlTypedefType {
+    color:  #005a9c;
+}
+
+.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
+    color:  #c00;
+    font-weight:    normal;
+}
+
+.excName a {
+    font-family:    monospace;
+}
+
+.idlRaises a.idlType, .excName a.idlType {
+    border-bottom:  1px dotted #c00;
+}
+
+.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
+    width:  45px;
+    text-align: center;
+}
+.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
+.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
+
+.idlImplements a {
+    font-weight:    bold;
+}
+
+dl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {
+    margin-left:    2em;
+}
+
+.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {
+    font-weight:    normal;
+}
+
+.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {
+    font-weight:    bold;
+    color:  #000;
+    font-family:    monospace;
+}
+
+.attributes dt code, .fields dt code, .dictionary-members dt code {
+    background:  #ffffd2;
+}
+
+.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
+    color:  #005a9c;
+    background:  transparent;
+    font-family:    inherit;
+    font-weight:    normal;
+    font-style: italic;
+}
+
+.methods dt code {
+    background:  #d9e6f8;
+}
+
+.constants dt code {
+    background:  #ddffd2;
+}
+
+.constructors dt code {
+    background:  #cfc;
+}
+
+.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {
+    margin-bottom:  1em;
+}
+
+table.parameters, table.exceptions {
+    border-spacing: 0;
+    border-collapse:    collapse;
+    margin: 0.5em 0;
+    width:  100%;
+}
+table.parameters { border-bottom:  1px solid #90b8de; }
+table.exceptions { border-bottom:  1px solid #deb890; }
+
+.parameters th, .exceptions th {
+    color:  #fff;
+    padding:    3px 5px;
+    text-align: left;
+    font-family:    initial;
+    font-weight:    normal;
+    text-shadow:    #666 1px 1px 0;
+}
+.parameters th { background: #90b8de; }
+.exceptions th { background: #deb890; }
+
+.parameters td, .exceptions td {
+    padding:    3px 10px;
+    border-top: 1px solid #ddd;
+    vertical-align: top;
+}
+
+.parameters tr:first-child td, .exceptions tr:first-child td {
+    border-top: none;
+}
+
+.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
+    width:  100px;
+}
+
+.parameters td.prmType {
+    width:  120px;
+}
+
+table.exceptions table {
+    border-spacing: 0;
+    border-collapse:    collapse;
+    width:  100%;
+}
+/*]]>*/
+</style>
+<link href="https://www.w3.org/StyleSheets/TR/W3C-PR" rel="stylesheet" type="text/css" /><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]-->
+<style type='text/css'>
+.diff-old-a {
+  font-size: smaller;
+  color: red;
+}
+
+.diff-new { background-color: yellow; }
+.diff-chg { background-color: lime; }
+.diff-new:before,
+.diff-new:after
+    { content: "\2191" }
+.diff-chg:before, .diff-chg:after
+    { content: "\2195" }
+.diff-old { text-decoration: line-through; background-color: #FBB; }
+.diff-old:before,
+.diff-old:after
+    { content: "\2193" }
+:focus { border: thin red solid}
+</style>
+</head>
+<body id="respecDocument" role="document" class="h-entry">
+<div id="respecHeader" role="contentinfo" class="head">
+<p>
+<a href="http://www.w3.org/">
+<img src="https://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" />
+</a>
+</p>
+<h1 class="title p-name" id="title" property="dcterms:title">
+JSON-LD
+1.0
+Processing
+Algorithms
+and
+API
+</h1>
+<h2 id="w3c-proposed-recommendation-05-november-2013" property="dcterms:issued" datatype="xsd:dateTime" content="2013-11-04T23:00:00.000Z">
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+<del class="diff-old">Candidate
+</del>
+<ins class="diff-chg">Proposed
+</ins>
+Recommendation
+<del class="diff-old">10
+September
+</del>
+<time class="dt-published" datetime="2013-11-05">
+<ins class="diff-chg">05
+November
+</ins>
+2013
+</time>
+</h2>
+<dl>
+<dt>
+This
+version:
+</dt>
+<dd>
+<del class="diff-old">http://www.w3.org/TR/2013/CR-json-ld-api-20130910/
+</del>
+<a class="u-url" href="http://www.w3.org/TR/2013/PR-json-ld-api-20131105/">
+<ins class="diff-chg">http://www.w3.org/TR/2013/PR-json-ld-api-20131105/
+</ins>
+</a>
+</dd>
+<dt>
+Latest
+published
+version:
+</dt>
+<dd>
+<a href="http://www.w3.org/TR/json-ld-api/">
+http://www.w3.org/TR/json-ld-api/
+</a>
+</dd>
+<dt>
+Latest
+editor's
+draft:
+</dt>
+<dd>
+<a href="http://dvcs.w3.org/hg/json-ld/raw-file/default/spec/latest/json-ld-api/index.html">
+http://dvcs.w3.org/hg/json-ld/raw-file/default/spec/latest/json-ld-api/index.html
+</a>
+</dd>
+<dt>
+Test
+suite:
+</dt>
+<dd>
+<a href="http://www.w3.org/2013/json-ld-tests/">
+http://www.w3.org/2013/json-ld-tests/
+</a>
+</dd>
+<dt>
+Previous
+version:
+</dt>
+<dd>
+<del class="diff-old">http://www.w3.org/TR/2013/WD-json-ld-api-20130516/
+</del>
+<a rel="dcterms:replaces" href="http://www.w3.org/TR/2013/CR-json-ld-api-20130910/">
+<ins class="diff-chg">http://www.w3.org/TR/2013/CR-json-ld-api-20130910/
+</ins>
+</a>
+</dd>
+<dt>
+Editors:
+</dt>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Markus Lanthaler" href="http://www.markus-lanthaler.com/">
+Markus
+Lanthaler
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.tugraz.at/">
+Graz
+University
+of
+Technology
+</a>
+</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Gregg Kellogg" href="http://greggkellogg.net/">
+Gregg
+Kellogg
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://kellogg-assoc.com/">
+Kellogg
+Associates
+</a>
+</span>
+</dd>
+<dd class="p-author h-card vcard" rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Manu Sporny" href="http://manu.sporny.org/">
+Manu
+Sporny
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://digitalbazaar.com/">
+Digital
+Bazaar
+</a>
+</span>
+</dd>
+<dt>
+Authors:
+</dt>
+<dd class="p-author h-card vcard" rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Dave Longley" href="http://digitalbazaar.com/">
+Dave
+Longley
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://digitalbazaar.com/">
+Digital
+Bazaar
+</a>
+</span>
+</dd>
+<dd class="p-author h-card vcard" rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Gregg Kellogg" href="http://greggkellogg.net/">
+Gregg
+Kellogg
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://kellogg-assoc.com/">
+Kellogg
+Associates
+</a>
+</span>
+</dd>
+<dd class="p-author h-card vcard" rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Markus Lanthaler" href="http://www.markus-lanthaler.com/">
+Markus
+Lanthaler
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.tugraz.at/">
+Graz
+University
+of
+Technology
+</a>
+</span>
+</dd>
+<dd class="p-author h-card vcard" rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a class="u-url url p-name fn" rel="foaf:homepage" property="foaf:name" content="Manu Sporny" href="http://digitalbazaar.com/">
+Manu
+Sporny
+</a>,
+<a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://digitalbazaar.com/">
+Digital
+Bazaar
+</a>
+</span>
+</dd>
+</dl>
+<p>
+This
+document
+is
+also
+available
+in
+this
+non-normative
+format:
+<a rel="alternate" href="diff-20130910.html">
+diff
+to
+previous
+version
+</a>
+</p>
+<p class="copyright">
+<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
+Copyright
+</a>

+2010-2013
+<a href="http://www.w3.org/">
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+</a>
+<sup>

+</sup>
+(
+<a href="http://www.csail.mit.edu/">
+<abbr title="Massachusetts Institute of Technology">
+MIT
+</abbr>
+</a>,
+<a href="http://www.ercim.eu/">
+<abbr title="European Research Consortium for Informatics and Mathematics">
+ERCIM
+</abbr>
+</a>,
+<a href="http://www.keio.ac.jp/">
+Keio
+</a>,
+<a href="http://ev.buaa.edu.cn/">
+Beihang
+</a>
+),
+All
+Rights
+Reserved.
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">
+liability
+</a>,
+<a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">
+trademark
+</a>
+and
+<a href="http://www.w3.org/Consortium/Legal/copyright-documents">
+document
+use
+</a>
+rules
+apply.
+</p>
+<hr />
+</div>
+<section rel="bibo:chapter" resource="#abstract" typeof="bibo:Chapter" datatype="" property="dcterms:abstract" class="introductory" id="abstract">
+<h2 id="h2_abstract" role="heading" aria-level="1">
+Abstract
+</h2>
+<p>
+This
+specification
+defines
+<del class="diff-old">an
+Application
+Programming
+Interface
+(API)
+and
+</del>
+a
+set
+of
+algorithms
+for
+programmatic
+transformations
+of
+JSON-LD
+documents.
+Restructuring
+data
+according
+to
+the
+defined
+transformations
+often
+dramatically
+simplifies
+its
+usage.
+<ins class="diff-new">Furthermore,
+this
+document
+proposes
+an
+Application
+Programming
+Interface
+(API)
+for
+developers
+implementing
+the
+specified
+algorithms.
+</ins>
+</p>
+</section>
+<section rel="bibo:chapter" resource="#sotd" typeof="bibo:Chapter" id="sotd" class="introductory">
+<h2 id="h2_sotd" role="heading" aria-level="1">
+Status
+of
+This
+Document
+</h2>
+<p>
+<em>
+This
+section
+describes
+the
+status
+of
+this
+document
+at
+the
+time
+of
+its
+publication.
+Other
+documents
+may
+supersede
+this
+document.
+A
+list
+of
+current
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+publications
+and
+the
+latest
+revision
+of
+this
+technical
+report
+can
+be
+found
+in
+the
+<a href="http://www.w3.org/TR/">
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+technical
+reports
+index
+</a>
+at
+http://www.w3.org/TR/.
+</em>
+</p>
+<p>
+This
+document
+has
+been
+under
+development
+for
+over
+<del class="diff-old">30
+</del>
+<ins class="diff-chg">31
+</ins>
+months
+in
+the
+JSON
+for
+Linking
+Data
+Community
+Group.
+The
+document
+has
+been
+transferred
+to
+the
+RDF
+Working
+Group
+for
+review,
+improvement,
+and
+publication
+along
+the
+Recommendation
+track.
+The
+specification
+has
+undergone
+significant
+development,
+review,
+and
+changes
+during
+the
+course
+of
+the
+last
+<del class="diff-old">30
+</del>
+<ins class="diff-chg">31
+</ins>
+months.
+</p>
+<p>
+There
+are
+several
+independent
+<a href="http://json-ld.org/test-suite/reports/">
+interoperable
+implementations
+</a>
+of
+this
+specification.
+There
+is
+a
+fairly
+complete
+test
+suite
+[
+<cite>
+<a href="#bib-JSON-LD-TESTS" class="bibref">
+JSON-LD-TESTS
+</a>
+</cite>
+]
+and
+a
+<a href="http://json-ld.org/playground/">
+live
+JSON-LD
+editor
+</a>
+that
+is
+capable
+of
+demonstrating
+the
+features
+described
+in
+this
+document.
+While
+there
+will
+be
+continuous
+development
+on
+implementations,
+the
+test
+suite,
+and
+the
+live
+editor,
+they
+are
+believed
+to
+be
+mature
+enough
+to
+be
+integrated
+into
+a
+non-production
+system
+at
+this
+point
+in
+time.
+There
+is
+an
+expectation
+that
+they
+could
+be
+used
+in
+a
+production
+system
+within
+the
+next
+<del class="diff-old">three
+</del>
+<ins class="diff-chg">two
+</ins>
+months.
+</p>
+<p>
+<del class="diff-old">The
+following
+features
+are
+at
+risk
+and
+may
+be
+removed:
+Support
+for
[email protected]:
+null
+Allow
+blank
+nodes
+to
+be
+used
+as
+properties
+Properly
+referencing
+the
+DOM
+Promises
+spec
+Lists
+of
+lists
+and
+partial
+list
+conversion
+from
+RDF
+</del>
+Changes
+since
+the
+<a href="http://www.w3.org/TR/2013/WD-json-ld-api-20130411/">
+<del class="diff-old">11&nbsp;April&nbsp;2013
+</del>
+<ins class="diff-chg">11&#160;April&#160;2013
+</ins>
+Last
+Call
+Working
+Draft
+</a>:
+</p>
+<ul>
+<li>
+Use
+of
+DOM
+Futures
+instead
+of
+callbacks
+in
+the
+Application
+Programming
+Interface
+</li>
+<li>
+Processing
+of
+terms
+that
+are
+redefined
+to
+themselves
+without
+raising
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.cyclic-IRI-mapping">
+cyclic
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+</li>
+<li>
+Raise
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+if
+relative
+URLs
+are
+used
+in
+term
+definitions
+</li>
+<li>
+Support
+relative
+IRIs
+in
+<code>
[email protected]
+</code>
+</li>
+<li>
+Remove
+default
+value
+of
+<code class="idlMemberName">
+<a href="#idl-def-JsonLdOptions">
+JsonLdOption's
+</a>
+</code>
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-base">
+base
+</a>
+</code>
+member
+</li>
+<li>
+Support
+lists
+of
+lists
+when
+serializing
+RDF
+as
+JSON-LD
+</li>
+<li>
+Support
+for
+relative
+URLs
+in
+<code>
[email protected]
+</code>
+and
+documents
+that
+do
+not
+have
+a
+base
+value
+</li>
+</ul>
+<p>
+Changes
+since
+the
+<a href="http://www.w3.org/TR/2013/WD-json-ld-api-20130516/">
+<del class="diff-old">16&nbsp;May&nbsp;2013
+</del>
+<ins class="diff-chg">16&#160;May&#160;2013
+</ins>
+Last
+Call
+Working
+Draft
+</a>:
+</p>
+<ul>
+<li>
+Ensure
+determinism
+of
+the
+Deserialize
+JSON-LD
+to
+RDF
+algorithm
+by
+specifying
+the
+processing
+order
+</li>
+<li>
+Change
+the
+default
+value
+of
+the
+<em>
+use
+native
+types
+</em>
+flag
+in
+the
+Serialize
+RDF
+as
+JSON-LD
+algorithm
+to
+<code>
+false
+</code>
+</li>
+<li>
+Clarify
+that
+the
+<i>
+identifier
+map
+</i>
+and
+the
+<i>
+counter
+</i>
+used
+by
+the
+Generate
+Blank
+Node
+Identifier
+algorithm
+are
+reset
+before
+running
+the
+Flattening
+and
+the
+Deserialize
+JSON-LD
+to
+RDF
+algorithms
+</li>
+<li>
+Raise
+an
+error
+if
+a
+blank
+node
+is
+used
+as
+data
+type
+</li>
+<li>
+Clarify
+that
+blank
+node
+identifier
+are
+supported
+as
+value
+of
+<code>
[email protected]
+</code>
+</li>
+<li>
+When
+generating
+RDF,
+exclude
+<a href="#dfn-rdf-triple" title="rdf-triple" class="tref internalDFN">
+triples
+</a>
+containing
+a
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+node
+</a>
+<a href="#dfn-rdf-predicate" title="rdf-predicate" class="tref internalDFN">
+predicate
+</a>,
+unless
+the
+<i>
+produce
+generalized
+RDF
+</i>
+flag
+is
+set;
+discard
+<a href="#dfn-rdf-triple" title="rdf-triple" class="tref internalDFN">
+triples
+</a>
+containing
+relative
+IRIs
+and
+graphs
+with
+a
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+as
+graph
+name
+</li>
+<li>
+Update
+reference
+to
+DOM
+Promises
+(have
+been
+called
+DOM
+Futures)
+</li>
+<li>
+Fix
+bug
+in
+<a href="#serialize-rdf-as-json-ld-algorithm">
+Serialize
+RDF
+to
+JSON-LD
+algorithm
+</a>
+to
+handle
+lists
+correctly
+</li>
+<li>
+Support
+processing
+of
+documents
+with
+a
+<code>
++json
+</code>
+media
+type
+as
+defined
+in
+[
+<cite>
+<a href="#bib-RFC6839" class="bibref">
+RFC6839
+</a>
+</cite>
+]
+</li>
+<li>
+Use
+the
+<a class="idlType" href="#idl-def-LoadDocumentCallback">
+<code>
+LoadDocumentCallback
+</code>
+</a>
+(previously
+<code>
+LoadContextCallback
+</code>
+)
+to
+retrieve
+remote
+contexts
+and
+remote
+documents
+</li>
+<li>
+Allow
+contexts
+to
+be
+passed
+into
+the
+API
+directly.
+Previously
+only
+context
+documents,
+i.e.,
+objects
+having
+a
+<code>
[email protected]
+</code>
+member
+were
+allowed.
+</li>
+<li>
+Clarify
+the
+usage
+of
+the
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-documentLoader">
+documentLoader
+</a>
+</code>
+option.
+</li>
+</ul>
+<p>
+<ins class="diff-new">Changes
+since
+the
+</ins><a href="http://www.w3.org/TR/2013/CR-json-ld-api-20130910/"><ins class="diff-new">
+10&#160;September&#160;2013
+Candidate
+Recommendation
+</ins></a>:</p><ul><li><ins class="diff-new">
+Fixed
+a
+bug
+that
+relabeled
+blank
+node
+identifiers
+used
+with
+reverse
+properties
+inconsistently
+when
+creating
+a
+node
+map
+.
+</ins></li><li><ins class="diff-new">
+Made
+the
+API
+non-normative
+given
+that
+Promises
+are
+still
+not
+properly
+specified.
+</ins></li></ul><p>
+This
+document
+was
+published
+by
+the
+<a href="http://www.w3.org/2011/rdf-wg/">
+RDF
+Working
+Group
+</a>
+as
+a
+<del class="diff-old">Candidate
+</del>
+<ins class="diff-chg">Proposed
+</ins>
+Recommendation.
+This
+document
+is
+intended
+to
+become
+a
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+Recommendation.
+<del class="diff-old">If
+you
+wish
+</del>
+<ins class="diff-chg">The
+</ins><abbr title="World Wide Web Consortium"><ins class="diff-chg">
+W3C
+</ins></abbr><ins class="diff-chg">
+Membership
+and
+other
+interested
+parties
+are
+invited
+</ins>
+to
+<del class="diff-old">make
+comments
+regarding
+this
+document,
+please
+</del>
+<ins class="diff-chg">review
+the
+document
+and
+</ins>
+send
+<del class="diff-old">them
+</del>
+<ins class="diff-chg">comments
+</ins>
+to
+<a rel="discussion" href="mailto:[email protected]">
[email protected]
+</a>
+(
+<a href="mailto:[email protected]?subject=subscribe">
+subscribe
+</a>,
+<a href="http://lists.w3.org/Archives/Public/public-rdf-comments/">
+archives
+</a>
+<del class="diff-old">).
+W3C
+publishes
+a
+Candidate
+Recommendation
+to
+indicate
+</del>
+<ins class="diff-chg">)
+through
+05
+December
+2013.
+Advisory
+Committee
+Representatives
+should
+consult
+their
+</ins><a href="https://www.w3.org/2002/09/wbs/myQuestionnaires"><ins class="diff-chg">
+WBS
+questionnaires
+</ins></a>.<ins class="diff-chg">
+Note
+</ins>
+that
+<del class="diff-old">the
+document
+is
+believed
+to
+be
+stable
+and
+to
+encourage
+implementation
+by
+the
+developer
+community.
+This
+Candidate
+Recommendation
+is
+</del>
+<ins class="diff-chg">substantive
+technical
+comments
+were
+</ins>
+expected
+<del class="diff-old">to
+advance
+to
+Proposed
+Recommendation
+no
+earlier
+than
+01
+October
+</del>
+<ins class="diff-chg">during
+the
+Last
+Call
+review
+period
+that
+ended
+06
+June
+</ins>
+2013.
+<del class="diff-old">All
+comments
+are
+welcome.
+</del>
+</p>
+<p>
+Publication
+as
+a
+<del class="diff-old">Candidate
+</del>
+<ins class="diff-chg">Proposed
+</ins>
+Recommendation
+does
+not
+imply
+endorsement
+by
+the
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+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.
+</p>
+<p>
+<del class="diff-old">Before
+this
+specification
+exits
+Candidate
+Recommendation,
+two
+or
+more
+independent
+implementations
+must
+pass
+each
+test,
+although
+no
+single
+implementation
+must
+pass
+each
+test.
+The
+working
+group
+will
+decide
+when
+the
+test
+suite
+is
+of
+sufficient
+quality
+to
+test
+interoperability
+and
+will
+produce
+an
+implementation
+report
+(hosted
+together
+with
+the
+test
+suite).
+</del>
+This
+document
+was
+produced
+by
+a
+group
+operating
+under
+the
+<a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">
+5
+February
+2004
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+Patent
+Policy
+</a>.
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+maintains
+a
+<a href="http://www.w3.org/2004/01/pp-impl/46168/status" rel="disclosure">
+public
+list
+of
+any
+patent
+disclosures
+</a>
+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
+<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
+Essential
+Claim(s)
+</a>
+must
+disclose
+the
+information
+in
+accordance
+with
+<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
+section
+6
+of
+the
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+Patent
+Policy
+</a>.
+</p>
+</section>
+<section id="toc">
+<h2 id="h2_toc" role="heading" aria-level="1" class="introductory">
+Table
+of
+Contents
+</h2>
+<ul id="respecContents" role="directory" class="toc">
+<li class="tocline">
+<a class="tocxref" href="#introduction">
+<span class="secno">
+1.
+</span>
+Introduction
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#features">
+<span class="secno">
+2.
+</span>
+Features
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#expansion">
+<span class="secno">
+2.1
+</span>
+Expansion
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#compaction">
+<span class="secno">
+2.2
+</span>
+Compaction
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#flattening">
+<span class="secno">
+2.3
+</span>
+Flattening
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#rdf-serialization-deserialization">
+<span class="secno">
+2.4
+</span>
+RDF
+Serialization/Deserialization
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#conformance">
+<span class="secno">
+3.
+</span>
+Conformance
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#general-terminology">
+<span class="secno">
+4.
+</span>
+General
+Terminology
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#algorithm-terms">
+<span class="secno">
+5.
+</span>
+Algorithm
+Terms
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#context-processing-algorithms">
+<span class="secno">
+6.
+</span>
+Context
+Processing
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#context-processing-algorithm">
+<span class="secno">
+6.1
+</span>
+Context
+Processing
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#create-term-definition">
+<span class="secno">
+6.2
+</span>
+Create
+Term
+Definition
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#iri-expansion">
+<span class="secno">
+6.3
+</span>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#expansion-algorithms">
+<span class="secno">
+7.
+</span>
+Expansion
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#expansion-algorithm">
+<span class="secno">
+7.1
+</span>
+Expansion
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#value-expansion">
+<span class="secno">
+7.2
+</span>
+Value
+Expansion
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#compaction-algorithms">
+<span class="secno">
+8.
+</span>
+Compaction
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#compaction-algorithm">
+<span class="secno">
+8.1
+</span>
+Compaction
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#inverse-context-creation">
+<span class="secno">
+8.2
+</span>
+Inverse
+Context
+Creation
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#iri-compaction">
+<span class="secno">
+8.3
+</span>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Compaction
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#term-selection">
+<span class="secno">
+8.4
+</span>
+Term
+Selection
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#value-compaction">
+<span class="secno">
+8.5
+</span>
+Value
+Compaction
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#flattening-algorithms">
+<span class="secno">
+9.
+</span>
+Flattening
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#flattening-algorithm">
+<span class="secno">
+9.1
+</span>
+Flattening
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#node-map-generation">
+<span class="secno">
+9.2
+</span>
+Node
+Map
+Generation
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#generate-blank-node-identifier">
+<span class="secno">
+9.3
+</span>
+Generate
+Blank
+Node
+Identifier
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#rdf-serialization-deserialization-algorithms">
+<span class="secno">
+10.
+</span>
+RDF
+Serialization/Deserialization
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#deserialize-json-ld-to-rdf-algorithm">
+<span class="secno">
+10.1
+</span>
+Deserialize
+JSON-LD
+to
+RDF
+algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#object-to-rdf-conversion">
+<span class="secno">
+10.2
+</span>
+Object
+to
+RDF
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#list-to-rdf-conversion">
+<span class="secno">
+10.3
+</span>
+List
+to
+RDF
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#serialize-rdf-as-json-ld-algorithm">
+<span class="secno">
+10.4
+</span>
+Serialize
+RDF
+as
+JSON-LD
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#rdf-to-object-conversion">
+<span class="secno">
+10.5
+</span>
+RDF
+to
+Object
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#data-round-tripping">
+<span class="secno">
+10.6
+</span>
+Data
+Round
+Tripping
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#the-application-programming-interface">
+<span class="secno">
+11.
+</span>
+The
+Application
+Programming
+Interface
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#the-jsonldprocessor-interface">
+<span class="secno">
+11.1
+</span>
+The
+<span class="formerLink">
+<code>
+JsonLdProcessor
+</code>
+</span>
+Interface
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#the-jsonldoptions-type">
+<span class="secno">
+11.2
+</span>
+The
+<span class="formerLink">
+<code>
+JsonLdOptions
+</code>
+</span>
+Type
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#remote-document-and-context-retrieval">
+<span class="secno">
+11.3
+</span>
+Remote
+Document
+and
+Context
+Retrieval
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#error-handling">
+<span class="secno">
+11.4
+</span>
+Error
+Handling
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#acknowledgements">
+<span class="secno">
+A.
+</span>
+Acknowledgements
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#references">
+<span class="secno">
+B.
+</span>
+References
+</a>
+<ul class="toc">
+<li class="tocline">
+<a class="tocxref" href="#normative-references">
+<span class="secno">
+B.1
+</span>
+Normative
+references
+</a>
+</li>
+<li class="tocline">
+<a class="tocxref" href="#informative-references">
+<span class="secno">
+B.2
+</span>
+Informative
+references
+</a>
+</li>
+</ul>
+</li>
+</ul>
+</section>
+<section id="introduction" class="informative">
+<h2 id="h2_introduction" role="heading" aria-level="1">
+<span class="secno">
+1.
+</span>
+Introduction
+</h2>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+This
+document
+is
+a
+detailed
+specification
+<del class="diff-old">for
+an
+Application
+Programming
+Interface
+for
+</del>
+<ins class="diff-chg">of
+</ins>
+the
+JSON-LD
+<del class="diff-old">syntax.
+</del>
+<ins class="diff-chg">processing
+algorithms.
+</ins>
+The
+document
+is
+primarily
+intended
+for
+the
+following
+audiences:
+</p>
+<ul>
+<li>
+<del class="diff-old">Developers
+</del>
+<ins class="diff-chg">Software
+developers
+</ins>
+who
+want
+<del class="diff-old">an
+overview
+of
+</del>
+<ins class="diff-chg">to
+implement
+</ins>
+the
+<ins class="diff-new">algorithms
+to
+transform
+</ins>
+JSON-LD
+<del class="diff-old">API.
+</del>
+<ins class="diff-chg">documents.
+</ins>
+</li>
+<li>
+Web
+authors
+and
+developers
+who
+want
+a
+very
+detailed
+view
+of
+how
+a
+<a href="#dfn-json-ld-processor" title="json-ld-processor" class="tref internalDFN">
+JSON-LD
+Processor
+</a>
+<del class="diff-old">or
+a
+JSON-LD
+API
+Implementation
+</del>
+operates.
+</li>
+<li>
+<del class="diff-old">Software
+developers
+</del>
+<ins class="diff-chg">Developers
+</ins>
+who
+want
+<del class="diff-old">to
+implement
+</del>
+<ins class="diff-chg">an
+overview
+of
+</ins>
+the
+<del class="diff-old">algorithms
+to
+transform
+</del>
+<ins class="diff-chg">proposed
+</ins>
+JSON-LD
+<del class="diff-old">documents.
+</del>
+<ins class="diff-chg">API.
+</ins>
+</li>
+</ul>
+<p>
+To
+understand
+the
+basics
+in
+this
+specification
+you
+must
+first
+be
+familiar
+with
+JSON,
+which
+is
+detailed
+in
+[
+<cite>
+<a href="#bib-RFC4627" class="bibref">
+RFC4627
+</a>
+</cite>
+].
+You
+must
+also
+understand
+the
+JSON-LD
+syntax
+defined
+in
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+],
+which
+is
+the
+base
+syntax
+used
+by
+all
+of
+the
+algorithms
+in
+this
+document.
+To
+understand
+the
+API
+and
+how
+it
+is
+intended
+to
+operate
+in
+a
+programming
+environment,
+it
+is
+useful
+to
+have
+working
+knowledge
+of
+the
+JavaScript
+programming
+language
+[
+<cite>
+<a href="#bib-ECMA-262" class="bibref">
+ECMA-262
+</a>
+</cite>
+]
+and
+WebIDL
+[
+<cite>
+<a href="#bib-WEBIDL" class="bibref">
+WEBIDL
+</a>
+</cite>
+].
+To
+understand
+how
+JSON-LD
+maps
+to
+RDF,
+it
+is
+helpful
+to
+be
+familiar
+with
+the
+basic
+RDF
+concepts
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</p>
+</section>
+<section id="features" class="informative">
+<h2 id="h2_features" role="heading" aria-level="1">
+<span class="secno">
+2.
+</span>
+Features
+</h2>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+The
+JSON-LD
+Syntax
+specification
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+]
+defines
+a
+syntax
+to
+express
+Linked
+Data
+in
+JSON.
+Because
+there
+is
+more
+than
+one
+way
+to
+express
+Linked
+Data
+using
+this
+syntax,
+it
+is
+often
+useful
+to
+be
+able
+to
+transform
+JSON-LD
+documents
+so
+that
+they
+may
+be
+more
+easily
+consumed
+by
+specific
+applications.
+</p>
+<p>
+JSON-LD
+uses
+<a href="#dfn-context" title="context" class="tref internalDFN">
+contexts
+</a>
+to
+allow
+Linked
+Data
+to
+be
+expressed
+in
+a
+way
+that
+is
+specifically
+tailored
+to
+a
+particular
+person
+or
+application.
+By
+providing
+a
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>,
+JSON
+data
+can
+be
+expressed
+in
+a
+way
+that
+is
+a
+natural
+fit
+for
+a
+particular
+person
+or
+application
+whilst
+also
+indicating
+how
+the
+data
+should
+be
+understood
+at
+a
+global
+scale.
+In
+order
+for
+people
+or
+applications
+to
+share
+data
+that
+was
+created
+using
+a
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+that
+is
+different
+from
+their
+own,
+a
+JSON-LD
+processor
+must
+be
+able
+to
+transform
+a
+document
+from
+one
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+to
+another.
+Instead
+of
+requiring
+JSON-LD
+processors
+to
+write
+specific
+code
+for
+every
+imaginable
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+switching
+scenario,
+it
+is
+much
+easier
+to
+specify
+a
+single
+algorithm
+that
+can
+remove
+any
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>.
+Similarly,
+another
+algorithm
+can
+be
+specified
+to
+subsequently
+apply
+any
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>.
+These
+two
+algorithms
+represent
+the
+most
+basic
+transformations
+of
+JSON-LD
+documents.
+They
+are
+referred
+to
+as
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+expansion
+</a>
+and
+<a href="#dfn-compaction" title="compaction" class="tref internalDFN">
+compaction
+</a>,
+respectively.
+</p>
+<p>
+There
+are
+four
+major
+types
+of
+transformation
+that
+are
+discussed
+in
+this
+document:
+expansion,
+compaction,
+flattening,
+and
+RDF
+serialization/deserialization.
+</p>
+<section id="expansion" class="informative">
+<h3 id="h3_expansion" role="heading" aria-level="2">
+<span class="secno">
+2.1
+</span>
+Expansion
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+The
+algorithm
+that
+removes
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+is
+called
+<dfn id="dfn-expansion" title="expansion">
+expansion
+</dfn>.
+Before
+performing
+any
+other
+transformations
+on
+a
+JSON-LD
+document,
+it
+is
+easiest
+to
+remove
+any
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+from
+it
+and
+to
+make
+data
+structures
+more
+regular.
+</p>
+<p>
+To
+get
+an
+idea
+of
+how
+context
+and
+data
+structuring
+affects
+the
+same
+data,
+here
+is
+an
+example
+of
+JSON-LD
+that
+uses
+only
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+and
+is
+fairly
+compact:
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+1
+</ins></span>:<ins class="diff-chg">
+Sample
+JSON-LD
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    }
+  },
+  "@id": "http://me.markus-lanthaler.com/",
+  "name": "Markus Lanthaler",
+  "homepage": "http://www.markus-lanthaler.com/"
+}
+</pre>
+</div>
+<p>
+The
+next
+input
+example
+uses
+one
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+to
+express
+a
+property
+and
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+to
+encapsulate
+another,
+but
+leaves
+the
+rest
+of
+the
+information
+untouched.
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+2
+</ins></span>:<ins class="diff-chg">
+Sample
+JSON-LD
+document
+using
+an
+IRI
+instead
+of
+a
+term
+to
+express
+a
+property
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@context": {
+<del class="diff-old">    
+</del>
+    <span class="highlight">"website": "http://xmlns.com/foaf/0.1/homepage"</span>
+  },
+  "@id": "http://me.markus-lanthaler.com/",
+<del class="diff-old">  "": "Markus Lanthaler",
+  
+</del>
+<ins class="diff-chg">  "<span class="highlight">http://xmlns.com/foaf/0.1/name</span>": "Markus Lanthaler",
+</ins>  <span class="highlight">"website"</span>: <span class="highlight">{ "@id":</span> "http://www.markus-lanthaler.com/" <span class="highlight">}</span>
+}
+</pre>
+</div>
+<p>
+Note
+that
+both
+inputs
+are
+valid
+JSON-LD
+and
+both
+represent
+the
+same
+information.
+The
+difference
+is
+in
+their
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+information
+and
+in
+the
+data
+structures
+used.
+A
+JSON-LD
+processor
+can
+remove
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+and
+ensure
+that
+the
+data
+is
+more
+regular
+by
+employing
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+expansion
+</a>.
+</p>
+<p>
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+Expansion
+</a>
+has
+two
+important
+goals:
+removing
+any
+contextual
+information
+from
+the
+document,
+and
+ensuring
+all
+values
+are
+represented
+in
+a
+regular
+form.
+These
+goals
+are
+accomplished
+by
+expanding
+all
+properties
+to
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+IRIs
+</a>
+and
+by
+expressing
+all
+values
+in
+<a href="#dfn-array" title="array" class="tref internalDFN">
+arrays
+</a>
+in
+<a href="#dfn-expanded-form" title="expanded-form" class="tref internalDFN">
+expanded
+form
+</a>.
+<a href="#dfn-expanded-form" title="expanded-form" class="tref internalDFN">
+Expanded
+form
+</a>
+is
+the
+most
+verbose
+and
+regular
+way
+of
+expressing
+of
+values
+in
+JSON-LD;
+all
+contextual
+information
+from
+the
+document
+is
+instead
+stored
+locally
+with
+each
+value.
+Running
+the
+<a href="#expansion-algorithm">
+Expansion
+algorithm
+</a>
+(
+<code class="idlMemberName">
+<a href= "#widl-JsonLdProcessor-expand-Promise-any-input-JsonLdOptions-options">
+expand
+</a>
+</code>
+operation)
+against
+the
+above
+examples
+results
+in
+the
+following
+output:
+</p>
+<del class="diff-old">    [
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+3
+</ins></span>:<ins class="diff-chg">
+Expanded
+sample
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+[
+</ins>
+  {
+    "@id": "http://me.markus-lanthaler.com/",
+    "http://xmlns.com/foaf/0.1/name": [
+      { "@value": "Markus Lanthaler" }
+    ],
+    "http://xmlns.com/foaf/0.1/homepage": [
+      { "@id": "http://www.markus-lanthaler.com/" }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Note
+that
+in
+the
+output
+above
+all
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+definitions
+have
+been
+removed,
+all
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+and
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+IRIs
+</a>
+have
+been
+expanded
+to
+absolute
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>,
+and
+all
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+values
+</a>
+are
+expressed
+in
+<a href="#dfn-array" title="array" class="tref internalDFN">
+arrays
+</a>
+in
+<a href="#dfn-expanded-form" title="expanded-form" class="tref internalDFN">
+expanded
+form
+</a>.
+While
+the
+output
+is
+more
+verbose
+and
+difficult
+for
+a
+human
+to
+read,
+it
+establishes
+a
+baseline
+that
+makes
+JSON-LD
+processing
+easier
+because
+of
+its
+very
+regular
+structure.
+</p>
+</section>
+<section id="compaction" class="informative">
+<h3 id="h3_compaction" role="heading" aria-level="2">
+<span class="secno">
+2.2
+</span>
+Compaction
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+While
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+expansion
+</a>
+removes
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+from
+a
+given
+input,
+<a href="#dfn-compaction" title="compaction" class="tref internalDFN">
+compaction's
+</a>
+primary
+function
+is
+to
+perform
+the
+opposite
+operation:
+to
+express
+a
+given
+input
+according
+to
+a
+particular
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>.
+<dfn id="dfn-compaction" title="compaction">
+Compaction
+</dfn>
+applies
+a
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+that
+specifically
+tailors
+the
+way
+information
+is
+expressed
+for
+a
+particular
+person
+or
+application.
+This
+simplifies
+applications
+that
+consume
+JSON
+or
+JSON-LD
+by
+expressing
+the
+data
+in
+application-specific
+terms,
+and
+it
+makes
+the
+data
+easier
+to
+read
+by
+humans.
+</p>
+<p>
+<a href="#dfn-compaction" title="compaction" class="tref internalDFN">
+Compaction
+</a>
+uses
+a
+developer-supplied
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+to
+shorten
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>
+to
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+or
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+IRIs
+</a>
+and
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+values
+</a>
+expressed
+in
+<a href="#dfn-expanded-form" title="expanded-form" class="tref internalDFN">
+expanded
+form
+</a>
+to
+simple
+values
+such
+as
+<a href="#dfn-string" title="string" class="tref internalDFN">
+strings
+</a>
+or
+<a href="#dfn-number" title="number" class="tref internalDFN">
+numbers
+</a>.
+</p>
+<p>
+For
+example,
+assume
+the
+following
+expanded
+JSON-LD
+input
+document:
+</p>
+<del class="diff-old">    [
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+4
+</ins></span>:<ins class="diff-chg">
+Expanded
+sample
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+[
+</ins>
+  {
+    "@id": "http://me.markus-lanthaler.com/",
+    "http://xmlns.com/foaf/0.1/name": [
+      { "@value": "Markus Lanthaler" }
+    ],
+    "http://xmlns.com/foaf/0.1/homepage": [
+      { "@id": "http://www.markus-lanthaler.com/" }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Additionally,
+assume
+the
+following
+developer-supplied
+JSON-LD
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>:
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+5
+</ins></span>:<ins class="diff-chg">
+JSON-LD
+context
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    }
+  }
+}
+</pre>
+</div>
+<p>
+Running
+the
+<a href="#compaction-algorithm">
+Compaction
+Algorithm
+</a>
+(
+<code class="idlMemberName">
+<a href="#widl-JsonLdProcessor-compact-Promise-any-input-JsonLdContext-context-JsonLdOptions-options">
+compact
+</a>
+</code>
+operation)
+given
+the
+context
+supplied
+above
+against
+the
+JSON-LD
+input
+document
+provided
+above
+would
+result
+in
+the
+following
+output:
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+6
+</ins></span>:<ins class="diff-chg">
+Compacted
+sample
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    }
+  },
+  "@id": "http://me.markus-lanthaler.com/",
+  "name": "Markus Lanthaler",
+  "homepage": "http://www.markus-lanthaler.com/"
+}
+</pre>
+</div>
+<p>
+Note
+that
+all
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>
+have
+been
+compacted
+to
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+as
+specified
+in
+the
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>,
+which
+has
+been
+injected
+into
+the
+output.
+While
+compacted
+output
+is
+useful
+to
+humans,
+it
+is
+also
+used
+to
+generate
+structures
+that
+are
+easy
+to
+program
+against.
+Compaction
+enables
+developers
+to
+map
+any
+expanded
+document
+into
+an
+application-specific
+compacted
+document.
+While
+the
+context
+provided
+above
+mapped
+<code>
+http://xmlns.com/foaf/0.1/name
+</code>
+to
+<code>
+name
+</code>,
+it
+could
+also
+have
+been
+mapped
+to
+any
+other
+term
+provided
+by
+the
+developer.
+</p>
+</section>
+<section id="flattening" class="informative">
+<h3 id="h3_flattening" role="heading" aria-level="2">
+<span class="secno">
+2.3
+</span>
+Flattening
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+While
+expansion
+ensures
+that
+a
+document
+is
+in
+a
+uniform
+structure,
+flattening
+goes
+a
+step
+further
+to
+ensure
+that
+the
+shape
+of
+the
+data
+is
+deterministic.
+In
+expanded
+documents,
+the
+properties
+of
+a
+single
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+may
+be
+spread
+across
+a
+number
+of
+different
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+objects
+</a>.
+By
+flattening
+a
+document,
+all
+properties
+of
+a
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+are
+collected
+in
+a
+single
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+and
+all
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+nodes
+</a>
+are
+labeled
+with
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>.
+This
+may
+drastically
+simplify
+the
+code
+required
+to
+process
+JSON-LD
+data
+in
+certain
+applications.
+</p>
+<p>
+For
+example,
+assume
+the
+following
+JSON-LD
+input
+document:
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+7
+</ins></span>:<ins class="diff-chg">
+Sample
+JSON-LD
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@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": [
+    {
+      "name": "Dave Longley"
+    }
+  ]
+}
+</pre>
+</div>
+<p>
+Running
+the
+<a href="#flattening-algorithm">
+Flattening
+algorithm
+</a>
+(
+<code class="idlMemberName">
+<a href="#widl-JsonLdProcessor-flatten-Promise-any-input-JsonLdContext-context-JsonLdOptions-options">
+flatten
+</a>
+</code>
+operation)
+with
+a
+context
+set
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+to
+prevent
+compaction
+returns
+the
+following
+document:
+</p>
+<del class="diff-old">    [
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+8
+</ins></span>:<ins class="diff-chg">
+Flattened
+sample
+document
+in
+expanded
+form
+</ins></div><pre class="example"><ins class="diff-chg">
+[
+</ins>
+  {
+    "@id": "_:t0",
+    "http://xmlns.com/foaf/0.1/name": [
+      { "@value": "Dave Longley" }
+    ]
+  },
+  {
+    "@id": "http://me.markus-lanthaler.com/",
+    "http://xmlns.com/foaf/0.1/name": [
+      { "@value": "Markus Lanthaler" }
+    ],
+    "http://xmlns.com/foaf/0.1/knows": [
+      { "@id": "_:t0" }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Note
+how
+in
+the
+output
+above
+all
+properties
+of
+a
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+are
+collected
+in
+a
+single
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+and
+how
+the
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+node
+</a>
+representing
+"Dave
+Longley"
+has
+been
+assigned
+the
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>
+<code>
+_:t0
+</code>.
+</p>
+<p>
+To
+make
+it
+easier
+for
+humans
+to
+read
+or
+for
+certain
+applications
+to
+process
+it,
+a
+flattened
+document
+can
+be
+compacted
+by
+passing
+a
+context.
+Using
+the
+same
+context
+as
+the
+input
+document,
+the
+flattened
+and
+compacted
+document
+looks
+as
+follows:
+</p>
+<del class="diff-old">    {
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+9
+</ins></span>:<ins class="diff-chg">
+Flattened
+and
+compacted
+sample
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+{
+</ins>
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "knows": "http://xmlns.com/foaf/0.1/knows"
+  },
+  "@graph": [
+    {
+      "@id": "_:t0",
+      "name": "Dave Longley"
+    },
+    {
+      "@id": "http://me.markus-lanthaler.com/",
+      "name": "Markus Lanthaler",
+      "knows": { "@id": "_:t0" }
+    }
+  ]
+}
+</pre>
+</div>
+<p>
+Please
+note
+that
+the
+result
+of
+flattening
+and
+compacting
+a
+document
+is
+always
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+which
+contains
+an
+<code>
[email protected]
+</code>
+member
+that
+represents
+the
+<a href="#dfn-default-graph" title="default-graph" class="tref internalDFN">
+default
+graph
+</a>.
+</p>
+</section>
+<section id="rdf-serialization-deserialization" class="informative">
+<h3 id="h3_rdf-serialization-deserialization" role="heading" aria-level="2">
+<span class="secno">
+2.4
+</span>
+RDF
+Serialization/Deserialization
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+JSON-LD
+can
+be
+used
+to
+serialize
+RDF
+data
+as
+described
+in
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+This
+ensures
+that
+data
+can
+be
+round-tripped
+to
+and
+from
+any
+RDF
+syntax
+without
+any
+loss
+in
+fidelity.
+</p>
+<p>
+For
+example,
+assume
+the
+following
+RDF
+input
+serialized
+in
+Turtle
+[
+<cite>
+<a href="#bib-TURTLE" class="bibref">
+TURTLE
+</a>
+</cite>
+]:
+</p>
+<del class="diff-old">    &lt;http://me.markus-lanthaler.com/&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; "Markus Lanthaler" .
+&lt;http://me.markus-lanthaler.com/&gt;
+&lt;http://xmlns.com/foaf/0.1/homepage&gt;
+&lt;http://www.markus-lanthaler.com/&gt;
+.
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+10
+</ins></span>:<ins class="diff-chg">
+Sample
+Turtle
+document
+</ins></div><pre class="example"><ins class="diff-chg">
+&lt;http://me.markus-lanthaler.com/&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; "Markus Lanthaler" .
+&lt;http://me.markus-lanthaler.com/&gt; &lt;http://xmlns.com/foaf/0.1/homepage&gt; &lt;http://www.markus-lanthaler.com/&gt; .
+</ins>
+</pre>
+</div>
+<p>
+Using
+the
+<a href="#serialize-rdf-as-json-ld-algorithm">
+Serialize
+RDF
+as
+JSON-LD
+algorithm
+</a>
+a
+developer
+could
+transform
+this
+document
+into
+expanded
+JSON-LD:
+</p>
+<del class="diff-old">    [
+</del>
+<div class="example">
+<div class="example-title">
+<span>
+<ins class="diff-chg">Example
+11
+</ins></span>:<ins class="diff-chg">
+Sample
+Turtle
+document
+converted
+to
+JSON-LD
+</ins></div><pre class="example"><ins class="diff-chg">
+[
+</ins>
+  {
+    "@id": "http://me.markus-lanthaler.com/",
+    "http://xmlns.com/foaf/0.1/name": [
+      { "@value": "Markus Lanthaler" }
+    ],
+    "http://xmlns.com/foaf/0.1/homepage": [
+      { "@id": "http://www.markus-lanthaler.com/" }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Note
+that
+the
+output
+above
+could
+easily
+be
+compacted
+using
+the
+technique
+outlined
+in
+the
+previous
+section.
+It
+is
+also
+possible
+to
+deserialize
+the
+JSON-LD
+document
+back
+to
+RDF
+using
+the
+<a href="#deserialize-json-ld-to-rdf-algorithm">
+Deserialize
+JSON-LD
+to
+RDF
+algorithm
+</a>.
+</p>
+</section>
+</section>
+<section id="conformance">
+<h2 id="h2_conformance" role="heading" aria-level="1">
+<span class="secno">
+3.
+</span>
+Conformance
+</h2>
+<p>
+All
+examples
+and
+notes
+as
+well
+as
+sections
+marked
+as
+non-normative
+in
+this
+specification
+are
+non-normative.
+Everything
+else
+in
+this
+specification
+is
+normative.
+</p>
+<p>
+The
+keywords
+<em title="MUST" class="rfc2119">
+MUST
+</em>,
+<em title="MUST NOT" class="rfc2119">
+MUST
+NOT
+</em>,
+<em title="REQUIRED" class="rfc2119">
+REQUIRED
+</em>,
+<em title="SHOULD" class="rfc2119">
+SHOULD
+</em>,
+<em title="SHOULD NOT" class="rfc2119">
+SHOULD
+NOT
+</em>,
+<em title="RECOMMENDED" class="rfc2119">
+RECOMMENDED
+</em>,
+<em title="MAY" class="rfc2119">
+MAY
+</em>,
+and
+<em title="OPTIONAL" class="rfc2119">
+OPTIONAL
+</em>
+in
+this
+specification
+are
+to
+be
+interpreted
+as
+described
+in
+[
+<cite>
+<a href="#bib-RFC2119" class="bibref">
+RFC2119
+</a>
+</cite>
+].
+</p>
+<p>
+There
+are
+<del class="diff-old">three
+</del>
+<ins class="diff-chg">two
+</ins>
+classes
+of
+products
+that
+can
+claim
+conformance
+to
+this
+specification:
+<a href="#dfn-json-ld-processor" title="json-ld-processor" class="tref internalDFN">
+JSON-LD
+Processors
+</a>,
+<del class="diff-old">JSON-LD
+API
+Implementations
+,
+</del>
+and
+<a href="#dfn-rdf-serializer/deserializer" title="rdf-serializer/deserializer" class="tref internalDFN">
+RDF
+Serializers/Deserializers
+</a>.
+</p>
+<p>
+A
+conforming
+<dfn id="dfn-json-ld-processor" title="json-ld-processor">
+JSON-LD
+Processor
+</dfn>
+is
+a
+system
+which
+can
+perform
+the
+<a href="#expansion-algorithm">
+Expansion
+</a>,
+<a href="#compaction-algorithm">
+Compaction
+</a>,
+and
+<a href="#flattening-algorithm">
+Flattening
+</a>
+operations
+defined
+in
+this
+specification.
+</p>
+<p>
+<del class="diff-old">A
+conforming
+JSON-LD
+API
+Implementation
+is
+a
+conforming
+JSON-LD
+Processor
+that
+exposes
+the
+Application
+Programming
+Interface
+(API)
+defined
+in
+this
+specification.
+It
+MUST
+implement
+the
+json-ld-1.0
+processing
+mode
+(for
+further
+details,
+see
+the
+processingMode
+option
+of
+JsonLdOptions
+).
+</del>
+<a href="#dfn-json-ld-processor" title="json-ld-processor" class="tref internalDFN">
+JSON-LD
+Processors
+</a>
+<del class="diff-old">and
+API
+Implementations
+</del>
+<em title="MUST NOT" class="rfc2119">
+MUST
+NOT
+</em>
+attempt
+to
+correct
+malformed
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>
+or
+language
+tags;
+however,
+they
+<em title="MAY" class="rfc2119">
+MAY
+</em>
+issue
+validation
+warnings.
+IRIs
+are
+not
+modified
+other
+than
+conversion
+between
+<a href="#dfn-relative-iri" title="relative-iri" class="tref internalDFN">
+relative
+</a>
+and
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+IRIs
+</a>.
+</p>
+<p>
+A
+conforming
+<dfn id="dfn-rdf-serializer/deserializer" title="rdf-serializer/deserializer">
+RDF
+Serializer/Deserializer
+</dfn>
+is
+a
+system
+that
+can
+<a href="#deserialize-json-ld-to-rdf-algorithm">
+deserialize
+JSON-LD
+to
+RDF
+</a>
+and
+<a href="#serialize-rdf-as-json-ld-algorithm">
+serialize
+RDF
+as
+JSON-LD
+</a>
+as
+defined
+in
+this
+specification.
+</p>
+<p>
+The
+algorithms
+in
+this
+specification
+are
+generally
+written
+with
+more
+concern
+for
+clarity
+than
+efficiency.
+Thus,
+<a href="#dfn-json-ld-processor" title="json-ld-processor" class="tref internalDFN">
+JSON-LD
+Processors
+</a>
+<del class="diff-old">and
+API
+Implementations
+</del>
+may
+implement
+the
+algorithms
+given
+in
+this
+specification
+in
+any
+way
+desired,
+so
+long
+as
+the
+end
+result
+is
+indistinguishable
+from
+the
+result
+that
+would
+be
+obtained
+by
+the
+specification's
+algorithms.
+</p>
+<div class="note">
+<div id="h_note_1" role="heading" aria-level="2" class="note-title">
+<span>
+Note
+</span>
+</div>
+<p class="">
+Implementers
+can
+partially
+check
+their
+level
+of
+conformance
+to
+this
+specification
+by
+successfully
+passing
+the
+test
+cases
+of
+the
+JSON-LD
+test
+suite
+[
+<cite>
+<a href="#bib-JSON-LD-TESTS" class="bibref">
+JSON-LD-TESTS
+</a>
+</cite>
+].
+Note,
+however,
+that
+passing
+all
+the
+tests
+in
+the
+test
+suite
+does
+not
+imply
+complete
+conformance
+to
+this
+specification.
+It
+only
+implies
+that
+the
+implementation
+conforms
+to
+aspects
+tested
+by
+the
+test
+suite.
+</p>
+</div>
+</section>
+<section id="general-terminology">
+<h2 id="h2_general-terminology" role="heading" aria-level="1">
+<span class="secno">
+4.
+</span>
+General
+Terminology
+</h2>
+<p>
+This
+document
+uses
+the
+following
+terms
+as
+defined
+in
+JSON
+[
+<cite>
+<a href="#bib-RFC4627" class="bibref">
+RFC4627
+</a>
+</cite>
+].
+Refer
+to
+the
+<em>
+JSON
+Grammar
+</em>
+section
+in
+[
+<cite>
+<a href="#bib-RFC4627" class="bibref">
+RFC4627
+</a>
+</cite>
+]
+for
+formal
+definitions.
+</p>
+<dl>
+<dt>
+<dfn id="dfn-json-object" title="json-object">
+JSON
+object
+</dfn>
+</dt>
+<dd>
+An
+object
+structure
+is
+represented
+as
+a
+pair
+of
+curly
+brackets
+surrounding
+zero
+or
+more
+key-value
+pairs.
+A
+key
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>.
+A
+single
+colon
+comes
+after
+each
+key,
+separating
+the
+key
+from
+the
+value.
+A
+single
+comma
+separates
+a
+value
+from
+a
+following
+key.
+In
+contrast
+to
+JSON,
+in
+JSON-LD
+the
+keys
+in
+an
+object
+must
+be
+unique.
+</dd>
+<dt>
+<dfn id="dfn-array" title="array">
+array
+</dfn>
+</dt>
+<dd>
+An
+array
+structure
+is
+represented
+as
+square
+brackets
+surrounding
+zero
+or
+more
+values.
+Values
+are
+separated
+by
+commas.
+In
+JSON,
+an
+array
+is
+an
+<em>
+ordered
+</em>
+sequence
+of
+zero
+or
+more
+values.
+While
+JSON-LD
+uses
+the
+same
+array
+representation
+as
+JSON,
+the
+collection
+is
+<em>
+unordered
+</em>
+by
+default.
+While
+order
+is
+preserved
+in
+regular
+JSON
+arrays,
+it
+is
+not
+in
+regular
+JSON-LD
+arrays
+unless
+specifically
+defined
+(see
+<cite>
+<a href="../json-ld/#sets-and-lists">
+Sets
+and
+Lists
+</a>
+</cite>
+in
+the
+JSON-LD
+specification
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+]).
+</dd>
+<dt>
+<dfn id="dfn-string" title="string">
+string
+</dfn>
+</dt>
+<dd>
+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.
+</dd>
+<dt>
+<dfn id="dfn-number" title="number">
+number
+</dfn>
+</dt>
+<dd>
+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.
+</dd>
+<dt>
+<dfn id="dfn-true" title="true">
+true
+</dfn>
+and
+<dfn id="dfn-false" title="false">
+false
+</dfn>
+</dt>
+<dd>
+Values
+that
+are
+used
+to
+express
+one
+of
+two
+possible
+boolean
+states.
+</dd>
+<dt>
+<dfn id="dfn-null" title="null">
+null
+</dfn>
+</dt>
+<dd>
+The
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+value.
+A
+key-value
+pair
+in
+the
+<code>
[email protected]
+</code>
+where
+the
+value,
+or
+the
+<code>
[email protected]
+</code>
+of
+the
+value,
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+explicitly
+decouples
+a
+term's
+association
+with
+an
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>.
+A
+key-value
+pair
+in
+the
+body
+of
+a
+JSON-LD
+document
+whose
+value
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+has
+the
+same
+meaning
+as
+if
+the
+key-value
+pair
+was
+not
+defined.
+If
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+or
+<code>
[email protected]
+</code>
+is
+set
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+in
+expanded
+form,
+then
+the
+entire
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+is
+ignored.
+</dd>
+</dl>
+<p>
+Furthermore,
+the
+following
+terminology
+is
+used
+throughout
+this
+document:
+</p>
+<dl>
+<dt>
+<dfn id="dfn-keyword" title="keyword">
+keyword
+</dfn>
+</dt>
+<dd>
+A
+JSON
+key
+that
+is
+specific
+to
+JSON-LD,
+specified
+in
+the
+section
+<cite>
+<a href="../json-ld/#syntax-tokens-and-keywords">
+Syntax
+Tokens
+and
+Keywords
+</a>
+</cite>
+of
+the
+JSON-LD
+specification
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-context" title="context">
+context
+</dfn>
+</dt>
+<dd>
+A
+set
+of
+rules
+for
+interpreting
+a
+JSON-LD
+document
+as
+specified
+in
+the
+section
+<cite>
+<a href="../json-ld/#the-context">
+The
+Context
+</a>
+</cite>
+of
+the
+JSON-LD
+specification
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-json-ld-document" title="json-ld-document">
+JSON-LD
+document
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-json-ld-document" title="json-ld-document" class="tref internalDFN">
+JSON-LD
+document
+</a>
+is
+a
+serialization
+of
+a
+collection
+of
+<a href="#dfn-graph" title="graph" class="tref internalDFN">
+graphs
+</a>
+and
+comprises
+exactly
+one
+<a href="#dfn-default-graph" title="default-graph" class="tref internalDFN">
+default
+graph
+</a>
+and
+zero
+or
+more
+<a href="#dfn-named-graph" title="named-graph" class="tref internalDFN">
+named
+graphs
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-named-graph" title="named-graph">
+named
+graph
+</dfn>
+</dt>
+<dd>
+A
+named
+graph
+is
+a
+pair
+consisting
+of
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+node
+</a>
+(the
+<dfn id="dfn-graph-name" title="graph-name">
+graph
+name
+</dfn>
+)
+and
+a
+<a href="#dfn-graph" title="graph" class="tref internalDFN">
+graph
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-default-graph" title="default-graph">
+default
+graph
+</dfn>
+</dt>
+<dd>
+The
+default
+graph
+is
+the
+only
+graph
+in
+a
+JSON-LD
+document
+which
+has
+no
+<a href="#dfn-graph-name" title="graph-name" class="tref internalDFN">
+graph
+name
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-graph" title="graph">
+Graph
+</dfn>
+</dt>
+<dd>
+A
+labeled
+directed
+graph,
+i.e.,
+a
+set
+of
+<a href="#dfn-node" title="node" class="tref internalDFN">
+nodes
+</a>
+connected
+by
+<a href="#dfn-edge" title="edge" class="tref internalDFN">
+edges
+</a>,
+as
+specified
+in
+the
+<cite>
+<a href="../json-ld/#data-model">
+Data
+Model
+</a>
+</cite>
+section
+of
+the
+JSON-LD
+specification
+[
+<cite>
+<a href="#bib-JSON-LD" class="bibref">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-edge" title="edge">
+edge
+</dfn>
+</dt>
+<dd>
+Every
+<a href="#dfn-edge" title="edge" class="tref internalDFN">
+edge
+</a>
+has
+a
+direction
+associated
+with
+it
+and
+is
+labeled
+with
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>.
+Within
+the
+JSON-LD
+syntax
+these
+edge
+labels
+are
+called
+<dfn id="dfn-property" title="property">
+properties
+</dfn>.
+Whenever
+possible,
+an
+<a href="#dfn-edge" title="edge" class="tref internalDFN">
+edge
+</a>
+should
+be
+labeled
+with
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-node" title="node">
+node
+</dfn>
+</dt>
+<dd>
+Every
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+is
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+a
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+node
+</a>,
+a
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+value
+</a>,
+or
+a
+<a href="#dfn-list" title="list" class="tref internalDFN">
+list
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-iri" title="iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>
+</dt>
+<dd>
+An
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+(Internationalized
+Resource
+Identifier)
+is
+a
+string
+that
+conforms
+to
+the
+syntax
+defined
+in
+[
+<cite>
+<a href="#bib-RFC3987" class="bibref">
+RFC3987
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-absolute-iri" title="absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>
+</dt>
+<dd>
+An
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+is
+defined
+in
+[
+<cite>
+<a href="#bib-RFC3987" class="bibref">
+RFC3987
+</a>
+</cite>
+]
+containing
+a
+<em>
+scheme
+</em>
+along
+with
+a
+<em>
+path
+</em>
+and
+optional
+<em>
+query
+</em>
+and
+fragment
+segments.
+</dd>
+<dt>
+<dfn id="dfn-relative-iri" title="relative-iri">
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>
+</dt>
+<dd>
+A
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+is
+an
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+that
+is
+relative
+to
+some
+other
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-blank-node" title="blank-node">
+blank
+node
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+in
+a
+<a href="#dfn-graph" title="graph" class="tref internalDFN">
+graph
+</a>
+that
+is
+neither
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+nor
+a
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+value
+</a>,
+nor
+a
+<a href="#dfn-list" title="list" class="tref internalDFN">
+list
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-blank-node-identifier" title="blank-node-identifier">
+blank
+node
+identifier
+</dfn>
+</dt>
+<dd>
+A
+blank
+node
+identifier
+is
+a
+string
+that
+can
+be
+used
+as
+an
+identifier
+for
+a
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+node
+</a>
+within
+the
+scope
+of
+a
+JSON-LD
+document.
+Blank
+node
+identifiers
+begin
+with
+<code>
+_:
+</code>.
+</dd>
+<dt>
+<dfn id="dfn-json-ld-value" title="json-ld-value">
+JSON-LD
+value
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+value
+</a>
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+a
+<a href="#dfn-number" title="number" class="tref internalDFN">
+number
+</a>,
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+or
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>,
+a
+<a href="#dfn-typed-value" title="typed-value" class="tref internalDFN">
+typed
+value
+</a>,
+or
+a
+<a href="#dfn-language-tagged-string" title="language-tagged-string" class="tref internalDFN">
+language-tagged
+string
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-typed-value" title="typed-value">
+typed
+value
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-typed-value" title="typed-value" class="tref internalDFN">
+typed
+value
+</a>
+consists
+of
+a
+value,
+which
+is
+a
+string,
+and
+a
+type,
+which
+is
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-language-tagged-string" title="language-tagged-string">
+language-tagged
+string
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-language-tagged-string" title="language-tagged-string" class="tref internalDFN">
+language-tagged
+string
+</a>
+consists
+of
+a
+string
+and
+a
+non-empty
+language
+tag
+as
+defined
+by
+[
+<cite>
+<a href="#bib-BCP47" class="bibref">
+BCP47
+</a>
+</cite>
+].
+The
+language
+tag
+must
+be
+well-formed
+according
+to
+<a href="http://tools.ietf.org/html/bcp47#section-2.2.9">
+section
+2.2.9
+Classes
+of
+Conformance
+</a>
+of
+[
+<cite>
+<a href="#bib-BCP47" class="bibref">
+BCP47
+</a>
+</cite>
+],
+and
+is
+normalized
+to
+lowercase.
+</dd>
+<dt>
+<dfn id="dfn-list" title="list">
+list
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-list" title="list" class="tref internalDFN">
+list
+</a>
+is
+an
+ordered
+sequence
+of
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>,
+<a href="#dfn-blank-node" title="blank-node" class="tref internalDFN">
+blank
+nodes
+</a>,
+and
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+values
+</a>.
+</dd>
+</dl>
+</section>
+<section id="algorithm-terms">
+<h2 id="h2_algorithm-terms" role="heading" aria-level="1">
+<span class="secno">
+5.
+</span>
+Algorithm
+Terms
+</h2>
+<dl>
+<dt>
+<dfn id="dfn-active-graph" title="active-graph">
+active
+graph
+</dfn>
+</dt>
+<dd>
+The
+name
+of
+the
+currently
+active
+graph
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn id="dfn-active-subject" title="active-subject">
+active
+subject
+</dfn>
+</dt>
+<dd>
+The
+currently
+active
+subject
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn id="dfn-active-property" title="active-property">
+active
+property
+</dfn>
+</dt>
+<dd>
+The
+currently
+active
+<a href="#dfn-property" title="property" class="tref internalDFN">
+property
+</a>
+or
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn id="dfn-active-context" title="active-context">
+active
+context
+</dfn>
+</dt>
+<dd>
+A
+context
+that
+is
+used
+to
+resolve
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+while
+the
+processing
+algorithm
+is
+running.
+</dd>
+<dt>
+<dfn id="dfn-local-context" title="local-context">
+local
+context
+</dfn>
+</dt>
+<dd>
+A
+context
+that
+is
+specified
+within
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+specified
+via
+the
+<code>
[email protected]
+</code>
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-json-ld-input" title="json-ld-input">
+JSON-LD
+input
+</dfn>
+</dt>
+<dd>
+The
+JSON-LD
+data
+structure
+that
+is
+provided
+as
+input
+to
+the
+algorithm.
+</dd>
+<dt>
+<dfn id="dfn-term" title="term">
+term
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+is
+a
+short
+word
+defined
+in
+a
+context
+that
+may
+be
+expanded
+to
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+</dd>
+<dt>
+<dfn id="dfn-compact-iri" title="compact-iri">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>
+</dt>
+<dd>
+A
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+has
+the
+form
+of
+<dfn id="dfn-prefix" title="prefix">
+prefix
+</dfn>:
+<em>
+suffix
+</em>
+and
+is
+used
+as
+a
+way
+of
+expressing
+an
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+without
+needing
+to
+define
+separate
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+definitions
+for
+each
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+contained
+within
+a
+common
+vocabulary
+identified
+by
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-node-object" title="node-object">
+node
+object
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-node-object" title="node-object" class="tref internalDFN">
+node
+object
+</a>
+represents
+zero
+or
+more
+properties
+of
+a
+<a href="#dfn-node" title="node" class="tref internalDFN">
+node
+</a>
+in
+the
+<a href="#dfn-graph" title="graph" class="tref internalDFN">
+graph
+</a>
+serialized
+by
+the
+JSON-LD
+document.
+A
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+is
+a
+<a href="#dfn-node-object" title="node-object" class="tref internalDFN">
+node
+object
+</a>
+if
+it
+exists
+outside
+of
+the
+JSON-LD
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+and:
+<ul>
+<li>
+it
+does
+not
+contain
+the
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+or
+<code>
[email protected]
+</code>
+keywords,
+or
+</li>
+<li>
+it
+is
+not
+the
+top-most
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+in
+the
+JSON-LD
+document
+consisting
+of
+no
+other
+members
+than
+<code>
[email protected]
+</code>
+and
+<code>
[email protected]
+</code>.
+</li>
+</ul>
+</dd>
+<dt>
+<dfn id="dfn-value-object" title="value-object">
+value
+object
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-value-object" title="value-object" class="tref internalDFN">
+value
+object
+</a>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn id="dfn-list-object" title="list-object">
+list
+object
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-list-object" title="list-object" class="tref internalDFN">
+list
+object
+</a>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn id="dfn-set-object" title="set-object">
+set
+object
+</dfn>
+</dt>
+<dd>
+A
+<a href="#dfn-set-object" title="set-object" class="tref internalDFN">
+set
+object
+</a>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn id="dfn-scalar" title="scalar">
+scalar
+</dfn>
+</dt>
+<dd>
+A
+scalar
+is
+either
+a
+JSON
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+<a href="#dfn-number" title="number" class="tref internalDFN">
+number
+</a>,
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+or
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>.
+</dd>
+<dt>
+<dfn id="dfn-rdf-subject" title="rdf-subject">
+RDF
+subject
+</dfn>
+</dt>
+<dd>
+A
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-subject" title="subject" class="tref externalDFN">
+subject
+</a>
+as
+specified
+by
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-rdf-predicate" title="rdf-predicate">
+RDF
+predicate
+</dfn>
+</dt>
+<dd>
+A
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-predicate" title="predicate" class="tref externalDFN">
+predicate
+</a>
+as
+specified
+by
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-rdf-object" title="rdf-object">
+RDF
+object
+</dfn>
+</dt>
+<dd>
+An
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-object" title="object" class="tref externalDFN">
+object
+</a>
+as
+specified
+by
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-rdf-triple" title="rdf-triple">
+RDF
+triple
+</dfn>
+</dt>
+<dd>
+A
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple" title="triple" class="tref externalDFN">
+triple
+</a>
+as
+specified
+by
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn id="dfn-rdf-dataset" title="rdf-dataset">
+RDF
+dataset
+</dfn>
+</dt>
+<dd>
+A
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset" title="dataset" class="tref externalDFN">
+dataset
+</a>
+as
+specified
+by
+[
+<cite>
+<a href="#bib-RDF11-CONCEPTS" class="bibref">
+RDF11-CONCEPTS
+</a>
+</cite>
+]
+representing
+a
+collection
+of
+<a href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph" title="rdf-graphs" class="tref externalDFN">
+RDF
+graphs
+</a>.
+</dd>
+</dl>
+</section>
+<section id="context-processing-algorithms">
+<h2 id="h2_context-processing-algorithms" role="heading" aria-level="1">
+<span class="secno">
+6.
+</span>
+Context
+Processing
+Algorithms
+</h2>
+<section id="context-processing-algorithm">
+<h3 id="h3_context-processing-algorithm" role="heading" aria-level="2">
+<span class="secno">
+6.1
+</span>
+Context
+Processing
+Algorithm
+</h3>
+<p>
+When
+processing
+a
+JSON-LD
+data
+structure,
+each
+processing
+rule
+is
+applied
+using
+information
+provided
+by
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+This
+section
+describes
+how
+to
+produce
+an
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+</p>
+<p>
+The
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+contains
+the
+active
+<dfn id="dfn-term-definition" title="term-definition">
+term
+definitions
+</dfn>
+which
+specify
+how
+properties
+and
+values
+have
+to
+be
+interpreted
+as
+well
+as
+the
+current
+<dfn id="dfn-base-iri" title="base-iri">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>,
+the
+<dfn id="dfn-vocabulary-mapping" title="vocabulary-mapping">
+vocabulary
+mapping
+</dfn>
+and
+the
+<dfn id="dfn-default-language" title="default-language">
+default
+language
+</dfn>.
+Each
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+consists
+of
+an
+<dfn id="dfn-iri-mapping" title="iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</dfn>,
+a
+boolean
+flag
+<dfn id="dfn-reverse-property" title="reverse-property">
+reverse
+property
+</dfn>,
+an
+optional
+<dfn id="dfn-type-mapping" title="type-mapping">
+type
+mapping
+</dfn>
+or
+<dfn id="dfn-language-mapping" title="language-mapping">
+language
+mapping
+</dfn>,
+and
+an
+optional
+<dfn id="dfn-container-mapping" title="container-mapping">
+container
+mapping
+</dfn>.
+A
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+can
+not
+only
+be
+used
+to
+map
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+to
+an
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>,
+but
+also
+to
+map
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+to
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>,
+in
+which
+case
+it
+is
+referred
+to
+as
+a
+<dfn id="dfn-keyword-alias" title="keyword-alias">
+keyword
+alias
+</dfn>.
+</p>
+<p>
+When
+processing,
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+is
+initialized
+without
+any
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definitions
+</a>,
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+or
+<a href="#dfn-default-language" title="default-language" class="tref internalDFN">
+default
+language
+</a>.
+If
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+is
+encountered
+during
+processing,
+a
+new
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+is
+created
+by
+cloning
+the
+existing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+Then
+the
+information
+from
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+is
+merged
+into
+the
+new
+<a href= "#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+Given
+that
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+contexts
+</a>
+may
+contain
+references
+to
+remote
+contexts,
+this
+includes
+their
+retrieval.
+</p>
+<section class="informative">
+<h4 role="heading" aria-level="3" id="overview">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+First
+we
+prepare
+a
+new
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+<i>
+result
+</i>
+by
+cloning
+the
+current
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+Then
+we
+normalize
+the
+form
+of
+the
+passed
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+to
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>.
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+Local
+contexts
+</a>
+may
+be
+in
+the
+form
+of
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+or
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+containing
+a
+combination
+of
+the
+two.
+Finally
+we
+process
+each
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+contained
+in
+the
+<a href= "#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+as
+follows.
+</p>
+<p>
+If
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+it
+represents
+a
+reference
+to
+a
+remote
+context.
+We
+dereference
+the
+remote
+context
+and
+replace
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+with
+the
+value
+of
+the
+<code>
[email protected]
+</code>
+key
+of
+the
+top-level
+object
+in
+the
+retrieved
+JSON-LD
+document.
+If
+there's
+no
+such
+key,
+an
+invalid
+remote
+context
+has
+been
+detected.
+Otherwise,
+we
+process
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+by
+recursively
+using
+this
+algorithm
+ensuring
+that
+there
+is
+no
+cyclical
+reference.
+</p>
+<p>
+If
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+we
+first
+update
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+the
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+and
+the
+<a href="#dfn-default-language" title="default-language" class="tref internalDFN">
+default
+language
+</a>
+by
+processing
+three
+specific
+keywords:
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+and
+<code>
[email protected]
+</code>.
+These
+are
+handled
+before
+any
+other
+keys
+in
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+because
+they
+affect
+how
+the
+other
+keys
+are
+processed.
+Please
+note
+that
+<code>
[email protected]
+</code>
+is
+ignored
+when
+processing
+remote
+contexts.
+</p>
+<p>
+Then,
+for
+every
+other
+key
+in
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+we
+update
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+in
+<i>
+result
+</i>.
+Since
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definitions
+</a>
+in
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+may
+themselves
+contain
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+or
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+IRIs
+</a>,
+we
+may
+need
+to
+recurse.
+When
+doing
+so,
+we
+must
+ensure
+that
+there
+is
+no
+cyclical
+dependency,
+which
+is
+an
+error.
+After
+we
+have
+processed
+any
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+dependencies,
+we
+update
+the
+current
+<a href="#dfn-term-definition" title="term-definition" class= "tref internalDFN">
+term
+definition
+</a>,
+which
+may
+be
+a
+<a href="#dfn-keyword-alias" title="keyword-alias" class="tref internalDFN">
+keyword
+alias
+</a>.
+</p>
+<p>
+Finally,
+we
+return
+<i>
+result
+</i>
+as
+the
+new
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+</p>
+</section>
+<section>
+<h4 role="heading" aria-level="3" id="algorithm">
+Algorithm
+</h4>
+<p>
+This
+algorithm
+specifies
+how
+a
+new
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+is
+updated
+with
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>.
+The
+algorithm
+takes
+three
+input
+variables:
+an
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+and
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+<i>
+remote
+contexts
+</i>
+which
+is
+used
+to
+detect
+cyclical
+context
+inclusions.
+If
+<i>
+remote
+contexts
+</i>
+is
+not
+passed,
+it
+is
+initialized
+to
+an
+empty
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>.
+</p>
+<del class="diff-old">Feature
+at
+Risk
+10
+:
+Support
+for
[email protected]:
+null
+Note:
+This
+feature
+is
+"at
+risk"
+and
+may
+be
+removed
+from
+this
+specification
+based
+on
+feedback.
+Please
+send
+feedback
+to
[email protected]
+.
+For
+the
+current
+status
+see
+features
+"at
+risk"
+in
+JSON-LD
+1.0
+Unlike
+many
+other
+serialization
+formats,
+JSON-LD
+allows
+to
+specify
+that
+there
+is
+no
+base
+IRI
+from
+within
+the
+document
+(by
+setting
[email protected]
+to
+null
+).
+The
+result
+is
+that
+the
+algorithm
+for
+establishing
+a
+base
+IRI
+as
+specified
+in
+RFC3986
+section
+5.1
+is
+overridden
+so
+relative
+IRIs
+remain
+relative
+IRIs
+even
+in
+the
+case
+that
+an
+IRI
+would
+be
+available
+in
+one
+of
+the
+outer
+layers
+(e.g.,
+the
+IRI
+used
+to
+retrieve
+the
+document
+or
+an
+application
+supplied
+base
+IRI
+).
+Based
+on
+implementer
+feedback,
+the
+Working
+Group
+may
+decide
+to
+remove
+this
+feature
+from
+JSON-LD
+1.0.
+</del>
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+result
+</i>
+to
+the
+result
+of
+cloning
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+</li>
+<li>
+If
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+is
+not
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>,
+set
+it
+to
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+containing
+only
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>.
+</li>
+<li>
+For
+each
+item
+<i>
+context
+</i>
+in
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>:
+<ol class="algorithm">
+<li>
+If
+<i>
+context
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+set
+<i>
+result
+</i>
+to
+a
+newly-initialized
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+and
+continue
+with
+the
+next
+<i>
+context
+</i>.
+The
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+is
+set
+to
+the
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+of
+the
+currently
+being
+processed
+document
+(which
+might
+be
+different
+from
+the
+currently
+being
+processed
+context),
+if
+available;
+otherwise
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>.
+If
+set,
+the
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-base">
+base
+</a>
+</code>
+option
+of
+a
+JSON-LD
+API
+Implementation
+overrides
+the
+<a href="#dfn-base-iri" title="base-iri" class= "tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</li>
+<li>
+If
+<i>
+context
+</i>
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+<ol class="algorithm">
+<li>
+Set
+<i>
+context
+</i>
+to
+the
+result
+of
+resolving
+<i>
+value
+</i>
+against
+the
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+which
+is
+established
+as
+specified
+in
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-5.1">
+section
+5.1
+Establishing
+a
+Base
+URI
+</a>
+</cite>
+of
+[
+<cite>
+<a href="#bib-RFC3986" class="bibref">
+RFC3986
+</a>
+</cite>
+].
+Only
+the
+basic
+algorithm
+in
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-5.2">
+section
+5.2
+</a>
+</cite>
+of
+[
+<cite>
+<a href="#bib-RFC3986" class="bibref">
+RFC3986
+</a>
+</cite>
+]
+is
+used;
+neither
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-6.2.2">
+Syntax-Based
+Normalization
+</a>
+</cite>
+nor
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-6.2.3">
+Scheme-Based
+Normalization
+</a>
+</cite>
+are
+performed.
+Characters
+additionally
+allowed
+in
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+references
+are
+treated
+in
+the
+same
+way
+that
+unreserved
+characters
+are
+treated
+in
+URI
+references,
+per
+<cite>
+<a href= "http://tools.ietf.org/html/rfc3987#section-6.5">
+section
+6.5
+</a>
+</cite>
+of
+[
+<cite>
+<a href="#bib-RFC3987" class="bibref">
+RFC3987
+</a>
+</cite>
+].
+</li>
+<li>
+If
+<i>
+context
+</i>
+is
+in
+the
+<i>
+remote
+contexts
+</i>
+array,
+a
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.recursive-context-inclusion">
+recursive
+context
+inclusion
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted;
+otherwise,
+add
+<i>
+context
+</i>
+to
+<i>
+remote
+contexts
+</i>.
+</li>
+<li>
+Dereference
+<i>
+context
+</i>.
+If
+<i>
+context
+</i>
+cannot
+be
+dereferenced,
+a
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.loading-remote-context-failed">
+loading
+remote
+context
+failed
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+If
+the
+dereferenced
+document
+has
+no
+top-level
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+with
+an
+<code>
[email protected]
+</code>
+member,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-remote-context">
+invalid
+remote
+context
+</a>
+</code>
+has
+been
+detected
+and
+processing
+is
+aborted;
+otherwise,
+set
+<i>
+context
+</i>
+to
+the
+value
+of
+that
+member.
+</li>
+<li>
+Set
+<i>
+result
+</i>
+to
+the
+result
+of
+recursively
+calling
+this
+algorithm,
+passing
+<i>
+result
+</i>
+for
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<i>
+context
+</i>
+for
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+and
+<i>
+remote
+contexts
+</i>.
+</li>
+<li>
+Continue
+with
+the
+next
+<i>
+context
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+context
+</i>
+is
+not
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-local-context">
+invalid
+local
+context
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+context
+</i>
+has
+an
+<code>
[email protected]
+</code>
+key
+and
+<i>
+remote
+contexts
+</i>
+is
+empty,
+i.e.,
+the
+currently
+being
+processed
+context
+is
+not
+a
+remote
+context:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+value
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key.
+</li>
+<li>
+If
+<i>
+value
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+remove
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+<i>
+value
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+a
+<a href="#dfn-relative-iri" title="relative-iri" class="tref internalDFN">
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+and
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>
+is
+not
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+set
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>
+to
+the
+result
+of
+resolving
+<i>
+value
+</i>
+against
+the
+current
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-base-IRI">
+invalid
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+context
+</i>
+has
+an
+<code>
[email protected]
+</code>
+key:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+value
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key.
+</li>
+<li>
+If
+<i>
+value
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+remove
+any
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>
+from
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>,
+the
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+<i>
+value
+</i>.
+If
+it
+is
+not
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-vocab-mapping">
+invalid
+vocab
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+context
+</i>
+has
+an
+<code>
[email protected]
+</code>
+key:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+value
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key.
+</li>
+<li>
+If
+<i>
+value
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+remove
+any
+<a href="#dfn-default-language" title="default-language" class="tref internalDFN">
+default
+language
+</a>
+from
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+the
+<a href="#dfn-default-language" title="default-language" class="tref internalDFN">
+default
+language
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+lowercased
+<i>
+value
+</i>.
+If
+it
+is
+not
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-default-language">
+invalid
+default
+language
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+</ol>
+</li>
+<li>
+Create
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+<i>
+defined
+</i>
+to
+use
+to
+keep
+track
+of
+whether
+or
+not
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+has
+already
+been
+defined
+or
+currently
+being
+defined
+during
+recursion.
+</li>
+<li>
+For
+each
+<i>
+key
+</i>
+-
+<i>
+value
+</i>
+pair
+in
+<i>
+context
+</i>
+where
+<i>
+key
+</i>
+is
+not
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+or
+<code>
[email protected]
+</code>,
+invoke
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>,
+passing
+<i>
+result
+</i>
+for
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<i>
+context
+</i>
+for
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+<i>
+key
+</i>,
+and
+<i>
+defined
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Return
+<i>
+result
+</i>.
+</li>
+</ol>
+</section>
+</section>
+<section id="create-term-definition">
+<h3 id="h3_create-term-definition" role="heading" aria-level="2">
+<span class="secno">
+6.2
+</span>
+Create
+Term
+Definition
+</h3>
+<p>
+This
+algorithm
+is
+called
+from
+the
+<a href="#context-processing-algorithm">
+Context
+Processing
+algorithm
+</a>
+to
+create
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+in
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+for
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+being
+processed
+in
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>.
+</p>
+<section class="informative">
+<h4 role="heading" aria-level="3" id="overview-1">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+Term
+definitions
+</a>
+are
+created
+by
+parsing
+the
+information
+in
+the
+given
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+for
+the
+given
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>.
+If
+the
+given
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+is
+a
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+it
+may
+omit
+an
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+by
+depending
+on
+its
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+having
+its
+own
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>.
+If
+the
+<a href="#dfn-prefix" title="prefix" class= "tref internalDFN">
+prefix
+</a>
+is
+a
+key
+in
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+then
+its
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+must
+first
+be
+created,
+through
+recursion,
+before
+continuing.
+Because
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+can
+depend
+on
+other
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definitions
+</a>,
+a
+mechanism
+must
+be
+used
+to
+detect
+cyclical
+dependencies.
+The
+solution
+employed
+here
+uses
+a
+map,
+<i>
+defined
+</i>,
+that
+keeps
+track
+of
+whether
+or
+not
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+has
+been
+defined
+or
+is
+currently
+in
+the
+process
+of
+being
+defined.
+This
+map
+is
+checked
+before
+any
+recursion
+is
+attempted.
+</p>
+<p>
+After
+all
+dependencies
+for
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+have
+been
+defined,
+the
+rest
+of
+the
+information
+in
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+for
+the
+given
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+is
+taken
+into
+account,
+creating
+the
+appropriate
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>,
+<a href="#dfn-container-mapping" title="container-mapping" class="tref internalDFN">
+container
+mapping
+</a>,
+and
+<a href="#dfn-type-mapping" title="type-mapping" class="tref internalDFN">
+type
+mapping
+</a>
+or
+<a href="#dfn-language-mapping" title="language-mapping" class="tref internalDFN">
+language
+mapping
+</a>
+for
+the
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>.
+</p>
+</section>
+<section>
+<h4 role="heading" aria-level="3" id="algorithm-1">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+has
+four
+required
+inputs
+which
+are:
+an
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+a
+<i>
+term
+</i>,
+and
+a
+map
+<i>
+defined
+</i>.
+</p>
+<ol class="algorithm">
+<li>
+If
+<i>
+defined
+</i>
+contains
+the
+key
+<i>
+term
+</i>
+and
+the
+associated
+value
+is
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+(indicating
+that
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+has
+already
+been
+created),
+return.
+Otherwise,
+if
+the
+value
+is
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>,
+a
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.cyclic-IRI-mapping">
+cyclic
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+<i>
+term
+</i>
+key
+to
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>.
+This
+indicates
+that
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+is
+now
+being
+created
+but
+is
+not
+yet
+complete.
+</li>
+<li>
+Since
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keywords
+</a>
+cannot
+be
+overridden,
+<i>
+term
+</i>
+must
+not
+be
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>.
+Otherwise,
+a
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.keyword-redefinition">
+keyword
+redefinition
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Remove
+any
+existing
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+for
+<i>
+term
+</i>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+</li>
+<li>
+Initialize
+<i>
+value
+</i>
+to
+a
+copy
+of
+the
+value
+associated
+with
+the
+key
+<i>
+term
+</i>
+in
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+or
+<i>
+value
+</i>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+containing
+the
+key-value
+pair
+<code>
[email protected]
+</code>
+-
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+set
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+set
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+and
+return.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+convert
+it
+to
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>
+consisting
+of
+a
+single
+member
+whose
+key
+is
+<code>
[email protected]
+</code>
+and
+whose
+value
+is
+<i>
+value
+</i>.
+</li>
+<li>
+Otherwise,
+<i>
+value
+</i>
+must
+be
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+if
+not,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-term-definition">
+invalid
+term
+definition
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Create
+a
+new
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>,
+<i>
+definition
+</i>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+type
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key,
+which
+must
+be
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>.
+Otherwise,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-type-mapping">
+invalid
+type
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+<i>
+type
+</i>
+to
+the
+result
+of
+using
+the
+<a href="#iri-expansion">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<i>
+type
+</i>
+for
+<i>
+value
+</i>,
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+and
+<i>
+defined
+</i>.
+If
+the
+expanded
+<i>
+type
+</i>
+is
+neither
+<code>
[email protected]
+</code>,
+nor
+<code>
[email protected]
+</code>,
+nor
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-type-mapping">
+invalid
+type
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+the
+<a href="#dfn-type-mapping" title="type-mapping" class="tref internalDFN">
+type
+mapping
+</a>
+for
+<i>
+definition
+</i>
+to
+<i>
+type
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>:
+<ol class="algorithm">
+<li>
+If
+<i>
+value
+</i>
+contains
+an
+<code>
[email protected]
+</code>,
+member,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-reverse-property">
+invalid
+reverse
+property
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+is
+not
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Otherwise,
+set
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+the
+result
+of
+using
+the
+<a href="#iri-expansion">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+for
+<i>
+value
+</i>,
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+and
+<i>
+defined
+</i>.
+If
+the
+result
+is
+neither
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+nor
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>,
+i.e.,
+it
+contains
+no
+colon
+(
+<code>:
+</code>
+),
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+an
+<code>
[email protected]
+</code>
+member,
+set
+the
+<a href="#dfn-container-mapping" title="container-mapping" class="tref internalDFN">
+container
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+its
+value;
+if
+its
+value
+is
+neither
+<code>
[email protected]
+</code>,
+nor
+<code>
[email protected]
+</code>,
+nor
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-reverse-property">
+invalid
+reverse
+property
+</a>
+</code>
+error
+has
+been
+detected
+(reverse
+properties
+only
+support
+set-
+and
+index-containers)
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+the
+<a href="#dfn-reverse-property" title="reverse-property" class="tref internalDFN">
+reverse
+property
+</a>
+flag
+of
+<i>
+definition
+</i>
+to
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>.
+</li>
+<li>
+Set
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+of
+<i>
+term
+</i>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+to
+<i>
+definition
+</i>
+and
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+and
+return.
+</li>
+</ol>
+</li>
+<li>
+Set
+the
+<a href="#dfn-reverse-property" title="reverse-property" class="tref internalDFN">
+reverse
+property
+</a>
+flag
+of
+<i>
+definition
+</i>
+to
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>
+and
+its
+value
+does
+not
+equal
+<i>
+term
+</i>:
+<ol class="algorithm">
+<li>
+If
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+is
+not
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Otherwise,
+set
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+the
+result
+of
+using
+the
+<a href="#iri-expansion">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+for
+<i>
+value
+</i>,
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<a href="#dfn-false" title="false" class="tref internalDFN">
+false
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+and
+<i>
+defined
+</i>.
+If
+the
+resulting
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+is
+neither
+a
+<a href= "#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>,
+nor
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+nor
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted;
+if
+it
+equals
+<code>
[email protected]
+</code>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-keyword-alias">
+invalid
+keyword
+alias
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+</ol>
+</li>
+<li>
+Otherwise
+if
+the
+<i>
+term
+</i>
+contains
+a
+colon
+(
+<code>:
+</code>
+):
+<ol class="algorithm">
+<li>
+If
+<i>
+term
+</i>
+is
+a
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+with
+a
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+that
+is
+a
+key
+in
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+a
+dependency
+has
+been
+found.
+Use
+this
+algorithm
+recursively
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+the
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+</li>
+<li>
+If
+<i>
+term
+</i>
+'s
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+has
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+set
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+the
+result
+of
+concatenating
+the
+value
+associated
+with
+the
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+'s
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+and
+the
+<i>
+term
+</i>
+'s
+<i>
+suffix
+</i>.
+</li>
+<li>
+Otherwise,
+<i>
+term
+</i>
+is
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>.
+Set
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<i>
+term
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Otherwise,
+if
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+has
+a
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+is
+set
+to
+the
+result
+of
+concatenating
+the
+value
+associated
+with
+the
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>
+and
+<i>
+term
+</i>.
+If
+it
+does
+not
+have
+a
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping">
+invalid
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+</code>
+error
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+container
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key,
+which
+must
+be
+either
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+<code>
[email protected]
+</code>,
+or
+<code>
[email protected]
+</code>.
+Otherwise,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-container-mapping">
+invalid
+container
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+the
+<a href="#dfn-container-mapping" title="container-mapping" class="tref internalDFN">
+container
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<i>
+container
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>
+and
+does
+not
+contain
+the
+key
+<code>
[email protected]
+</code>:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+language
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key,
+which
+must
+be
+either
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+or
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>.
+Otherwise,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-language-mapping">
+invalid
+language
+mapping
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+language
+</i>
+is
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>
+set
+it
+to
+lowercased
+<i>
+language
+</i>.
+Set
+the
+<a href="#dfn-language-mapping" title="language-mapping" class="tref internalDFN">
+language
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<i>
+language
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Set
+the
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+of
+<i>
+term
+</i>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+to
+<i>
+definition
+</i>
+and
+set
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>.
+</li>
+</ol>
+</section>
+</section>
+<section id="iri-expansion">
+<h3 id="h3_iri-expansion" role="heading" aria-level="2">
+<span class="secno">
+6.3
+</span>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+</h3>
+<p>
+In
+JSON-LD
+documents,
+some
+keys
+and
+values
+may
+represent
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>.
+This
+section
+defines
+an
+algorithm
+for
+transforming
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>
+that
+represents
+an
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+into
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>.
+It
+also
+covers
+transforming
+<a href="#dfn-keyword-alias" title="keyword-alias" class="tref internalDFN">
+keyword
+aliases
+</a>
+into
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keywords
+</a>.
+</p>
+<p>
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+expansion
+may
+occur
+during
+context
+processing
+or
+during
+any
+of
+the
+other
+JSON-LD
+algorithms.
+If
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+expansion
+occurs
+during
+context
+processing,
+then
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+and
+its
+related
+<i>
+defined
+</i>
+map
+from
+the
+<a href="#context-processing-algorithm">
+Context
+Processing
+algorithm
+</a>
+are
+passed
+to
+this
+algorithm.
+This
+allows
+for
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+dependencies
+to
+be
+processed
+via
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>.
+</p>
+<section class="informative">
+<h4 role="heading" aria-level="3" id="overview-2">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+In
+order
+to
+expand
+<i>
+value
+</i>
+to
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+we
+must
+first
+determine
+if
+it
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>,
+a
+<a href="#dfn-keyword-alias" title="keyword-alias" class="tref internalDFN">
+keyword
+alias
+</a>,
+or
+some
+form
+of
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+Based
+on
+what
+we
+find,
+we
+handle
+the
+specific
+kind
+of
+expansion;
+for
+example,
+we
+expand
+a
+<a href="#dfn-keyword-alias" title="keyword-alias" class="tref internalDFN">
+keyword
+alias
+</a>
+to
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>
+and
+a
+<a href="#dfn-term" title="term" class="tref internalDFN">
+term
+</a>
+to
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class= "tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+according
+to
+its
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+in
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>.
+While
+inspecting
+<i>
+value
+</i>
+we
+may
+also
+find
+that
+we
+need
+to
+create
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+dependencies
+because
+we're
+running
+this
+algorithm
+during
+context
+processing.
+We
+can
+tell
+whether
+or
+not
+we're
+running
+during
+context
+processing
+by
+checking
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+against
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>.
+We
+know
+we
+need
+to
+create
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+in
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+when
+<i>
+value
+</i>
+is
+a
+key
+in
+the
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+and
+the
+<i>
+defined
+</i>
+map
+does
+not
+have
+a
+key
+for
+<i>
+value
+</i>
+with
+an
+associated
+value
+of
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>.
+The
+<i>
+defined
+</i>
+map
+is
+used
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>
+to
+keep
+track
+of
+which
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+have
+already
+been
+defined
+or
+are
+in
+the
+process
+of
+being
+defined.
+We
+create
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+by
+using
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>.
+</p>
+</section>
+<section>
+<h4 role="heading" aria-level="3" id="algorithm-2">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+takes
+two
+required
+and
+four
+optional
+input
+variables.
+The
+required
+inputs
+are
+an
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+and
+a
+<i>
+value
+</i>
+to
+be
+expanded.
+The
+optional
+inputs
+are
+two
+flags,
+<i>
+document
+relative
+</i>
+and
+<i>
+vocab
+</i>,
+that
+specifying
+whether
+<i>
+value
+</i>
+can
+be
+interpreted
+as
+a
+<a href="#dfn-relative-iri" title="relative-iri" class="tref internalDFN">
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+against
+the
+document's
+base
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context's
+</a>
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+respectively,
+and
+a
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+and
+a
+map
+<i>
+defined
+</i>
+to
+be
+used
+when
+this
+algorithm
+is
+used
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>.
+If
+not
+passed,
+the
+two
+flags
+are
+set
+to
+<code>
+false
+</code>
+and
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+and
+<i>
+defined
+</i>
+are
+initialized
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>.
+</p>
+<ol class="algorithm">
+<li>
+If
+<i>
+value
+</i>
+is
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>
+or
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+return
+<i>
+value
+</i>
+as
+is.
+</li>
+<li>
+If
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+is
+not
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+it
+contains
+a
+key
+that
+equals
+<i>
+value
+</i>,
+and
+the
+value
+associated
+with
+the
+key
+that
+equals
+<i>
+value
+</i>
+in
+<i>
+defined
+</i>
+is
+not
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+invoke
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+<i>
+value
+</i>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+This
+will
+ensure
+that
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+is
+created
+for
+<i>
+value
+</i>
+in
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+during
+<a href= "#context-processing-algorithm">
+Context
+Processing
+</a>.
+</li>
+<li>
+If
+<i>
+vocab
+</i>
+is
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+and
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+has
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+for
+<i>
+value
+</i>,
+return
+the
+associated
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+a
+colon
+(
+<code>:
+</code>
+),
+it
+is
+either
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+a
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+or
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>:
+<ol class="algorithm">
+<li>
+Split
+<i>
+value
+</i>
+into
+a
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+and
+<i>
+suffix
+</i>
+at
+the
+first
+occurrence
+of
+a
+colon
+(
+<code>:
+</code>
+).
+</li>
+<li>
+If
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+is
+underscore
+(
+<code>
+_
+</code>
+)
+or
+<i>
+suffix
+</i>
+begins
+with
+double-forward-slash
+(
+<code>
+//
+</code>
+),
+return
+<i>
+value
+</i>
+as
+it
+is
+already
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+a
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifier
+</a>.
+</li>
+<li>
+If
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>
+is
+not
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+it
+contains
+a
+key
+that
+equals
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>,
+and
+the
+value
+associated
+with
+the
+key
+that
+equals
+<i>
+prefix
+</i>
+in
+<i>
+defined
+</i>
+is
+not
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+invoke
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>,
+<i>
+prefix
+</i>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+This
+will
+ensure
+that
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+is
+created
+for
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+in
+<a href= "#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>.
+</li>
+<li>
+If
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+contains
+a
+<a href="#dfn-term-definition" title="term-definition" class="tref internalDFN">
+term
+definition
+</a>
+for
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>,
+return
+the
+result
+of
+concatenating
+the
+<a href="#dfn-iri-mapping" title="iri-mapping" class="tref internalDFN">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+associated
+with
+<a href="#dfn-prefix" title="prefix" class="tref internalDFN">
+prefix
+</a>
+and
+<i>
+suffix
+</i>.
+</li>
+<li>
+Return
+<i>
+value
+</i>
+as
+it
+is
+already
+an
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+vocab
+</i>
+is
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+and
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+has
+a
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>,
+return
+the
+result
+of
+concatenating
+the
+<a href="#dfn-vocabulary-mapping" title="vocabulary-mapping" class="tref internalDFN">
+vocabulary
+mapping
+</a>
+with
+<i>
+value
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+document
+relative
+</i>
+is
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>,
+set
+<i>
+value
+</i>
+to
+the
+result
+of
+resolving
+<i>
+value
+</i>
+against
+the
+<a href="#dfn-base-iri" title="base-iri" class="tref internalDFN">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+Only
+the
+basic
+algorithm
+in
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-5.2">
+section
+5.2
+</a>
+</cite>
+of
+[
+<cite>
+<a href="#bib-RFC3986" class="bibref">
+RFC3986
+</a>
+</cite>
+]
+is
+used;
+neither
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-6.2.2">
+Syntax-Based
+Normalization
+</a>
+</cite>
+nor
+<cite>
+<a href="http://tools.ietf.org/html/rfc3986#section-6.2.3">
+Scheme-Based
+Normalization
+</a>
+</cite>
+are
+performed.
+Characters
+additionally
+allowed
+in
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+references
+are
+treated
+in
+the
+same
+way
+that
+unreserved
+characters
+are
+treated
+in
+URI
+references,
+per
+<cite>
+<a href= "http://tools.ietf.org/html/rfc3987#section-6.5">
+section
+6.5
+</a>
+</cite>
+of
+[
+<cite>
+<a href="#bib-RFC3987" class="bibref">
+RFC3987
+</a>
+</cite>
+].
+</li>
+<li>
+Return
+<i>
+value
+</i>
+as
+is.
+</li>
+</ol>
+</section>
+</section>
+</section>
+<section id="expansion-algorithms">
+<h2 id="h2_expansion-algorithms" role="heading" aria-level="1">
+<span class="secno">
+7.
+</span>
+Expansion
+Algorithms
+</h2>
+<section id="expansion-algorithm">
+<h3 id="h3_expansion-algorithm" role="heading" aria-level="2">
+<span class="secno">
+7.1
+</span>
+Expansion
+Algorithm
+</h3>
+<p>
+This
+algorithm
+expands
+a
+JSON-LD
+document,
+such
+that
+all
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>
+definitions
+are
+removed,
+all
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+and
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+IRIs
+</a>
+are
+expanded
+to
+<a href="#dfn-absolute-iri" title="absolute-iri" class="tref internalDFN">
+absolute
+IRIs
+</a>,
+<a href="#dfn-blank-node-identifier" title="blank-node-identifier" class="tref internalDFN">
+blank
+node
+identifiers
+</a>,
+or
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keywords
+</a>
+and
+all
+<a href="#dfn-json-ld-value" title="json-ld-value" class="tref internalDFN">
+JSON-LD
+values
+</a>
+are
+expressed
+in
+<a href="#dfn-array" title="array" class="tref internalDFN">
+arrays
+</a>
+in
+<a href="#dfn-expanded-form" title="expanded-form" class="tref internalDFN">
+expanded
+form
+</a>.
+</p>
+<section class="informative">
+<h4 role="heading" aria-level="3" id="overview-3">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+Starting
+with
+its
+root
+<i>
+element
+</i>,
+we
+can
+process
+the
+JSON-LD
+document
+recursively,
+until
+we
+have
+a
+fully
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+expanded
+</a>
+<i>
+result
+</i>.
+When
+<a href="#dfn-expansion" title="expansion" class="tref internalDFN">
+expanding
+</a>
+an
+<i>
+element
+</i>,
+we
+can
+treat
+each
+one
+differently
+according
+to
+its
+type,
+in
+order
+to
+break
+down
+the
+problem:
+</p>
+<ol>
+<li>
+If
+the
+<i>
+element
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+there
+is
+nothing
+to
+expand.
+</li>
+<li>
+Otherwise,
+if
+<i>
+element
+</i>
+is
+a
+<a href="#dfn-scalar" title="scalar" class="tref internalDFN">
+scalar
+</a>,
+we
+expand
+it
+according
+to
+the
+<a href="#value-expansion">
+Value
+Expansion
+algorithm
+</a>.
+</li>
+<li>
+Otherwise,
+if
+the
+<i>
+element
+</i>
+is
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>,
+then
+we
+expand
+each
+of
+its
+items
+recursively
+and
+return
+them
+in
+a
+new
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>.
+</li>
+<li>
+Otherwise,
+<i>
+element
+</i>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>.
+We
+expand
+each
+of
+its
+keys,
+adding
+them
+to
+our
+<i>
+result
+</i>,
+and
+then
+we
+expand
+each
+value
+for
+each
+key
+recursively.
+Some
+of
+the
+keys
+will
+be
+<a href="#dfn-term" title="term" class="tref internalDFN">
+terms
+</a>
+or
+<a href="#dfn-compact-iri" title="compact-iri" class="tref internalDFN">
+compact
+IRIs
+</a>
+and
+others
+will
+be
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keywords
+</a>
+or
+simply
+ignored
+because
+they
+do
+not
+have
+definitions
+in
+the
+<a href="#dfn-context" title="context" class="tref internalDFN">
+context
+</a>.
+Any
+<a href="#dfn-iri" title="iri" class="tref internalDFN">
+IRIs
+</a>
+will
+be
+expanded
+using
+the
+<a href="#iri-expansion">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>.
+</li>
+</ol>
+<p>
+Finally,
+after
+ensuring
+<i>
+result
+</i>
+is
+in
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>,
+we
+return
+<i>
+result
+</i>.
+</p>
+</section>
+<section>
+<h4 role="heading" aria-level="3" id="algorithm-3">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+takes
+three
+input
+variables:
+an
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+an
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>,
+and
+an
+<i>
+element
+</i>
+to
+be
+expanded.
+To
+begin,
+the
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>
+is
+set
+to
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+and
+<i>
+element
+</i>
+is
+set
+to
+the
+<a href="#dfn-json-ld-input" title="json-ld-input" class="tref internalDFN">
+JSON-LD
+input
+</a>.
+</p>
+<ol class="algorithm">
+<li>
+If
+<i>
+element
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>,
+return
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>.
+</li>
+<li>
+If
+<i>
+element
+</i>
+is
+a
+<a href="#dfn-scalar" title="scalar" class="tref internalDFN">
+scalar
+</a>,
+<ol class="algorithm">
+<li>
+If
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+or
+<code>
[email protected]
+</code>,
+drop
+the
+free-floating
+<a href="#dfn-scalar" title="scalar" class="tref internalDFN">
+scalar
+</a>
+by
+returning
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>.
+</li>
+<li>
+Return
+the
+result
+of
+the
+<a href="#value-expansion">
+Value
+Expansion
+algorithm
+</a>,
+passing
+the
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>,
+and
+<i>
+element
+</i>
+as
+<i>
+value
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+element
+</i>
+is
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>,
+<ol class="algorithm">
+<li>
+Initialize
+an
+empty
+array,
+<i>
+result
+</i>.
+</li>
+<li>
+For
+each
+<i>
+item
+</i>
+in
+<i>
+element
+</i>:
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+expanded
+item
+</i>
+to
+the
+result
+of
+using
+this
+algorithm
+recursively,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>,
+and
+<i>
+item
+</i>
+as
+<i>
+element
+</i>.
+</li>
+<li>
+If
+the
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>
+is
+<code>
[email protected]
+</code>
+or
+its
+<a href="#dfn-container-mapping" title="container-mapping" class="tref internalDFN">
+container
+mapping
+</a>
+is
+set
+to
+<code>
[email protected]
+</code>,
+the
+<i>
+expanded
+item
+</i>
+must
+not
+be
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>
+or
+a
+<a href="#dfn-list-object" title="list-object" class="tref internalDFN">
+list
+object
+</a>,
+otherwise
+a
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.list-of-lists">
+list
+of
+lists
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+expanded
+item
+</i>
+is
+an
+<a href="#dfn-array" title="array" class="tref internalDFN">
+array
+</a>,
+append
+each
+of
+its
+items
+to
+<i>
+result
+</i>.
+Otherwise,
+if
+<i>
+expanded
+item
+</i>
+is
+not
+null,
+append
+it
+to
+<i>
+result
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Return
+<i>
+result
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Otherwise
+<i>
+element
+</i>
+is
+a
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>.
+</li>
+<li>
+If
+<i>
+element
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>,
+set
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+to
+the
+result
+of
+the
+<a href="#context-processing-algorithm">
+Context
+Processing
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>
+and
+the
+value
+of
+the
+<code>
[email protected]
+</code>
+key
+as
+<a href="#dfn-local-context" title="local-context" class="tref internalDFN">
+local
+context
+</a>.
+</li>
+<li>
+Initialize
+an
+empty
+<a href="#dfn-json-object" title="json-object" class="tref internalDFN">
+JSON
+object
+</a>,
+<i>
+result
+</i>.
+</li>
+<li>
+For
+each
+<i>
+key
+</i>
+and
+<i>
+value
+</i>
+in
+<i>
+element
+</i>,
+ordered
+lexicographically
+by
+<i>
+key
+</i>:
+<ol class="algorithm">
+<li>
+If
+<i>
+key
+</i>
+is
+<code>
[email protected]
+</code>,
+continue
+to
+the
+next
+<i>
+key
+</i>.
+</li>
+<li>
+Set
+<i>
+expanded
+property
+</i>
+to
+the
+result
+of
+using
+the
+<a href="#iri-expansion">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a href="#dfn-active-context" title="active-context" class="tref internalDFN">
+active
+context
+</a>,
+<i>
+key
+</i>
+for
+<i>
+value
+</i>,
+and
+<a href="#dfn-true" title="true" class="tref internalDFN">
+true
+</a>
+for
+<i>
+vocab
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<a href="#dfn-null" title="null" class="tref internalDFN">
+null
+</a>
+or
+it
+neither
+contains
+a
+colon
+(
+<code>:
+</code>
+)
+nor
+it
+is
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>,
+drop
+<i>
+key
+</i>
+by
+continuing
+to
+the
+next
+<i>
+key
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+a
+<a href="#dfn-keyword" title="keyword" class="tref internalDFN">
+keyword
+</a>:
+<ol class="algorithm">
+<li>
+If
+<a href="#dfn-active-property" title="active-property" class="tref internalDFN">
+active
+property
+</a>
+equals
+<code>
[email protected]
+</code>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-reverse-property-map">
+invalid
+reverse
+property
+map
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+result
+</i>
+has
+already
+an
+<i>
+expanded
+property
+</i>
+member,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.colliding-keywords">
+colliding
+keywords
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<code>
[email protected]
+</code>
+and
+<i>
+value
+</i>
+is
+not
+a
+<a href="#dfn-string" title="string" class="tref internalDFN">
+string
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid--id-value">
+invalid
[email protected]
+value
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+Otherwise,
+set
+<i>
+expanded
+value
+</i>
+to
+the
+result
+of
+using
+the
+<a href="#iri-expansion">