Added 2nd Last Call document for the JSON-LD 1.0 API.
authorManu Sporny <msporny@digitalbazaar.com>
Thu, 09 May 2013 10:13:53 -0400
changeset 1648 342853c1e27c
parent 1647 827ccb94038b
child 1649 7f517e0e49d5
Added 2nd Last Call document for the JSON-LD 1.0 API.
spec/WD/json-ld-api/20130514/diff-20130411.html
spec/WD/json-ld-api/20130514/index.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/WD/json-ld-api/20130514/diff-20130411.html	Thu May 09 10:13:53 2013 -0400
@@ -0,0 +1,35245 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.1//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd'>
+<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" prefix='bibo: http://purl.org/ontology/bibo/' typeof="bibo:Document">
+<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">
+  .diff {
+    font-weight:bold; color:#0a3;
+  }
+  .error a {
+    color:  #ff4500;
+    border-bottom:  1px dotted #ff4500;
+    text-decoration: none;
+  }
+  .atrisk-head {
+    font-style: italic;
+  }
+</style>
+<style>/*****************************************************************
+ * ReSpec 3 CSS
+ * Robin Berjon - http://berjon.com/
+ *****************************************************************/
+
+/* --- 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;
+}
+
+
+/* --- --- */
+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, ".") ") "; }
+
+/* --- 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>/* --- 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>/* --- 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>/* --- 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 rel="stylesheet" href="//www.w3.org/StyleSheets/TR/W3C-WD" />
+<!--[if lt IE 9]><script src='http://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>
+<div class="head">
+<p>
+<a href="http://www.w3.org/">
+<img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C" />
+</a>
+</p>
+<h1 class="title" id="title">
+JSON-LD
+1.0
+Processing
+Algorithms
+and
+API
+</h1>
+<h2 id="w3c-last-call-working-draft-14-may-2013">
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+Last
+Call
+Working
+Draft
+<del class="diff-old">11
+April
+</del>
+<ins class="diff-chg">14
+May
+</ins>
+2013
+</h2>
+<dl>
+<dt>
+This
+version:
+</dt>
+<dd>
+<del class="diff-old">http://www.w3.org/TR/2013/WD-json-ld-api-20130411/
+</del>
+<a href="http://www.w3.org/TR/2013/WD-json-ld-api-20130514/">
+<ins class="diff-chg">http://www.w3.org/TR/2013/WD-json-ld-api-20130514/
+</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://json-ld.org/spec/latest/json-ld-api/index.html">
+http://json-ld.org/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/2012/WD-json-ld-api-20120712/
+</del>
+<a href="http://www.w3.org/TR/2013/WD-json-ld-api-20130411/">
+<ins class="diff-chg">http://www.w3.org/TR/2013/WD-json-ld-api-20130411/
+</ins>
+</a>
+</dd>
+<dt>
+Editors:
+</dt>
+<dd rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Markus Lanthaler" href="http://www.markus-lanthaler.com/">
+Markus
+Lanthaler
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://www.tugraz.at/">
+Graz
+University
+of
+Technology
+</a>
+</span>
+</dd>
+<dd rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Gregg Kellogg" href="http://greggkellogg.net/">
+Gregg
+Kellogg
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://kellogg-assoc.com/">
+Kellogg
+Associates
+</a>
+</span>
+</dd>
+<dd rel="bibo:editor" inlist="">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Manu Sporny" href="http://manu.sporny.org/">
+Manu
+Sporny
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://digitalbazaar.com/">
+Digital
+Bazaar
+</a>
+</span>
+</dd>
+<dt>
+Authors:
+</dt>
+<dd rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Dave Longley" href="http://digitalbazaar.com/">
+Dave
+Longley
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://digitalbazaar.com/">
+Digital
+Bazaar
+</a>
+</span>
+</dd>
+<dd rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Gregg Kellogg" href="http://greggkellogg.net/">
+Gregg
+Kellogg
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://kellogg-assoc.com/">
+Kellogg
+Associates
+</a>
+</span>
+</dd>
+<dd rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Markus Lanthaler" href="http://www.markus-lanthaler.com/">
+Markus
+Lanthaler
+</a>,
+<a rel="foaf:workplaceHomepage" href="http://www.tugraz.at/">
+Graz
+University
+of
+Technology
+</a>
+</span>
+</dd>
+<dd rel="dcterms:contributor">
+<span typeof="foaf:Person">
+<a rel="foaf:homepage" property="foaf:name" content="Manu Sporny" href="http://digitalbazaar.com/">
+Manu
+Sporny
+</a>,
+<a rel="foaf:workplaceHomepage" 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-20130411.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 id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#abstract" rel="bibo:chapter">
+<h2>
+Abstract
+</h2>
+<p>
+This
+specification
+defines
+an
+Application
+Programming
+Interface
+(API)
+and
+a
+set
+of
+algorithms
+for
+programmatic
+transformations
+of
+JSON-LD
+documents.
+Restructuring
+data
+according
+the
+defined
+transformations
+often
+dramatically
+simplifies
+its
+usage.
+</p>
+</section>
+<section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#sotd" rel="bibo:chapter">
+<h2>
+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">25
+</del>
+<ins class="diff-chg">34
+</ins>
+months
+in
+the
+JSON
+for
+Linking
+Data
+Community
+Group.
+The
+document
+has
+recently
+been
+transferred
+to
+the
+RDF
+Working
+Group
+for
+review,
+improvement,
+and
+publication
+along
+the
+Recommendation
+track.
+The
+specification
+has
+undergone
+significant
+development,
+review,
+and
+changes
+during
+the
+course
+of
+the
+last
+<del class="diff-old">25
+</del>
+<ins class="diff-chg">34
+</ins>
+months.
+</p>
+<p>
+There
+are
+several
+independent
+<a href="http://json-ld.org/#impl">
+interoperable
+implementations
+</a>
+of
+this
+<del class="diff-old">specification
+and
+</del>
+<ins class="diff-chg">specification.
+There
+is
+</ins>
+a
+fairly
+complete
+test
+suite
+[
+<cite>
+<a class="bibref" href="#bib-JSON-LD-TESTS">
+JSON-LD-TESTS
+</a>
+</cite>
+<del class="diff-old">].
+</del>
+<ins class="diff-chg">]
+and
+a
+</ins><a href="http://json-ld.org/playground/"><ins class="diff-chg">
+live
+JSON-LD
+editor
+</ins></a><ins class="diff-chg">
+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
+three
+months.
+</ins>
+</p>
+<p>
+<ins class="diff-new">There
+are
+a
+number
+of
+ways
+that
+one
+may
+participate
+in
+the
+development
+of
+this
+specification:
+</ins></p><ul><li><ins class="diff-new">
+If
+you
+want
+to
+make
+sure
+that
+your
+feedback
+is
+formally
+addressed
+by
+the
+RDF
+Working
+Group,
+you
+should
+send
+it
+to
+public-rdf-comments:
+</ins><a href="http://lists.w3.org/Archives/Public/public-rdf-comments/"><ins class="diff-new">
[email protected]
+</ins></a></li><li><ins class="diff-new">
+Ad-hoc
+technical
+discussion
+primarily
+occurs
+on
+the
+public
+community
+mailing
+list:
+</ins><a href="http://lists.w3.org/Archives/Public/public-linked-json/"><ins class="diff-new">
[email protected]
+</ins></a></li><li><a href="http://json-ld.org/minutes/"><ins class="diff-new">
+Public
+JSON-LD
+Community
+Group
+teleconferences
+</ins></a><ins class="diff-new">
+are
+held
+on
+Tuesdays
+at
+1400UTC
+every
+week.
+Participation
+is
+open
+to
+the
+public.
+</ins></li><li><ins class="diff-new">
+RDF
+Working
+Group
+teleconferences
+are
+held
+on
+Wednesdays
+at
+1500UTC
+every
+week.
+Participation
+is
+limited
+to
+RDF
+Working
+Group
+members.
+</ins></li><li><ins class="diff-new">
+Specification
+bugs
+and
+issues
+should
+be
+reported
+in
+the
+</ins><a href="https://github.com/json-ld/json-ld.org/issues"><ins class="diff-new">
+issue
+tracker
+</ins></a><ins class="diff-new">
+if
+you
+do
+not
+want
+to
+send
+an
+email
+to
+the
+public-rdf-comments
+mailing
+list.
+</ins></li><li><a href="https://github.com/json-ld/json-ld.org/tree/master/spec"><ins class="diff-new">
+Source
+code
+</ins></a><ins class="diff-new">
+for
+the
+specification
+can
+be
+found
+on
+Github.
+</ins></li><li><ins class="diff-new">
+The
+</ins><a href="http://webchat.freenode.net/?channels=json-ld"><ins class="diff-new">
+#json-ld
+</ins></a><ins class="diff-new">
+IRC
+channel
+is
+available
+for
+real-time
+discussion
+on
+irc.freenode.net.
+</ins></li></ul><p><ins class="diff-new">
+This
+is
+a
+second
+Last
+Call
+Working
+Draft
+for
+this
+document.
+Changes
+since
+the
+</ins><a href="http://www.w3.org/TR/2013/WD-json-ld-api-20130411/"><ins class="diff-new">
+11
+April
+2013
+Last
+Call
+Working
+Draft
+</ins></a>:</p><ul><li><ins class="diff-new">
+Use
+of
+DOM
+Futures
+instead
+of
+callbacks
+in
+the
+Application
+Programming
+Interface
+</ins></li><li><ins class="diff-new">
+Processing
+of
+terms
+that
+are
+redefined
+to
+themselves
+without
+raising
+an
+</ins><code class="error"><a href="#idl-def-JsonLdErrorCode.cyclic-IRI-mapping"><ins class="diff-new">
+cyclic
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr><ins class="diff-new">
+mapping
+</ins></a></code><ins class="diff-new">
+error
+</ins></li><li><ins class="diff-new">
+Raise
+an
+</ins><code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-IRI-mapping"><ins class="diff-new">
+invalid
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr><ins class="diff-new">
+mapping
+</ins></a></code><ins class="diff-new">
+error
+if
+relative
+URLs
+are
+used
+in
+term
+definitions
+</ins></li><li><ins class="diff-new">
+Support
+lists
+of
+lists
+when
+converting
+from
+RDF
+to
+JSON-LD
+</ins></li><li><ins class="diff-new">
+Support
+for
+relative
+URLs
+in
+</ins><code><ins class="diff-new">
[email protected]
+</ins></code><ins class="diff-new">
+and
+documents
+that
+do
+not
+have
+a
+base
+value.
+</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
+Last
+Call
+Working
+Draft.
+This
+document
+is
+intended
+to
+become
+a
+<abbr title="World Wide Web Consortium">
+W3C
+</abbr>
+Recommendation.
+If
+you
+wish
+to
+make
+comments
+regarding
+this
+document,
+please
+send
+them
+to
+<a 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>
+).
+The
+Last
+Call
+period
+ends
+<del class="diff-old">10
+May
+</del>
+<ins class="diff-chg">04
+June
+</ins>
+2013.
+All
+comments
+are
+welcome.
+</p>
+<del class="diff-old">The
+Working
+Group
+welcomes
+reports
+of
+implementations,
+sent
+to
+the
+comments
+address.
+If
+we
+gather
+sufficient
+evidence
+of
+interoperable
+implementations,
+the
+group
+may
+request
+to
+skip
+Call
+for
+Implementations
+(Candidate
+Recommendation)
+drafts
+and
+have
+the
+next
+round
+of
+publications
+be
+Proposed
+Recommendations.
+</del>
+<p>
+Publication
+as
+a
+Last
+Call
+Working
+Draft
+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>
+This
+is
+a
+Last
+Call
+Working
+Draft
+and
+thus
+the
+Working
+Group
+has
+determined
+that
+this
+document
+has
+satisfied
+the
+relevant
+technical
+requirements
+and
+is
+sufficiently
+stable
+to
+advance
+through
+the
+Technical
+Recommendation
+process.
+</p>
+<p>
+This
+document
+was
+produced
+by
+a
+group
+operating
+under
+the
+<a 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 class="introductory">
+Table
+of
+Contents
+</h2>
+<ul class="toc">
+<li class="tocline">
+<a href="#introduction" class="tocxref">
+<span class="secno">
+1.
+</span>
+Introduction
+</a>
+</li>
+<li class="tocline">
+<a href="#features" class="tocxref">
+<span class="secno">
+2.
+</span>
+Features
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#expansion" class="tocxref">
+<span class="secno">
+2.1
+</span>
+Expansion
+</a>
+</li>
+<li class="tocline">
+<a href="#compaction" class="tocxref">
+<span class="secno">
+2.2
+</span>
+Compaction
+</a>
+</li>
+<li class="tocline">
+<a href="#flattening" class="tocxref">
+<span class="secno">
+2.3
+</span>
+Flattening
+</a>
+</li>
+<li class="tocline">
+<a href="#rdf-conversion" class="tocxref">
+<span class="secno">
+2.4
+</span>
+RDF
+Conversion
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#conformance" class="tocxref">
+<span class="secno">
+3.
+</span>
+Conformance
+</a>
+</li>
+<li class="tocline">
+<a href="#general-terminology" class="tocxref">
+<span class="secno">
+4.
+</span>
+General
+Terminology
+</a>
+</li>
+<li class="tocline">
+<a href="#algorithm-terms" class="tocxref">
+<span class="secno">
+5.
+</span>
+Algorithm
+Terms
+</a>
+</li>
+<li class="tocline">
+<a href="#context-processing-algorithms" class="tocxref">
+<span class="secno">
+6.
+</span>
+Context
+Processing
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#context-processing-algorithm" class="tocxref">
+<span class="secno">
+6.1
+</span>
+Context
+Processing
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#create-term-definition" class="tocxref">
+<span class="secno">
+6.2
+</span>
+Create
+Term
+Definition
+</a>
+</li>
+<li class="tocline">
+<a href="#iri-expansion" class="tocxref">
+<span class="secno">
+6.3
+</span>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#expansion-algorithms" class="tocxref">
+<span class="secno">
+7.
+</span>
+Expansion
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#expansion-algorithm" class="tocxref">
+<span class="secno">
+7.1
+</span>
+Expansion
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#value-expansion" class="tocxref">
+<span class="secno">
+7.2
+</span>
+Value
+Expansion
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#compaction-algorithms" class="tocxref">
+<span class="secno">
+8.
+</span>
+Compaction
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#compaction-algorithm" class="tocxref">
+<span class="secno">
+8.1
+</span>
+Compaction
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#inverse-context-creation" class="tocxref">
+<span class="secno">
+8.2
+</span>
+Inverse
+Context
+Creation
+</a>
+</li>
+<li class="tocline">
+<a href="#iri-compaction" class="tocxref">
+<span class="secno">
+8.3
+</span>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Compaction
+</a>
+</li>
+<li class="tocline">
+<a href="#term-selection" class="tocxref">
+<span class="secno">
+8.4
+</span>
+Term
+Selection
+</a>
+</li>
+<li class="tocline">
+<a href="#value-compaction" class="tocxref">
+<span class="secno">
+8.5
+</span>
+Value
+Compaction
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#flattening-algorithms" class="tocxref">
+<span class="secno">
+9.
+</span>
+Flattening
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#flattening-algorithm" class="tocxref">
+<span class="secno">
+9.1
+</span>
+Flattening
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#node-map-generation" class="tocxref">
+<span class="secno">
+9.2
+</span>
+Node
+Map
+Generation
+</a>
+</li>
+<li class="tocline">
+<a href="#generate-blank-node-identifier" class="tocxref">
+<span class="secno">
+9.3
+</span>
+Generate
+Blank
+Node
+Identifier
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#rdf-conversion-algorithms" class="tocxref">
+<span class="secno">
+10.
+</span>
+RDF
+Conversion
+Algorithms
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#convert-to-rdf-algorithm" class="tocxref">
+<span class="secno">
+10.1
+</span>
+Convert
+to
+RDF
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#object-to-rdf-conversion" class="tocxref">
+<span class="secno">
+10.2
+</span>
+Object
+to
+RDF
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a href="#list-to-rdf-conversion" class="tocxref">
+<span class="secno">
+10.3
+</span>
+List
+to
+RDF
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a href="#convert-from-rdf-algorithm" class="tocxref">
+<span class="secno">
+10.4
+</span>
+Convert
+from
+RDF
+Algorithm
+</a>
+</li>
+<li class="tocline">
+<a href="#rdf-to-object-conversion" class="tocxref">
+<span class="secno">
+10.5
+</span>
+RDF
+to
+Object
+Conversion
+</a>
+</li>
+<li class="tocline">
+<a href="#data-round-tripping" class="tocxref">
+<span class="secno">
+10.6
+</span>
+Data
+Round
+Tripping
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#the-application-programming-interface" class="tocxref">
+<span class="secno">
+11.
+</span>
+The
+Application
+Programming
+Interface
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#the-jsonldprocessor-interface" class="tocxref">
+<span class="secno">
+11.1
+</span>
+The
+<span class="formerLink">
+<code>
+JsonLdProcessor
+</code>
+</span>
+Interface
+</a>
+</li>
+<li class="tocline">
+<a href="#the-jsonldoptions-type" class="tocxref">
+<span class="secno">
+11.2
+</span>
+<del class="diff-old">Callbacks
+</del>
+<ins class="diff-chg">The
+</ins><span class="formerLink"><code><ins class="diff-chg">
+JsonLdOptions
+</ins></code></span><ins class="diff-chg">
+Type
+</ins>
+</a>
+</li>
+<li class="tocline">
+<a href="#remote-context-retrieval" class="tocxref">
+<span class="secno">
+11.3
+</span>
+<del class="diff-old">Data
+Structures
+</del>
+<ins class="diff-chg">Remote
+Context
+Retrieval
+</ins></a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno"><ins class="diff-chg">
+11.4
+</ins></span><ins class="diff-chg">
+Error
+Handling
+</ins>
+</a>
+</li>
+</ul>
+</li>
+<li class="tocline">
+<a href="#acknowledgements" class="tocxref">
+<span class="secno">
+A.
+</span>
+Acknowledgements
+</a>
+</li>
+<li class="tocline">
+<a href="#references" class="tocxref">
+<span class="secno">
+B.
+</span>
+References
+</a>
+<ul class="toc">
+<li class="tocline">
+<a href="#normative-references" class="tocxref">
+<span class="secno">
+B.1
+</span>
+Normative
+references
+</a>
+</li>
+<li class="tocline">
+<a href="#informative-references" class="tocxref">
+<span class="secno">
+B.2
+</span>
+Informative
+references
+</a>
+</li>
+</ul>
+</li>
+</ul>
+</section>
+<section class="informative" id="introduction">
+<h2>
+<span class="secno">
+1.
+</span>
+Introduction
+</h2>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+This
+document
+is
+a
+detailed
+specification
+for
+an
+Application
+Programming
+Interface
+for
+the
+JSON-LD
+syntax.
+The
+document
+is
+primarily
+intended
+for
+the
+following
+audiences:
+</p>
+<ul>
+<li>
+Developers
+who
+want
+an
+overview
+of
+the
+JSON-LD
+API.
+</li>
+<li>
+Web
+authors
+and
+developers
+who
+want
+a
+very
+detailed
+view
+of
+how
+a
+<a class="tref internalDFN" title="json-ld-processor" href="#dfn-json-ld-processor">
+JSON-LD
+Processor
+</a>
+or
+a
+<a class="tref internalDFN" title="json-ld-api-implementation" href="#dfn-json-ld-api-implementation">
+JSON-LD
+API
+Implementation
+</a>
+operates.
+</li>
+<li>
+Software
+developers
+who
+want
+to
+implement
+the
+algorithms
+to
+transform
+JSON-LD
+documents.
+</li>
+</ul>
+<p>
+To
+understand
+the
+basics
+in
+this
+specification
+you
+must
+first
+be
+familiar
+with
+JSON,
+which
+is
+detailed
+in
+[
+<cite>
+<a class="bibref" href="#bib-RFC4627">
+RFC4627
+</a>
+</cite>
+].
+You
+must
+also
+understand
+the
+JSON-LD
+syntax
+defined
+in
+[
+<cite>
+<a class="bibref" href="#bib-JSON-LD">
+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 class="bibref" href="#bib-ECMA-262">
+ECMA-262
+</a>
+</cite>
+]
+and
+WebIDL
+[
+<cite>
+<a class="bibref" href="#bib-WEBIDL">
+WEBIDL
+</a>
+</cite>
+].
+To
+understand
+how
+JSON-LD
+maps
+to
+RDF,
+it
+is
+helpful
+to
+be
+familiar
+with
+the
+basic
+RDF
+concepts
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</p>
+</section>
+<section class="informative" id="features">
+<h2>
+<span class="secno">
+2.
+</span>
+Features
+</h2>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+The
+JSON-LD
+Syntax
+specification
+[
+<cite>
+<a class="bibref" href="#bib-JSON-LD">
+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 class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+that
+is
+different
+from
+their
+own,
+a
+JSON-LD
+processor
+must
+be
+able
+to
+transform
+a
+document
+from
+one
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+to
+another.
+Instead
+of
+requiring
+JSON-LD
+processors
+to
+write
+specific
+code
+for
+every
+imaginable
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+switching
+scenario,
+it
+is
+much
+easier
+to
+specify
+a
+single
+algorithm
+that
+can
+remove
+any
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>.
+Similarly,
+another
+algorithm
+can
+be
+specified
+to
+subsequently
+apply
+any
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>.
+These
+two
+algorithms
+represent
+the
+most
+basic
+transformations
+of
+JSON-LD
+documents.
+They
+are
+referred
+to
+as
+<a class="tref internalDFN" title="expansion" href="#dfn-expansion">
+expansion
+</a>
+and
+<a class="tref internalDFN" title="compaction" href="#dfn-compaction">
+compaction
+</a>,
+respectively.
+</p>
+<p>
+There
+are
+four
+major
+types
+of
+transformation
+that
+are
+discussed
+in
+this
+document:
+expansion,
+compaction,
+flattening,
+and
+RDF
+conversion.
+</p>
+<section class="informative" id="expansion">
+<h3>
+<span class="secno">
+2.1
+</span>
+Expansion
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+The
+algorithm
+that
+removes
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+is
+called
+<dfn title="expansion" id="dfn-expansion">
+expansion
+</dfn>.
+Before
+performing
+any
+other
+transformations
+on
+a
+JSON-LD
+document,
+it
+is
+easiest
+to
+remove
+any
+<a class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+and
+is
+fairly
+compact:
+</p>
+    <div class="example"><div class="example-title"><span>Example 1</span>: Sample JSON-LD document</div><pre class="example">{
+  &quot;@context&quot;: {
+    &quot;name&quot;: &quot;http://xmlns.com/foaf/0.1/name&quot;,
+    &quot;homepage&quot;: {
+      &quot;@id&quot;: &quot;http://xmlns.com/foaf/0.1/homepage&quot;,
+      &quot;@type&quot;: &quot;@id&quot;
+    }
+  },
+  &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+  &quot;name&quot;: &quot;Markus Lanthaler&quot;,
+  &quot;homepage&quot;: &quot;http://www.markus-lanthaler.com/&quot;
+}
+</pre>
+</div>
+<p>
+The
+next
+input
+example
+uses
+one
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+to
+express
+a
+property
+and
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+to
+encapsulate
+another,
+but
+leaves
+the
+rest
+of
+the
+information
+untouched.
+</p>
+    <div class="example"><div class="example-title"><span>Example 2</span>: Sample JSON-LD document using an IRI instead of a term to express a property</div><pre class="example">{
+  &quot;@context&quot;: {
+    <span class="diff">&quot;website&quot;: &quot;http://xmlns.com/foaf/0.1/homepage&quot;</span>
+  },
+  &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+  &quot;<span class="diff">http://xmlns.com/foaf/0.1/name</span>&quot;: &quot;Markus Lanthaler&quot;,
+  <span class="diff">&quot;website&quot;</span>: <span class="diff">{ &quot;@id&quot;:</span> &quot;http://www.markus-lanthaler.com/&quot; <span class="diff">}</span>
+}
+</pre>
+</div>
+<p>
+Note
+that
+both
+inputs
+are
+valid
+JSON-LD
+and
+both
+represent
+the
+same
+information.
+The
+difference
+is
+in
+their
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+information
+and
+in
+the
+data
+structures
+used.
+A
+JSON-LD
+processor
+can
+remove
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+and
+ensure
+that
+the
+data
+is
+more
+regular
+by
+employing
+<a class="tref internalDFN" title="expansion" href="#dfn-expansion">
+expansion
+</a>.
+</p>
+<p>
+<a class="tref internalDFN" title="expansion" href="#dfn-expansion">
+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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+IRIs
+</a>
+and
+by
+expressing
+all
+values
+in
+<a class="tref internalDFN" title="array" href="#dfn-array">
+arrays
+</a>
+in
+<a class="tref internalDFN" title="expanded-form" href="#dfn-expanded-form">
+expanded
+form
+</a>.
+<a class="tref internalDFN" title="expanded-form" href="#dfn-expanded-form">
+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-Future-JsonLdInput-input-JsonLdOptions-options">
+expand
+</a>
+</code>
+operation)
+against
+the
+above
+examples
+results
+in
+the
+following
+output:
+</p>
+    <div class="example"><div class="example-title"><span>Example 3</span>: Expanded sample document</div><pre class="example">[
+  {
+    &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+    &quot;http://xmlns.com/foaf/0.1/name&quot;: [
+      { &quot;@value&quot;: &quot;Markus Lanthaler&quot; }
+    ],
+    &quot;http://xmlns.com/foaf/0.1/homepage&quot;: [
+      { &quot;@id&quot;: &quot;http://www.markus-lanthaler.com/&quot; }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Note
+that
+in
+the
+output
+above
+all
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+definitions
+have
+been
+removed,
+all
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+and
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+IRIs
+</a>
+have
+been
+expanded
+to
+absolute
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>,
+and
+all
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+values
+</a>
+are
+expressed
+in
+<a class="tref internalDFN" title="array" href="#dfn-array">
+arrays
+</a>
+in
+<a class="tref internalDFN" title="expanded-form" href="#dfn-expanded-form">
+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 class="informative" id="compaction">
+<h3>
+<span class="secno">
+2.2
+</span>
+Compaction
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+While
+<a class="tref internalDFN" title="expansion" href="#dfn-expansion">
+expansion
+</a>
+removes
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+from
+a
+given
+input,
+<a class="tref internalDFN" title="compaction" href="#dfn-compaction">
+compaction's
+</a>
+primary
+function
+is
+to
+perform
+the
+opposite
+operation:
+to
+express
+a
+given
+input
+according
+to
+a
+particular
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>.
+<dfn title="compaction" id="dfn-compaction">
+Compaction
+</dfn>
+applies
+a
+<a class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="compaction" href="#dfn-compaction">
+Compaction
+</a>
+uses
+a
+developer-supplied
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+to
+shorten
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>
+to
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+or
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+IRIs
+</a>
+and
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+values
+</a>
+expressed
+in
+<a class="tref internalDFN" title="expanded-form" href="#dfn-expanded-form">
+expanded
+form
+</a>
+to
+simple
+values
+such
+as
+<a class="tref internalDFN" title="string" href="#dfn-string">
+strings
+</a>
+or
+<a class="tref internalDFN" title="number" href="#dfn-number">
+numbers
+</a>.
+</p>
+<p>
+For
+example,
+assume
+the
+following
+expanded
+JSON-LD
+input
+document:
+</p>
+    <div class="example"><div class="example-title"><span>Example 4</span>: Expanded sample document</div><pre class="example">[
+  {
+    &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+    &quot;http://xmlns.com/foaf/0.1/name&quot;: [
+      { &quot;@value&quot;: &quot;Markus Lanthaler&quot; }
+    ],
+    &quot;http://xmlns.com/foaf/0.1/homepage&quot;: [
+      { &quot;@id&quot;: &quot;http://www.markus-lanthaler.com/&quot; }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Additionally,
+assume
+the
+following
+developer-supplied
+JSON-LD
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>:
+</p>
+    <div class="example"><div class="example-title"><span>Example 5</span>: JSON-LD context</div><pre class="example">{
+  &quot;@context&quot;: {
+    &quot;name&quot;: &quot;http://xmlns.com/foaf/0.1/name&quot;,
+    &quot;homepage&quot;: {
+      &quot;@id&quot;: &quot;http://xmlns.com/foaf/0.1/homepage&quot;,
+      &quot;@type&quot;: &quot;@id&quot;
+    }
+  }
+}
+</pre>
+</div>
+<p>
+Running
+the
+<a href="#compaction-algorithm">
+Compaction
+Algorithm
+</a>
+(
+<code class="idlMemberName">
+<a href="#widl-JsonLdProcessor-compact-Future-JsonLdInput-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>
+    <div class="example"><div class="example-title"><span>Example 6</span>: Compacted sample document</div><pre class="example">{
+  &quot;@context&quot;: {
+    &quot;name&quot;: &quot;http://xmlns.com/foaf/0.1/name&quot;,
+    &quot;homepage&quot;: {
+      &quot;@id&quot;: &quot;http://xmlns.com/foaf/0.1/homepage&quot;,
+      &quot;@type&quot;: &quot;@id&quot;
+    }
+  },
+  &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+  &quot;name&quot;: &quot;Markus Lanthaler&quot;,
+  &quot;homepage&quot;: &quot;http://www.markus-lanthaler.com/&quot;
+}
+</pre>
+</div>
+<p>
+Note
+that
+all
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>
+have
+been
+compacted
+to
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+as
+specified
+in
+the
+<a class="tref internalDFN" title="context" href="#dfn-context">
+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 class="informative" id="flattening">
+<h3>
+<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 class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+may
+be
+spread
+across
+a
+number
+of
+different
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+objects
+</a>.
+By
+flattening
+a
+document,
+all
+properties
+of
+a
+<a class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+are
+collected
+in
+a
+single
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+and
+all
+<a class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+nodes
+</a>
+are
+labeled
+with
+a
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+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>
+    <div class="example"><div class="example-title"><span>Example 7</span>: Sample JSON-LD document</div><pre class="example">{
+  &quot;@context&quot;: {
+    &quot;name&quot;: &quot;http://xmlns.com/foaf/0.1/name&quot;,
+    &quot;knows&quot;: &quot;http://xmlns.com/foaf/0.1/knows&quot;
+  },
+  &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+  &quot;name&quot;: &quot;Markus Lanthaler&quot;,
+  &quot;knows&quot;: [
+    {
+      &quot;name&quot;: &quot;Dave Longley&quot;
+    }
+  ]
+}
+</pre>
+</div>
+<p>
+Running
+the
+<a href="#flattening-algorithm">
+Flattening
+algorithm
+</a>
+(
+<code class="idlMemberName">
+<a href="#widl-JsonLdProcessor-flatten-Future-JsonLdInput-input-JsonLdContext-context-JsonLdOptions-options">
+flatten
+</a>
+</code>
+operation)
+with
+a
+context
+set
+to
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+to
+prevent
+compaction
+returns
+the
+following
+document:
+</p>
+    <div class="example"><div class="example-title"><span>Example 8</span>: Flattened sample document in expanded form</div><pre class="example">[
+  {
+    &quot;@id&quot;: &quot;_:t0&quot;,
+    &quot;http://xmlns.com/foaf/0.1/name&quot;: [
+      { &quot;@value&quot;: &quot;Dave Longley&quot; }
+    ]
+  },
+  {
+    &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+    &quot;http://xmlns.com/foaf/0.1/name&quot;: [
+      { &quot;@value&quot;: &quot;Markus Lanthaler&quot; }
+    ],
+    &quot;http://xmlns.com/foaf/0.1/knows&quot;: [
+      { &quot;@id&quot;: &quot;_:t0&quot; }
+    ]
+  }
+]
+</pre>
+</div>
+<p>
+Note
+how
+in
+the
+output
+above
+all
+properties
+of
+a
+<a class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+are
+collected
+in
+a
+single
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+and
+how
+the
+<a class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+node
+</a>
+representing
+&quot;Dave
+Longley&quot;
+has
+been
+assigned
+the
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+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>
+    <div class="example"><div class="example-title"><span>Example 9</span>: Flattened and compacted sample document</div><pre class="example">{
+  &quot;@context&quot;: {
+    &quot;name&quot;: &quot;http://xmlns.com/foaf/0.1/name&quot;,
+    &quot;knows&quot;: &quot;http://xmlns.com/foaf/0.1/knows&quot;
+  },
+  &quot;@graph&quot;: [
+    {
+      &quot;@id&quot;: &quot;_:t0&quot;,
+      &quot;name&quot;: &quot;Dave Longley&quot;
+    },
+    {
+      &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+      &quot;name&quot;: &quot;Markus Lanthaler&quot;,
+      &quot;knows&quot;: { &quot;@id&quot;: &quot;_:t0&quot; }
+    }
+  ]
+}
+</pre>
+</div>
+<p>
+Please
+note
+that
+the
+result
+of
+flattening
+and
+compacting
+a
+document
+is
+always
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+which
+contains
+an
+<code>
[email protected]
+</code>
+member
+that
+represents
+the
+<a class="tref internalDFN" title="default-graph" href="#dfn-default-graph">
+default
+graph
+</a>.
+</p>
+</section>
+<section class="informative" id="rdf-conversion">
+<h3>
+<span class="secno">
+2.4
+</span>
+RDF
+Conversion
+</h3>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+JSON-LD
+can
+be
+used
+to
+serialize
+data
+expressed
+in
+RDF
+as
+described
+in
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+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 class="bibref" href="#bib-TURTLE">
+TURTLE
+</a>
+</cite>
+]:
+</p>
+    <div class="example"><div class="example-title"><span>Example 10</span>: Sample Turtle document</div><pre class="example">&lt;http://me.markus-lanthaler.com/&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; &quot;Markus Lanthaler&quot; .
+&lt;http://me.markus-lanthaler.com/&gt;
+&lt;http://xmlns.com/foaf/0.1/homepage&gt;
+&lt;http://www.markus-lanthaler.com/&gt;
+.
+</pre>
+</div>
+<p>
+Using
+the
+<a href="#convert-from-rdf-algorithm">
+Convert
+from
+RDF
+algorithm
+</a>
+a
+developer
+could
+transform
+this
+document
+into
+expanded
+JSON-LD:
+</p>
+    <div class="example"><div class="example-title"><span>Example 11</span>: Sample Turtle document converted to JSON-LD</div><pre class="example">[
+  {
+    &quot;@id&quot;: &quot;http://me.markus-lanthaler.com/&quot;,
+    &quot;http://xmlns.com/foaf/0.1/name&quot;: [
+      { &quot;@value&quot;: &quot;Markus Lanthaler&quot; }
+    ],
+    &quot;http://xmlns.com/foaf/0.1/homepage&quot;: [
+      { &quot;@id&quot;: &quot;http://www.markus-lanthaler.com/&quot; }
+    ]
+  }
+]
+</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
+transform
+the
+JSON-LD
+document
+back
+to
+RDF
+using
+the
+<a href="#convert-to-rdf-algorithm">
+Convert
+to
+RDF
+algorithm
+</a>.
+</p>
+</section>
+</section>
+<section id="conformance">
+<h2>
+<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 class="rfc2119" title="MUST">
+MUST
+</em>,
+<em class="rfc2119" title="MUST NOT">
+MUST
+NOT
+</em>,
+<em class="rfc2119" title="REQUIRED">
+REQUIRED
+</em>,
+<em class="rfc2119" title="SHOULD">
+SHOULD
+</em>,
+<em class="rfc2119" title="SHOULD NOT">
+SHOULD
+NOT
+</em>,
+<em class="rfc2119" title="RECOMMENDED">
+RECOMMENDED
+</em>,
+<em class="rfc2119" title="MAY">
+MAY
+</em>,
+and
+<em class="rfc2119" title="OPTIONAL">
+OPTIONAL
+</em>
+in
+this
+specification
+are
+to
+be
+interpreted
+as
+described
+in
+[
+<cite>
+<a class="bibref" href="#bib-RFC2119">
+RFC2119
+</a>
+</cite>
+].
+</p>
+<p>
+There
+are
+three
+classes
+of
+products
+that
+can
+claim
+conformance
+to
+this
+specification:
+<a class="tref internalDFN" title="json-ld-processor" href="#dfn-json-ld-processor">
+JSON-LD
+Processors
+</a>,
+<a class="tref internalDFN" title="json-ld-api-implementation" href="#dfn-json-ld-api-implementation">
+JSON-LD
+API
+Implementations
+</a>,
+and
+<a class="tref internalDFN" title="json-ld-rdf-converter" href="#dfn-json-ld-rdf-converter">
+JSON-LD-RDF
+Converters
+</a>.
+</p>
+<p>
+A
+conforming
+<dfn title="json-ld-processor" id="dfn-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>
+A
+conforming
+<dfn title="json-ld-api-implementation" id="dfn-json-ld-api-implementation">
+JSON-LD
+API
+Implementation
+</dfn>
+is
+a
+conforming
+<a class="tref internalDFN" title="json-ld-processor" href="#dfn-json-ld-processor">
+JSON-LD
+Processor
+</a>
+that
+exposes
+the
+<a href="#the-application-programming-interface">
+Application
+Programming
+Interface
+(API)
+</a>
+defined
+in
+this
+specification.
+It
+<em class="rfc2119" title="MUST">
+MUST
+</em>
+implement
+the
+<code>
+json-ld-1.0
+</code>
+processing
+mode
+(for
+further
+details,
+see
+the
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-processingMode">
+processingMode
+</a>
+</code>
+option
+of
+<a href="#idl-def-JsonLdOptions" class="idlType">
+<code>
+JsonLdOptions
+</code>
+</a>
+).
+</p>
+<p>
+<a class="tref internalDFN" title="json-ld-processor" href="#dfn-json-ld-processor">
+JSON-LD
+Processors
+</a>
+and
+<a class="tref internalDFN" title="json-ld-api-implementation" href="#dfn-json-ld-api-implementation">
+API
+Implementations
+</a>
+<em class="rfc2119" title="MUST NOT">
+MUST
+NOT
+</em>
+attempt
+to
+correct
+malformed
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>
+or
+language
+tags;
+however,
+they
+<em class="rfc2119" title="MAY">
+MAY
+</em>
+issue
+validation
+warnings.
+IRIs
+are
+not
+modified
+other
+than
+converted
+between
+<a class="tref internalDFN" title="relative-iri" href="#dfn-relative-iri">
+relative
+</a>
+and
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+IRIs
+</a>.
+</p>
+<p>
+A
+conforming
+<dfn title="json-ld-rdf-converter" id="dfn-json-ld-rdf-converter">
+JSON-LD-RDF
+Converter
+</dfn>
+is
+a
+system
+that
+can
+perform
+<a href="#convert-to-rdf-algorithm">
+Conversion
+to
+RDF
+</a>
+and
+<a href="#convert-from-rdf-algorithm">
+Conversion
+from
+RDF
+</a>.
+</p>
+<p>
+The
+algorithms
+in
+this
+specification
+are
+generally
+written
+with
+more
+concern
+for
+clarity
+than
+efficiency.
+Thus,
+<a class="tref internalDFN" title="json-ld-processor" href="#dfn-json-ld-processor">
+JSON-LD
+Processors
+</a>
+and
+<a class="tref internalDFN" title="json-ld-api-implementation" href="#dfn-json-ld-api-implementation">
+API
+Implementations
+</a>
+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 class="note-title" role="heading" aria-level="3">
+<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 class="bibref" href="#bib-JSON-LD-TESTS">
+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>
+<span class="secno">
+4.
+</span>
+General
+Terminology
+</h2>
+<p>
+This
+document
+uses
+the
+following
+terms
+as
+defined
+in
+JSON
+[
+<cite>
+<a class="bibref" href="#bib-RFC4627">
+RFC4627
+</a>
+</cite>
+].
+Refer
+to
+the
+<em>
+JSON
+Grammar
+</em>
+section
+in
+[
+<cite>
+<a class="bibref" href="#bib-RFC4627">
+RFC4627
+</a>
+</cite>
+]
+for
+formal
+definitions.
+</p>
+<dl>
+<dt>
+<dfn title="json-object" id="dfn-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 class="tref internalDFN" title="string" href="#dfn-string">
+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 title="array" id="dfn-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 class="bibref" href="#bib-JSON-LD">
+JSON-LD
+</a>
+</cite>
+]).
+</dd>
+<dt>
+<dfn title="string" id="dfn-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 title="number" id="dfn-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 title="true" id="dfn-true">
+true
+</dfn>
+and
+<dfn title="false" id="dfn-false">
+false
+</dfn>
+</dt>
+<dd>
+Values
+that
+are
+used
+to
+express
+one
+of
+two
+possible
+boolean
+states.
+</dd>
+<dt>
+<dfn title="null" id="dfn-null">
+null
+</dfn>
+</dt>
+<dd>
+The
+<a class="tref internalDFN" title="null" href="#dfn-null">
+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 class="tref internalDFN" title="null" href="#dfn-null">
+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 class="tref internalDFN" title="null" href="#dfn-null">
+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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+in
+expanded
+form,
+then
+the
+entire
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+is
+ignored.
+</dd>
+</dl>
+<p>
+Furthermore,
+the
+following
+terminology
+is
+used
+throughout
+this
+document:
+</p>
+<dl>
+<dt>
+<dfn title="keyword" id="dfn-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 class="bibref" href="#bib-JSON-LD">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="context" id="dfn-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 class="bibref" href="#bib-JSON-LD">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="json-ld-document" id="dfn-json-ld-document">
+JSON-LD
+document
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="json-ld-document" href="#dfn-json-ld-document">
+JSON-LD
+document
+</a>
+is
+a
+serialization
+of
+a
+collection
+of
+<a class="tref internalDFN" title="json-ld-graph" href="#dfn-json-ld-graph">
+JSON-LD
+graphs
+</a>
+and
+comprises
+exactly
+one
+<a class="tref internalDFN" title="default-graph" href="#dfn-default-graph">
+default
+graph
+</a>
+and
+zero
+or
+more
+<a class="tref internalDFN" title="named-graph" href="#dfn-named-graph">
+named
+graphs
+</a>.
+</dd>
+<dt>
+<dfn title="named-graph" id="dfn-named-graph">
+named
+graph
+</dfn>
+</dt>
+<dd>
+A
+named
+graph
+is
+a
+pair
+consisting
+of
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+node
+</a>
+(the
+<dfn title="graph-name" id="dfn-graph-name">
+graph
+name
+</dfn>
+)
+and
+a
+<a class="tref internalDFN" title="json-ld-graph" href="#dfn-json-ld-graph">
+JSON-LD
+graph
+</a>.
+</dd>
+<dt>
+<dfn title="default-graph" id="dfn-default-graph">
+default
+graph
+</dfn>
+</dt>
+<dd>
+The
+default
+graph
+is
+the
+only
+graph
+in
+a
+JSON-LD
+document
+which
+has
+no
+<a class="tref internalDFN" title="graph-name" href="#dfn-graph-name">
+graph
+name
+</a>.
+</dd>
+<dt>
+<dfn title="json-ld-graph" id="dfn-json-ld-graph">
+JSON-LD
+graph
+</dfn>
+</dt>
+<dd>
+A
+labeled
+directed
+graph,
+i.e.,
+a
+set
+of
+<a class="tref internalDFN" title="node" href="#dfn-node">
+nodes
+</a>
+connected
+by
+<a class="tref internalDFN" title="edge" href="#dfn-edge">
+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 class="bibref" href="#bib-JSON-LD">
+JSON-LD
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="edge" id="dfn-edge">
+edge
+</dfn>
+</dt>
+<dd>
+Every
+<a class="tref internalDFN" title="edge" href="#dfn-edge">
+edge
+</a>
+has
+a
+direction
+associated
+with
+it
+and
+is
+labeled
+with
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+a
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+blank
+node
+identifier
+</a>.
+Within
+the
+JSON-LD
+syntax
+these
+edge
+labels
+are
+called
+<dfn title="property" id="dfn-property">
+properties
+</dfn>.
+Whenever
+possible,
+an
+<a class="tref internalDFN" title="edge" href="#dfn-edge">
+edge
+</a>
+should
+be
+labeled
+with
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</dd>
+<dt>
+<dfn title="node" id="dfn-node">
+node
+</dfn>
+</dt>
+<dd>
+Every
+<a class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+is
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+a
+<a class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+node
+</a>,
+a
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+value
+</a>,
+or
+a
+<a class="tref internalDFN" title="list" href="#dfn-list">
+list
+</a>.
+</dd>
+<dt>
+<dfn title="iri" id="dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>
+</dt>
+<dd>
+An
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+(Internationalized
+Resource
+Identifier)
+is
+a
+string
+that
+conforms
+to
+the
+syntax
+defined
+in
+[
+<cite>
+<a class="bibref" href="#bib-RFC3987">
+RFC3987
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="absolute-iri" id="dfn-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 class="bibref" href="#bib-RFC3987">
+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 title="relative-iri" id="dfn-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
+some
+other
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+;
+in
+the
+case
+of
+JSON-LD
+this
+is
+the
+base
+location
+of
+the
+document.
+</dd>
+<dt>
+<dfn title="blank-node" id="dfn-blank-node">
+blank
+node
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+in
+a
+<a class="tref internalDFN" title="json-ld-graph" href="#dfn-json-ld-graph">
+JSON-LD
+graph
+</a>
+that
+is
+neither
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+nor
+a
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+value
+</a>,
+nor
+a
+<a class="tref internalDFN" title="list" href="#dfn-list">
+list
+</a>.
+</dd>
+<dt>
+<dfn title="blank-node-identifier" id="dfn-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 class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+node
+</a>
+within
+the
+scope
+of
+a
+JSON-LD
+document.
+Blank
+node
+identifiers
+begin
+with
+<code>
+_:
+</code>.
+</dd>
+<dt>
+<dfn title="json-ld-value" id="dfn-json-ld-value">
+JSON-LD
+value
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+value
+</a>
+is
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>,
+a
+<a class="tref internalDFN" title="number" href="#dfn-number">
+number
+</a>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+or
+<a class="tref internalDFN" title="false" href="#dfn-false">
+false
+</a>,
+a
+<a class="tref internalDFN" title="typed-value" href="#dfn-typed-value">
+typed
+value
+</a>,
+or
+a
+<a class="tref internalDFN" title="language-tagged-string" href="#dfn-language-tagged-string">
+language-tagged
+string
+</a>.
+</dd>
+<dt>
+<dfn title="typed-value" id="dfn-typed-value">
+typed
+value
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="typed-value" href="#dfn-typed-value">
+typed
+value
+</a>
+consists
+of
+a
+value,
+which
+is
+a
+string,
+and
+a
+type,
+which
+is
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</dd>
+<dt>
+<dfn title="language-tagged-string" id="dfn-language-tagged-string">
+language-tagged
+string
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="language-tagged-string" href="#dfn-language-tagged-string">
+language-tagged
+string
+</a>
+consists
+of
+a
+string
+and
+a
+non-empty
+language
+tag
+as
+defined
+by
+[
+<cite>
+<a class="bibref" href="#bib-BCP47">
+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 class="bibref" href="#bib-BCP47">
+BCP47
+</a>
+</cite>
+],
+and
+is
+normalized
+to
+lowercase.
+</dd>
+<dt>
+<dfn title="list" id="dfn-list">
+list
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="list" href="#dfn-list">
+list
+</a>
+is
+an
+ordered
+sequence
+of
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>,
+<a class="tref internalDFN" title="blank-node" href="#dfn-blank-node">
+blank
+nodes
+</a>,
+and
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+values
+</a>.
+</dd>
+</dl>
+</section>
+<section id="algorithm-terms">
+<h2>
+<span class="secno">
+5.
+</span>
+Algorithm
+Terms
+</h2>
+<dl>
+<dt>
+<dfn title="active-graph" id="dfn-active-graph">
+active
+graph
+</dfn>
+</dt>
+<dd>
+The
+name
+of
+the
+currently
+active
+graph
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn title="active-subject" id="dfn-active-subject">
+active
+subject
+</dfn>
+</dt>
+<dd>
+The
+currently
+active
+subject
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn title="active-property" id="dfn-active-property">
+active
+property
+</dfn>
+</dt>
+<dd>
+The
+currently
+active
+<a class="tref internalDFN" title="property" href="#dfn-property">
+property
+</a>
+or
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>
+that
+the
+processor
+should
+use
+when
+processing.
+</dd>
+<dt>
+<dfn title="active-context" id="dfn-active-context">
+active
+context
+</dfn>
+</dt>
+<dd>
+A
+context
+that
+is
+used
+to
+resolve
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+while
+the
+processing
+algorithm
+is
+running.
+</dd>
+<dt>
+<dfn title="local-context" id="dfn-local-context">
+local
+context
+</dfn>
+</dt>
+<dd>
+A
+context
+that
+is
+specified
+within
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>,
+specified
+via
+the
+<code>
[email protected]
+</code>
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>.
+</dd>
+<dt>
+<dfn title="json-ld-input" id="dfn-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 title="term" id="dfn-term">
+term
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+is
+a
+short
+word
+defined
+in
+a
+context
+that
+may
+be
+expanded
+to
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+</dd>
+<dt>
+<dfn title="compact-iri" id="dfn-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 title="prefix" id="dfn-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 class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+definitions
+for
+each
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+contained
+within
+a
+common
+vocabulary
+identified
+by
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>.
+</dd>
+<dt>
+<dfn title="node-object" id="dfn-node-object">
+node
+object
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="node-object" href="#dfn-node-object">
+node
+object
+</a>
+represents
+zero
+or
+more
+properties
+of
+a
+<a class="tref internalDFN" title="node" href="#dfn-node">
+node
+</a>
+in
+the
+<a class="tref internalDFN" title="json-ld-graph" href="#dfn-json-ld-graph">
+JSON-LD
+graph
+</a>
+serialized
+by
+the
+JSON-LD
+document.
+A
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+is
+a
+<a class="tref internalDFN" title="node-object" href="#dfn-node-object">
+node
+object
+</a>
+if
+it
+exists
+outside
+of
+the
+JSON-LD
+<a class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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 title="value-object" id="dfn-value-object">
+value
+object
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="value-object" href="#dfn-value-object">
+value
+object
+</a>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn title="list-object" id="dfn-list-object">
+list
+object
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="list-object" href="#dfn-list-object">
+list
+object
+</a>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn title="set-object" id="dfn-set-object">
+set
+object
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref internalDFN" title="set-object" href="#dfn-set-object">
+set
+object
+</a>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+that
+has
+an
+<code>
[email protected]
+</code>
+member.
+</dd>
+<dt>
+<dfn title="scalar" id="dfn-scalar">
+scalar
+</dfn>
+</dt>
+<dd>
+A
+scalar
+is
+either
+a
+JSON
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>,
+<a class="tref internalDFN" title="number" href="#dfn-number">
+number
+</a>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+or
+<a class="tref internalDFN" title="false" href="#dfn-false">
+false
+</a>.
+</dd>
+<dt>
+<dfn title="rdf-subject" id="dfn-rdf-subject">
+RDF
+subject
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref externalDFN" title="subject" href="http://www.w3.org/TR/rdf11-concepts/#dfn-subject">
+subject
+</a>
+as
+specified
+by
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="rdf-predicate" id="dfn-rdf-predicate">
+RDF
+predicate
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref externalDFN" title="predicate" href="http://www.w3.org/TR/rdf11-concepts/#dfn-predicate">
+predicate
+</a>
+as
+specified
+by
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="rdf-object" id="dfn-rdf-object">
+RDF
+object
+</dfn>
+</dt>
+<dd>
+An
+<a class="tref externalDFN" title="object" href="http://www.w3.org/TR/rdf11-concepts/#dfn-object">
+object
+</a>
+as
+specified
+by
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="rdf-triple" id="dfn-rdf-triple">
+RDF
+triple
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref externalDFN" title="triple" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple">
+triple
+</a>
+as
+specified
+by
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+].
+</dd>
+<dt>
+<dfn title="rdf-dataset" id="dfn-rdf-dataset">
+RDF
+dataset
+</dfn>
+</dt>
+<dd>
+A
+<a class="tref externalDFN" title="dataset" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset">
+dataset
+</a>
+as
+specified
+by
+[
+<cite>
+<a class="bibref" href="#bib-RDF11-CONCEPTS">
+RDF11-CONCEPTS
+</a>
+</cite>
+]
+representing
+a
+collection
+of
+<a class="tref externalDFN" title="rdf-graphs" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph">
+RDF
+graphs
+</a>.
+</dd>
+</dl>
+</section>
+<section id="context-processing-algorithms">
+<h2>
+<span class="secno">
+6.
+</span>
+Context
+Processing
+Algorithms
+</h2>
+<section id="context-processing-algorithm">
+<h3>
+<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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+This
+section
+describes
+how
+to
+produce
+an
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+</p>
+<p>
+The
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+contains
+the
+active
+<dfn title="term-definition" id="dfn-term-definition">
+term
+definitions
+</dfn>
+which
+specify
+how
+properties
+and
+values
+have
+to
+be
+interpreted
+as
+well
+as
+the
+current
+<dfn title="base-iri" id="dfn-base-iri">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</dfn>,
+the
+<dfn title="vocabulary-mapping" id="dfn-vocabulary-mapping">
+vocabulary
+mapping
+</dfn>
+and
+the
+<dfn title="default-language" id="dfn-default-language">
+default
+language
+</dfn>.
+Each
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+consists
+of
+an
+<dfn title="iri-mapping" id="dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</dfn>,
+a
+boolean
+flag
+<dfn title="reverse-property" id="dfn-reverse-property">
+reverse
+property
+</dfn>,
+an
+optional
+<dfn title="type-mapping" id="dfn-type-mapping">
+type
+mapping
+</dfn>
+or
+<dfn title="language-mapping" id="dfn-language-mapping">
+language
+mapping
+</dfn>,
+and
+an
+optional
+<dfn title="container-mapping" id="dfn-container-mapping">
+container
+mapping
+</dfn>.
+A
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+can
+not
+only
+be
+used
+to
+map
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+to
+an
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>,
+but
+also
+to
+map
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+to
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>,
+in
+which
+case
+it
+is
+referred
+to
+as
+a
+<dfn title="keyword-alias" id="dfn-keyword-alias">
+keyword
+alias
+</dfn>.
+</p>
+<p>
+When
+processing,
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+is
+initialized
+without
+any
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definitions
+</a>,
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>,
+or
+<a class="tref internalDFN" title="default-language" href="#dfn-default-language">
+default
+language
+</a>.
+If
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+encountered
+during
+processing,
+a
+new
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+is
+created
+by
+cloning
+the
+existing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+Then
+the
+information
+from
+the
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+merged
+into
+the
+new
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+Given
+that
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+contexts
+</a>
+may
+contain
+references
+to
+remote
+contexts,
+this
+includes
+their
+retrieval.
+</p>
+<section class="informative">
+<h4 id="overview">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+First
+we
+prepare
+a
+new
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+<i>
+result
+</i>
+by
+cloning
+the
+current
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+Then
+we
+normalize
+the
+form
+of
+the
+passed
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+to
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>.
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+Local
+contexts
+</a>
+may
+be
+in
+the
+form
+of
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>,
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>,
+or
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+containing
+a
+combination
+of
+the
+two.
+Finally
+we
+process
+each
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+contained
+in
+the
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+as
+follows.
+</p>
+<p>
+If
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+is
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>,
+it
+represents
+a
+reference
+to
+a
+remote
+context.
+We
+dereference
+the
+remote
+context
+and
+replace
+<a class="tref internalDFN" title="context" href="#dfn-context">
+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 class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+by
+recursively
+using
+this
+algorithm
+ensuring
+that
+there
+is
+no
+cyclical
+reference.
+</p>
+<p>
+If
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>,
+we
+first
+update
+the
+<a class="tref internalDFN" title="base-iri" href="#dfn-base-iri">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+the
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>,
+and
+the
+<a class="tref internalDFN" title="default-language" href="#dfn-default-language">
+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 class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+because
+they
+affect
+how
+the
+other
+keys
+are
+processed.
+<ins class="diff-new">Please
+note
+that
+</ins><code><ins class="diff-new">
[email protected]
+</ins></code><ins class="diff-new">
+is
+ignored
+when
+processing
+remote
+contexts.
+</ins>
+</p>
+<p>
+Then,
+for
+every
+other
+key
+in
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+we
+update
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+in
+<i>
+result
+</i>.
+Since
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definitions
+</a>
+in
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+may
+themselves
+contain
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+or
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+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 class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+dependencies,
+we
+update
+the
+current
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>,
+which
+may
+be
+a
+<a class="tref internalDFN" title="keyword-alias" href="#dfn-keyword-alias">
+keyword
+alias
+</a>.
+</p>
+<p>
+Finally,
+we
+return
+<i>
+result
+</i>
+as
+the
+new
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+</p>
+</section>
+<section>
+<h4 id="algorithm">
+Algorithm
+</h4>
+<p>
+This
+algorithm
+specifies
+how
+a
+new
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+is
+updated
+with
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>.
+The
+algorithm
+takes
+three
+input
+variables:
+an
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+and
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+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 class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>.
+</p>
+<ol class="algorithm">
+<li>
+Initialize
+<i>
+result
+</i>
+to
+the
+result
+of
+cloning
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+</li>
+<li>
+If
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+not
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>,
+set
+it
+to
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+containing
+only
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>.
+</li>
+<li>
+For
+each
+item
+<i>
+context
+</i>
+in
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>:
+<ol class="algorithm">
+<li>
+If
+<i>
+context
+</i>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+set
+<i>
+result
+</i>
+to
+a
+newly-initialized
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+and
+continue
+with
+the
+next
+<i>
+context
+</i>.
+<ins class="diff-new">The
+</ins><a class="tref internalDFN" title="base-iri" href="#dfn-base-iri"><ins class="diff-new">
+base
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr></a><ins class="diff-new">
+of
+the
+</ins><a class="tref internalDFN" title="active-context" href="#dfn-active-context"><ins class="diff-new">
+active
+context
+</ins></a><ins class="diff-new">
+is
+set
+to
+the
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr><ins class="diff-new">
+of
+the
+currently
+being
+processed
+document
+(which
+might
+be
+different
+from
+the
+currently
+being
+processed
+context),
+if
+available;
+otherwise
+to
+</ins><a class="tref internalDFN" title="null" href="#dfn-null"><ins class="diff-new">
+null
+</ins></a>.<ins class="diff-new">
+If
+set,
+the
+</ins><code class="idlMemberName"><a href="#widl-JsonLdOptions-compactArrays"><ins class="diff-new">
+compactArrays
+</ins></a></code><ins class="diff-new">
+option
+of
+a
+</ins><a class="tref internalDFN" title="json-ld-api-implementation" href="#dfn-json-ld-api-implementation"><ins class="diff-new">
+JSON-LD
+API
+Implementation
+</ins></a><ins class="diff-new">
+overrides
+the
+</ins><a class="tref internalDFN" title="base-iri" href="#dfn-base-iri"><ins class="diff-new">
+base
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr></a>.
+</li>
+<li>
+If
+<i>
+context
+</i>
+is
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+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 class="bibref" href="#bib-RFC3986">
+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 class="bibref" href="#bib-RFC3986">
+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 class="bibref" href="#bib-RFC3987">
+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>
+<del class="diff-old">Initialize
+context
+no
+base
+to
+the
+result
+of
+cloning
+the
+active
+context
+.
+Remove
+the
+base
+IRI
+of
+</del>
+<ins class="diff-chg">Dereference
+</ins>
+<i>
+context
+<del class="diff-old">no
+base
+</del>
+</i>.
+<del class="diff-old">Dereference
+</del>
+<ins class="diff-chg">If
+</ins>
+<i>
+context
+<del class="diff-old">.
+</del>
+</i>
+<ins class="diff-chg">cannot
+be
+dereferenced,
+a
+</ins><code class="error"><a href="#idl-def-JsonLdErrorCode.loading-remote-context-failed"><ins class="diff-chg">
+loading
+remote
+context
+failed
+</ins></a></code><ins class="diff-chg">
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</ins>
+If
+the
+dereferenced
+document
+has
+no
+top-level
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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>
+<del class="diff-old">context
+</del>
+<ins class="diff-chg">result
+</ins>
+</i>
+to
+the
+result
+of
+recursively
+calling
+this
+algorithm,
+passing
+<i>
+<del class="diff-old">context
+no
+base
+</del>
+<ins class="diff-chg">result
+</ins>
+</i>
+for
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<i>
+context
+</i>
+for
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+and
+<i>
+remote
+contexts
+</i>.
+</li>
+<li>
+<del class="diff-old">If
+context
+has
+no
+base
+IRI
+but
+result
+does,
+set
+the
+base
+IRI
+of
+context
+to
+the
+one
+of
+result
+.
+Overwrite
+result
+with
+context
+and
+continue
+</del>
+<ins class="diff-chg">Continue
+</ins>
+with
+the
+next
+<i>
+context
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+context
+</i>
+is
+not
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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>
+<del class="diff-old">key:
+Feature
+at
+Risk
+1
+:
[email protected]
+keyword
+Note:
+This
+feature
+is
+&quot;at
+risk&quot;
+</del>
+<ins class="diff-chg">key
+</ins>
+and
+<del class="diff-old">may
+be
+removed
+from
+this
+specification
+based
+on
+feedback.
+Please
+send
+feedback
+to
[email protected]
+.
+For
+the
+current
+status
+see
+features
+&quot;at
+risk&quot;
+in
+JSON-LD
+1.0
+Support
+for
+the
[email protected]
+keyword
+might
+be
+removed
+from
+JSON-LD
+1.0
+if
+implementation
+experience
+reveals
+that
+the
+fact
+that
+a
+document
+may
+have
+multiple
+base
+IRIs
+is
+confusing
+for
+developers.
+It
+</del>
+<i>
+<ins class="diff-chg">remote
+contexts
+</ins></i>
+is
+<del class="diff-old">also
+being
+discussed
+whether
+relative
+IRIs
+are
+allowed
+as
+values
+of
[email protected]
+or
+whether
+</del>
+<ins class="diff-chg">empty,
+i.e.,
+</ins>
+the
+<del class="diff-old">empty
+string
+should
+be
+used
+to
+explicitly
+specify
+that
+there
+isn't
+</del>
+<ins class="diff-chg">currently
+being
+processed
+context
+is
+not
+</ins>
+a
+<del class="diff-old">base
+IRI
+,
+which
+could
+be
+used
+to
+ensure
+that
+relative
+IRIs
+remain
+relative
+when
+expanding.
+</del>
+<ins class="diff-chg">remote
+context:
+</ins>
+<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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+remove
+the
+<a class="tref internalDFN" title="base-iri" href="#dfn-base-iri">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+the
+<a class="tref internalDFN" title="base-iri" href="#dfn-base-iri">
+base
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+<i>
+value
+</i>.
+<del class="diff-old">If
+it
+</del>
+</li>
+<li>
+<ins class="diff-chg">Otherwise,
+if
+</ins><i><ins class="diff-chg">
+value
+</ins></i>
+is
+<del class="diff-old">not
+an
+absolute
+</del>
+<ins class="diff-chg">a
+</ins><a class="tref internalDFN" title="relative-iri" href="#dfn-relative-iri"><ins class="diff-chg">
+relative
+</ins>
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+<ins class="diff-new">and
+the
+</ins><a class="tref internalDFN" title="base-iri" href="#dfn-base-iri"><ins class="diff-new">
+base
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr></a><ins class="diff-new">
+of
+</ins><i><ins class="diff-new">
+result
+</ins></i><ins class="diff-new">
+is
+not
+</ins><a class="tref internalDFN" title="null" href="#dfn-null"><ins class="diff-new">
+null
+</ins>
+</a>,
+<ins class="diff-new">set
+the
+</ins><a class="tref internalDFN" title="base-iri" href="#dfn-base-iri"><ins class="diff-new">
+base
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr></a><ins class="diff-new">
+of
+</ins><i><ins class="diff-new">
+result
+</ins></i><ins class="diff-new">
+to
+the
+result
+of
+resolving
+</ins><i><ins class="diff-new">
+value
+</ins></i><ins class="diff-new">
+against
+the
+current
+</ins><a class="tref internalDFN" title="base-iri" href="#dfn-base-iri"><ins class="diff-new">
+base
+</ins><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr></a><ins class="diff-new">
+of
+</ins><i><ins class="diff-new">
+result
+</ins></i>.</li><li><ins class="diff-new">
+Otherwise,
+</ins>
+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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+remove
+any
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>
+from
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+the
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+<i>
+value
+</i>.
+If
+it
+is
+not
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+remove
+any
+<a class="tref internalDFN" title="default-language" href="#dfn-default-language">
+default
+language
+</a>
+from
+<i>
+result
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>,
+the
+<a class="tref internalDFN" title="default-language" href="#dfn-default-language">
+default
+language
+</a>
+of
+<i>
+result
+</i>
+is
+set
+to
+lowercased
+<i>
+value
+</i>.
+If
+it
+is
+not
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+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 class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+<i>
+defined
+</i>
+to
+use
+to
+keep
+track
+of
+whether
+or
+not
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<i>
+context
+</i>
+for
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+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>
+<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 class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+in
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+for
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+being
+processed
+in
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>.
+</p>
+<section class="informative">
+<h4 id="overview-1">
+Overview
+</h4>
+<p>
+<em>
+This
+section
+is
+non-normative.
+</em>
+</p>
+<p>
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+Term
+definitions
+</a>
+are
+created
+by
+parsing
+the
+information
+in
+the
+given
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+for
+the
+given
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>.
+If
+the
+given
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+is
+a
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+it
+may
+omit
+an
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+by
+depending
+on
+its
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+having
+its
+own
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>.
+If
+the
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+is
+a
+key
+in
+the
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+then
+its
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+must
+first
+be
+created,
+through
+recursion,
+before
+continuing.
+Because
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+can
+depend
+on
+other
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+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 class="tref internalDFN" title="term" href="#dfn-term">
+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 class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+have
+been
+defined,
+the
+rest
+of
+the
+information
+in
+the
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+for
+the
+given
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+is
+taken
+into
+account,
+creating
+the
+appropriate
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>,
+<a class="tref internalDFN" title="container-mapping" href="#dfn-container-mapping">
+container
+mapping
+</a>,
+and
+<a class="tref internalDFN" title="type-mapping" href="#dfn-type-mapping">
+type
+mapping
+</a>
+or
+<a class="tref internalDFN" title="language-mapping" href="#dfn-language-mapping">
+language
+mapping
+</a>
+for
+the
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>.
+</p>
+</section>
+<section>
+<h4 id="algorithm-1">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+has
+four
+required
+inputs
+which
+are:
+an
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+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 class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+(indicating
+that
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+has
+already
+been
+created),
+return.
+Otherwise,
+if
+the
+value
+is
+<a class="tref internalDFN" title="false" href="#dfn-false">
+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 class="tref internalDFN" title="false" href="#dfn-false">
+false
+</a>.
+This
+indicates
+that
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+is
+now
+being
+created
+but
+is
+not
+yet
+complete.
+</li>
+<li>
+Since
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keywords
+</a>
+cannot
+be
+overridden,
+<i>
+term
+</i>
+must
+not
+be
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+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 class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+for
+<i>
+term
+</i>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+</li>
+<li>
+Initialize
+<i>
+value
+</i>
+to
+<ins class="diff-new">a
+copy
+of
+</ins>
+the
+value
+associated
+with
+the
+key
+<i>
+term
+</i>
+in
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+or
+<i>
+value
+</i>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>
+containing
+the
+key-value
+pair
+<code>
[email protected]
+</code>
+-
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+set
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+to
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+set
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+and
+return.
+</li>
+<li>
+Otherwise,
+if
+<i>
+value
+</i>
+is
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+<del class="diff-old">:
+Expand
+value
+by
+setting
+</del>
+</a>,
+<ins class="diff-chg">convert
+</ins>
+it
+to
+<del class="diff-old">the
+result
+of
+using
+the
+IRI
+Expansion
+algorithm
+,
+passing
+active
+context
+,
+value
+,
+true
+for
+vocab
+,
+true
+</del>
+<ins class="diff-chg">a
+</ins><a class="tref internalDFN" title="json-object" href="#dfn-json-object"><ins class="diff-chg">
+JSON
+object
+</ins>
+</a>
+<del class="diff-old">for
+document
+relative
+,
+local
+context
+,
+and
+defined
+.
+If
+value
+</del>
+<ins class="diff-chg">consisting
+of
+a
+single
+member
+whose
+key
+</ins>
+is
+<code>
+<del class="diff-old">@context
+,
+an
+invalid
+keyword
+alias
+</del>
+<ins class="diff-chg">@id
+</ins>
+</code>
+<del class="diff-old">error
+has
+been
+detected
+</del>
+and
+<del class="diff-old">processing
+</del>
+<ins class="diff-chg">whose
+value
+</ins>
+is
+<del class="diff-old">aborted.
+Set
+the
+IRI
+mapping
+for
+the
+term
+definition
+for
+</del>
+<i>
+<del class="diff-old">term
+in
+active
+context
+to
+value
+,
+set
+the
+</del>
+value
+<del class="diff-old">associated
+with
+defined
+'s
+key
+term
+to
+true
+,
+and
+return.
+</del>
+</i>.
+</li>
+<li>
+Otherwise,
+<i>
+value
+</i>
+must
+be
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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 class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>,
+<i>
+definition
+</i>.
+</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>,
+an
+<code>
[email protected]
+</code>,
+or
+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 class="tref internalDFN" title="string" href="#dfn-string">
+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 class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+for
+<i>
+value
+</i>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<del class="diff-old">true
+</del>
+<a class="tref internalDFN" title="false" href="#dfn-false">
+<ins class="diff-chg">false
+</ins>
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+and
+<i>
+defined
+</i>.
+If
+the
+result
+is
+not
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</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>
+Set
+the
+<a class="tref internalDFN" title="type-mapping" href="#dfn-type-mapping">
+type
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<code>
[email protected]
+</code>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+an
+<code>
[email protected]
+</code>
+member,
+set
+the
+<a class="tref internalDFN" title="container-mapping" href="#dfn-container-mapping">
+container
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<code>
[email protected]
+</code>
+if
+that
+is
+the
+value
+of
+the
+<code>
[email protected]
+</code>
+member;
+otherwise
+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
+index-containers)
+and
+processing
+is
+aborted.
+</li>
+<li>
+Set
+the
+<a class="tref internalDFN" title="reverse-property" href="#dfn-reverse-property">
+reverse
+property
+</a>
+flag
+of
+<i>
+definition
+</i>
+to
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>.
+</li>
+<li>
+Set
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+of
+<i>
+term
+</i>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+to
+<i>
+definition
+</i>
+and
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+and
+return.
+</li>
+</ol>
+</li>
+<li>
+Set
+the
+<a class="tref internalDFN" title="reverse-property" href="#dfn-reverse-property">
+reverse
+property
+</a>
+flag
+of
+<i>
+definition
+</i>
+to
+<a class="tref internalDFN" title="false" href="#dfn-false">
+false
+</a>.
+</li>
+<li>
+If
+<i>
+value
+</i>
+contains
+the
+key
+<code>
[email protected]
+<del class="diff-old">:
+</del>
+</code>
+<ins class="diff-chg">and
+its
+value
+does
+not
+equal
+</ins><i><ins class="diff-chg">
+term
+</ins></i>:
+<ol class="algorithm">
+<li>
+If
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+is
+not
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+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 class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key
+for
+<i>
+value
+</i>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<del class="diff-old">true
+</del>
+<a class="tref internalDFN" title="false" href="#dfn-false">
+<ins class="diff-chg">false
+</ins>
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+and
+<i>
+defined
+</i>.
+<ins class="diff-new">If
+the
+resulting
+</ins><a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping"><abbr title="Internationalized Resource Identifier"><ins class="diff-new">
+IRI
+</ins></abbr><ins class="diff-new">
+mapping
+</ins></a><ins class="diff-new">
+equals
+</ins><code><ins class="diff-new">
[email protected]
+</ins></code>,<ins class="diff-new">
+an
+</ins><code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-keyword-alias"><ins class="diff-new">
+invalid
+keyword
+alias
+</ins></a></code><ins class="diff-new">
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+</ins>
+</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 class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+with
+a
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+that
+is
+a
+key
+in
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+a
+dependency
+has
+been
+found.
+Use
+this
+algorithm
+recursively
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+the
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+</li>
+<li>
+If
+<i>
+term
+</i>
+'s
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+has
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+set
+the
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+the
+result
+of
+concatenating
+the
+value
+associated
+with
+the
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+'s
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+Set
+the
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<i>
+term
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Otherwise,
+if
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+has
+a
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>,
+the
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<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 class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>
+and
+<i>
+term
+</i>.
+If
+it
+does
+not
+have
+a
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+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>
+type
+</i>
+to
+the
+value
+associated
+with
+the
+<code>
[email protected]
+</code>
+key,
+which
+must
+be
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<i>
+type
+</i>
+for
+<i>
+value
+</i>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+<del class="diff-old">true
+</del>
+<a class="tref internalDFN" title="false" href="#dfn-false">
+<ins class="diff-chg">false
+</ins>
+</a>
+for
+<i>
+document
+relative
+</i>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+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 class="tref internalDFN" title="type-mapping" href="#dfn-type-mapping">
+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>
+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 class="tref internalDFN" title="container-mapping" href="#dfn-container-mapping">
+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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+or
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+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 class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>
+set
+it
+to
+lowercased
+<i>
+language
+</i>.
+Set
+the
+<a class="tref internalDFN" title="language-mapping" href="#dfn-language-mapping">
+language
+mapping
+</a>
+of
+<i>
+definition
+</i>
+to
+<i>
+language
+</i>.
+</li>
+</ol>
+</li>
+<li>
+Set
+the
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+of
+<i>
+term
+</i>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+to
+<i>
+definition
+</i>
+and
+set
+the
+value
+associated
+with
+<i>
+defined
+</i>
+'s
+key
+<i>
+term
+</i>
+to
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>.
+</li>
+</ol>
+</section>
+</section>
+<section id="iri-expansion">
+<h3>
+<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 class="tref internalDFN" title="iri" href="#dfn-iri">
+IRIs
+</a>.
+This
+section
+defines
+an
+algorithm
+for
+transforming
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>
+that
+represents
+an
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+into
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+blank
+node
+identifier
+</a>.
+It
+also
+covers
+transforming
+<a class="tref internalDFN" title="keyword-alias" href="#dfn-keyword-alias">
+keyword
+aliases
+</a>
+into
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keywords
+</a>.
+</p>
+<p>
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<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 class="tref internalDFN" title="local-context" href="#dfn-local-context">
+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 class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+dependencies
+to
+be
+processed
+via
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>.
+</p>
+<section class="informative">
+<h4 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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>,
+we
+must
+first
+determine
+if
+it
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>,
+a
+<a class="tref internalDFN" title="keyword-alias" href="#dfn-keyword-alias">
+keyword
+alias
+</a>,
+or
+some
+form
+of
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<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 class="tref internalDFN" title="keyword-alias" href="#dfn-keyword-alias">
+keyword
+alias
+</a>
+to
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>
+and
+a
+<a class="tref internalDFN" title="term" href="#dfn-term">
+term
+</a>
+to
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+according
+to
+its
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+in
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>.
+While
+inspecting
+<i>
+value
+</i>
+we
+may
+also
+find
+that
+we
+need
+to
+create
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+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 class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+against
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>.
+We
+know
+we
+need
+to
+create
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+in
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+when
+<i>
+value
+</i>
+is
+a
+key
+in
+the
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+and
+the
+<i>
+defined
+</i>
+map
+does
+not
+have
+a
+key
+for
+<i>
+value
+</i>
+with
+an
+associated
+value
+of
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>.
+The
+<i>
+defined
+</i>
+map
+is
+used
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>
+to
+keep
+track
+of
+which
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+have
+already
+been
+defined
+or
+are
+in
+the
+process
+of
+being
+defined.
+We
+create
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+by
+using
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>.
+</p>
+</section>
+<section>
+<h4 id="algorithm-2">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+takes
+two
+required
+and
+four
+optional
+input
+variables.
+The
+required
+inputs
+are
+an
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+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 class="tref internalDFN" title="relative-iri" href="#dfn-relative-iri">
+relative
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+against
+the
+document's
+base
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context's
+</a>
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>,
+respectively,
+and
+a
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+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 class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+and
+<i>
+defined
+</i>
+are
+initialized
+to
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>.
+</p>
+<ol class="algorithm">
+<li>
+If
+<i>
+value
+</i>
+is
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>
+or
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+return
+<i>
+value
+</i>
+as
+is.
+</li>
+<li>
+If
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+not
+<a class="tref internalDFN" title="null" href="#dfn-null">
+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 class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+invoke
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>,
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+<i>
+value
+</i>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+This
+will
+ensure
+that
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+is
+created
+for
+<i>
+value
+</i>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>.
+</li>
+<li>
+If
+<i>
+vocab
+</i>
+is
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+and
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+has
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+for
+<i>
+value
+</i>,
+return
+the
+associated
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+a
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>:
+<ol class="algorithm">
+<li>
+Split
+<i>
+value
+</i>
+into
+a
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+and
+<i>
+suffix
+</i>
+at
+the
+first
+occurrence
+of
+a
+colon
+(
+<code>:
+</code>
+).
+</li>
+<li>
+If
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+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 class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>
+or
+a
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+blank
+node
+identifier
+</a>.
+</li>
+<li>
+If
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+not
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+it
+contains
+a
+key
+that
+equals
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>,
+and
+the
+value
+associated
+with
+the
+key
+that
+equals
+<i>
+prefix
+</i>
+in
+<i>
+defined
+</i>
+is
+not
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+invoke
+the
+<a href="#create-term-definition">
+Create
+Term
+Definition
+algorithm
+</a>,
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>,
+<i>
+prefix
+</i>
+as
+<i>
+term
+</i>,
+and
+<i>
+defined
+</i>.
+This
+will
+ensure
+that
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+is
+created
+for
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+in
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+during
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>.
+</li>
+<li>
+If
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+contains
+a
+<a class="tref internalDFN" title="term-definition" href="#dfn-term-definition">
+term
+definition
+</a>
+for
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>,
+return
+the
+result
+of
+concatenating
+the
+<a class="tref internalDFN" title="iri-mapping" href="#dfn-iri-mapping">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+mapping
+</a>
+associated
+with
+<a class="tref internalDFN" title="prefix" href="#dfn-prefix">
+prefix
+</a>
+and
+<i>
+suffix
+</i>.
+</li>
+<li>
+Return
+<i>
+value
+</i>
+as
+it
+is
+already
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</a>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+vocab
+</i>
+is
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+and
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+has
+a
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>,
+return
+the
+result
+of
+concatenating
+the
+<a class="tref internalDFN" title="vocabulary-mapping" href="#dfn-vocabulary-mapping">
+vocabulary
+mapping
+</a>
+with
+<i>
+value
+</i>.
+</li>
+<li>
+Otherwise,
+if
+<i>
+document
+relative
+</i>
+is
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>,
+set
+<i>
+value
+</i>
+to
+the
+result
+of
+resolving
+<i>
+value
+</i>
+against
+the
+<a class="tref internalDFN" title="base-iri" href="#dfn-base-iri">
+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 class="bibref" href="#bib-RFC3986">
+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 class="bibref" href="#bib-RFC3987">
+RFC3987
+</a>
+</cite>
+].
+</li>
+<li>
+If
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>
+is
+not
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+and
+<i>
+value
+</i>
+is
+not
+an
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+</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,
+return
+<i>
+value
+</i>
+as
+is.
+</li>
+</ol>
+</section>
+</section>
+</section>
+<section id="expansion-algorithms">
+<h2>
+<span class="secno">
+7.
+</span>
+Expansion
+Algorithms
+</h2>
+<section id="expansion-algorithm">
+<h3>
+<span class="secno">
+7.1
+</span>
+Expansion
+Algorithm
+</h3>
+<p>
+This
+algorithm
+expands
+a
+JSON-LD
+document,
+such
+that
+all
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>
+definitions
+are
+removed,
+all
+<a class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+and
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+IRIs
+</a>
+are
+expanded
+to
+<a class="tref internalDFN" title="absolute-iri" href="#dfn-absolute-iri">
+absolute
+IRIs
+</a>,
+<a class="tref internalDFN" title="blank-node-identifier" href="#dfn-blank-node-identifier">
+blank
+node
+identifiers
+</a>,
+or
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keywords
+</a>
+and
+all
+<a class="tref internalDFN" title="json-ld-value" href="#dfn-json-ld-value">
+JSON-LD
+values
+</a>
+are
+expressed
+in
+<a class="tref internalDFN" title="array" href="#dfn-array">
+arrays
+</a>
+in
+<a class="tref internalDFN" title="expanded-form" href="#dfn-expanded-form">
+expanded
+form
+</a>.
+</p>
+<section class="informative">
+<h4 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 class="tref internalDFN" title="expansion" href="#dfn-expansion">
+expanded
+</a>
+<i>
+result
+</i>.
+When
+<a class="tref internalDFN" title="expansion" href="#dfn-expansion">
+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 class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+there
+is
+nothing
+to
+expand.
+</li>
+<li>
+Otherwise,
+if
+<i>
+element
+</i>
+is
+a
+<a class="tref internalDFN" title="scalar" href="#dfn-scalar">
+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 class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>,
+then
+we
+expand
+each
+of
+its
+items
+recursively
+and
+return
+them
+in
+a
+new
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>.
+</li>
+<li>
+Otherwise,
+<i>
+element
+</i>
+is
+a
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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 class="tref internalDFN" title="term" href="#dfn-term">
+terms
+</a>
+or
+<a class="tref internalDFN" title="compact-iri" href="#dfn-compact-iri">
+compact
+IRIs
+</a>
+and
+others
+will
+be
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keywords
+</a>
+or
+simply
+ignored
+because
+they
+do
+not
+have
+definitions
+in
+the
+<a class="tref internalDFN" title="context" href="#dfn-context">
+context
+</a>.
+Any
+<a class="tref internalDFN" title="iri" href="#dfn-iri">
+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 class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>,
+we
+return
+<i>
+result
+</i>.
+</p>
+</section>
+<section>
+<h4 id="algorithm-3">
+Algorithm
+</h4>
+<p>
+The
+algorithm
+takes
+three
+input
+variables:
+an
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+an
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>,
+and
+an
+<i>
+element
+</i>
+to
+be
+expanded.
+To
+begin,
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+is
+set
+to
+the
+result
+of
+performing,
+<a href="#context-processing-algorithm">
+Context
+Processing
+</a>
+on
+the
+passed
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-expandContext">
+expandContext
+</a>
+</code>,
+or
+empty
+if
+<code class="idlMemberName">
+<a href="#widl-JsonLdOptions-expandContext">
+expandContext
+</a>
+</code>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>
+is
+set
+to
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+and
+<i>
+element
+</i>
+is
+set
+to
+the
+<a class="tref internalDFN" title="json-ld-input" href="#dfn-json-ld-input">
+JSON-LD
+input
+</a>.
+</p>
+<ol class="algorithm">
+<li>
+If
+<i>
+element
+</i>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+return
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>.
+</li>
+<li>
+If
+<i>
+element
+</i>
+is
+a
+<a class="tref internalDFN" title="scalar" href="#dfn-scalar">
+scalar
+</a>,
+<ol class="algorithm">
+<li>
+If
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+or
+<code>
[email protected]
+</code>,
+drop
+the
+free-floating
+<a class="tref internalDFN" title="scalar" href="#dfn-scalar">
+scalar
+</a>
+by
+returning
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>.
+</li>
+<li>
+Return
+the
+result
+of
+the
+<a href="#value-expansion">
+Value
+Expansion
+algorithm
+</a>,
+passing
+the
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>,
+and
+<i>
+element
+</i>
+as
+<i>
+value
+</i>.
+</li>
+</ol>
+</li>
+<li>
+If
+<i>
+element
+</i>
+is
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>,
+and
+<i>
+item
+</i>
+as
+<i>
+element
+</i>.
+</li>
+<li>
+If
+the
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>
+is
+<code>
[email protected]
+</code>
+or
+its
+<a class="tref internalDFN" title="container-mapping" href="#dfn-container-mapping">
+container
+mapping
+</a>
+is
+set
+to
+<code>
[email protected]
+</code>,
+the
+<i>
+expanded
+item
+</i>
+must
+not
+be
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+or
+a
+<a class="tref internalDFN" title="list-object" href="#dfn-list-object">
+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 class="tref internalDFN" title="array" href="#dfn-array">
+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 class="tref internalDFN" title="json-object" href="#dfn-json-object">
+JSON
+object
+</a>.
+</li>
+<li>
+If
+<i>
+element
+</i>
+contains
+the
+key
+<code>
[email protected]
+</code>,
+set
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+to
+the
+result
+of
+the
+<a href="#context-processing-algorithm">
+Context
+Processing
+algorithm
+</a>,
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>
+and
+the
+value
+of
+the
+<code>
[email protected]
+</code>
+key
+as
+<a class="tref internalDFN" title="local-context" href="#dfn-local-context">
+local
+context
+</a>.
+</li>
+<li>
+Initialize
+an
+empty
+<a class="tref internalDFN" title="json-object" href="#dfn-json-object">
+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 class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<i>
+key
+</i>
+for
+<i>
+value
+</i>,
+and
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+vocab
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+or
+it
+neither
+contains
+a
+colon
+(
+<code>:
+</code>
+)
+nor
+it
+is
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>,
+drop
+<i>
+key
+</i>
+by
+continuing
+to
+the
+next
+<i>
+key
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+a
+<a class="tref internalDFN" title="keyword" href="#dfn-keyword">
+keyword
+</a>:
+<ol class="algorithm">
+<li>
+If
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+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 class="tref internalDFN" title="string" href="#dfn-string">
+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">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<i>
+value
+</i>,
+and
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+document
+relative
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<code>
[email protected]
+</code>
+and
+<i>
+value
+</i>
+is
+neither
+a
+<a class="tref internalDFN" title="string" href="#dfn-string">
+string
+</a>
+nor
+an
+<a class="tref internalDFN" title="array" href="#dfn-array">
+array
+</a>
+of
+<a class="tref internalDFN" title="string" href="#dfn-string">
+strings
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-type-value">
+invalid
+type
+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">
+<abbr title="Internationalized Resource Identifier">
+IRI
+</abbr>
+Expansion
+algorithm
+</a>,
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+vocab
+</i>,
+and
+<a class="tref internalDFN" title="true" href="#dfn-true">
+true
+</a>
+for
+<i>
+document
+relative
+</i>
+to
+expand
+the
+<i>
+value
+</i>
+or
+each
+of
+its
+items.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<code>
[email protected]
+</code>,
+set
+<i>
+expanded
+value
+</i>
+to
+the
+result
+of
+using
+this
+algorithm
+recursively
+passing
+<a class="tref internalDFN" title="active-context" href="#dfn-active-context">
+active
+context
+</a>,
+<code>
[email protected]
+</code>
+for
+<a class="tref internalDFN" title="active-property" href="#dfn-active-property">
+active
+property
+</a>,
+and
+<i>
+value
+</i>
+for
+<i>
+element
+</i>.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<code>
[email protected]
+</code>
+and
+<i>
+value
+</i>
+is
+not
+a
+<a class="tref internalDFN" title="scalar" href="#dfn-scalar">
+scalar
+</a>
+or
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+an
+<code class="error">
+<a href="#idl-def-JsonLdErrorCode.invalid-value-object-value">
+invalid
+value
+object
+value
+</a>
+</code>
+error
+has
+been
+detected
+and
+processing
+is
+aborted.
+Otherwise,
+set
+<i>
+expanded
+value
+</i>
+to
+<i>
+value
+</i>.
+If
+<i>
+expanded
+value
+</i>
+is
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>,
+set
+the
+<code>
[email protected]
+</code>
+member
+of
+<i>
+result
+</i>
+to
+<a class="tref internalDFN" title="null" href="#dfn-null">
+null
+</a>
+and
+continue
+with
+the
+next
+<i>
+key
+</i>
+from
+<i>
+element
+</i>.
+Null
+values
+need
+to
+be
+preserved
+in
+this
+case
+as
+the
+meaning
+of
+an
+<code>
[email protected]
+</code>
+member
+depends
+on
+the
+existence
+of
+an
+<code>
[email protected]
+</code>
+member.
+</li>
+<li>
+If
+<i>
+expanded
+property
+</i>
+is
+<code>
[email protected]
+</code>