Skip to content

Commit

Permalink
Remove initial context
Browse files Browse the repository at this point in the history
This closes #80.
  • Loading branch information
lanthaler committed Aug 14, 2012
1 parent 18f1f52 commit e300ee6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 55 deletions.
33 changes: 9 additions & 24 deletions spec/latest/json-ld-api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,6 @@ <h1>Algorithms</h1>
<section>
<h2>Algorithm Terms</h2>
<dl>
<dt><tdef>initial context</tdef></dt>
<dd>
a context that is specified to the algorithm before processing begins. The contents of the
initial context is defined in <a href="#appendix-a">Appendix A</a>.
</dd>
<dt><tdef>active subject</tdef></dt>
<dd>
the currently active subject that the processor should use when
Expand Down Expand Up @@ -1173,10 +1168,9 @@ <h2>Algorithm Terms</h2>
<h2 id="context">Context Processing</h2>
<p>Processing of JSON-LD data structure is managed recursively.
During processing, each rule is applied using information provided by the <tref>active context</tref>.
Processing begins by pushing a new <tref>processor state</tref> onto the <tref>processor state</tref> stack and
initializing the <tref>active context</tref> with the <tref>initial context</tref>.
If a <tref>local context</tref> is encountered,
information from the <tref>local context</tref> is merged into the <tref>active context</tref>.</p>
Processing begins by pushing a new <tref>processor state</tref> onto the <tref>processor state</tref> stack.
If a <tref>local context</tref> is encountered, information from the <tref>local context</tref> is merged
into the <tref>active context</tref>.</p>
<p>The <tref>active context</tref> is used for expanding properties and values of a <tref>JSON object</tref> (or elements
of an array) using a <tdef>term mapping</tdef>. It is also used to maintain
<tdef>coercion mapping</tdef>s from terms to datatypes, <tdef>language mapping</tdef>s from terms to language codes,
Expand All @@ -1190,8 +1184,7 @@ <h2 id="context">Context Processing</h2>
<li>Create a new, empty <tref>local context</tref>.</li>
<li>Let <em>context</em> be the value of <code>@context</code>
<ol class="algorithm">
<li id="process-context">If <em>context</em> equals <tref>null</tref>, reset the <tref>active context</tref>
to the <tref>initial context</tref>.</li>
<li id="process-context">If <em>context</em> equals <tref>null</tref>, clear the <tref>active context</tref>.</li>
<li>If <em>context</em> is an <tref>array</tref>, process each element as <em>context</em> in order
by starting at <a href="#process-context">Step 2.1</a>.</li>
<li>If <em>context</em> is a <tref>string</tref>, it MUST have a lexical form of <tref>absolute IRI</tref>.
Expand Down Expand Up @@ -1550,13 +1543,13 @@ <h2>Expansion</h2>
<section>
<h3>Expansion Algorithm</h3>

<p>The algorithm takes three input variables: an <tref>active context</tref>, an <tref>active property</tref>, and an <em>element</em> to be expanded. To
<p>The algorithm takes three input variables: an <tref>active context</tref>,
an <tref>active property</tref>, and an <em>element</em> to be expanded. To
begin, the <tref>active context</tref> is set to the result of performing, <a
href="#context-processing">Context Processing</a> on the passed
<em>context</em>, or to the <tref>initial context</tref> if <em>context</em>
is <tref>null</tref>, <tref>active property</tref> is set to
<tref>null</tref>, and <em>element</em> is set to the <tref>JSON-LD
input</tref>.</p>
<em>context</em>, or empty if <em>context</em> is <tref>null</tref>,
<tref>active property</tref> is set to <tref>null</tref>, and
<em>element</em> is set to the <tref>JSON-LD input</tref>.</p>
<ol class="algorithm">
<li>If <em>element</em> is an <tref>array</tref>, process each entry in <em>element</em> recursively
using this algorithm, passing copies of the <tref>active context</tref> and <tref>active property</tref>.
Expand Down Expand Up @@ -2271,14 +2264,6 @@ <h3>Data Round Tripping</h3>

</section>

<section class="appendix" id="appendix-a">
<h1>Initial Context</h1>
<p class="issue" data-number="80">It is <a href="https://github.com/json-ld/json-ld.org/issues/80">still being
discussed</a> whether JSON-LD has the notion of an initial context or not. If JSON-LD has an
initial context, it MUST be specified external to the JSON-LD Syntax specification at a
well-known location.</p>
</section>

<section class="appendix">
<h1>Acknowledgements</h1>

Expand Down
22 changes: 0 additions & 22 deletions spec/latest/json-ld-framing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,6 @@ <h2>Syntax Tokens and Keywords</h2>
<section>
<h2>Algorithm Terms</h2>
<dl>
<dt><tdef>initial context</tdef></dt>
<dd>
a context that is specified to the algorithm before processing begins. The contents of the
initial context is defined in <a href="#appendix-b">Appendix B</a>.
</dd>
<dt><tdef>active subject</tdef></dt>
<dd>
the currently active subject that the processor should use when
Expand Down Expand Up @@ -1149,23 +1144,6 @@ <h3>application/ld-frame+json</h3>

</section>

<section class="appendix" id="appendix-b">
<h1>Initial Context</h1>
<p>The <tref>initial context</tref> is defined with the following default entries:</p>
<pre class="example" data-transform="updateExample">
<!--
{
"@context": {
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": { "@type": "@id"}
}
}
-->
</pre>
<p>Processors MUST act as if the initial context is defined in the outer-most level when processing
JSON-LD documents.</p>
<p class="issue">Should we define other default prefixes?</p>
</section>

<section class="appendix">
<h1>Acknowledgements</h1>

Expand Down
15 changes: 6 additions & 9 deletions spec/latest/json-ld-syntax/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -728,16 +728,13 @@ <h3>The Context</h3>
rules associated with the previous definition are removed. A <tref>term</tref> defined
in a previous context MUST be removed, if it is re-defined to <code>null</code>.</p>

<p>
The set of contexts defined within a specific <tref>subject definition</tref> are
<p>The set of contexts defined within a specific <tref>subject definition</tref> are
referred to as <tdef>local context</tdef>s. Setting the context to <code>null</code>
effectively sets the <tref>local context</tref> to the initial context
(further explained in the JSON-LD API, Appendix A, Initial Context
[[JSON-LD-API]] ). The
<tdef>active context</tdef> refers to the accumulation of
<tref>local context</tref>s that are in scope at a specific point within
the document. The following example specifies an external context and then
layers a local context on top of the external context:</p>
effectively resets the <tref>local context</tref> to an empty context. The
<tdef>active context</tdef> refers to the accumulation of <tref>local context</tref>s
that are in scope at a specific point within the document. The following example
specifies an external context and then layers a local context on top of the external
context:</p>

<pre class="example" data-transform="updateExample"
title="External and local contexts">
Expand Down

0 comments on commit e300ee6

Please sign in to comment.