Skip to content

Lazy-Eval processingMode. #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions common/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,16 @@
when prepended to the suffix of the <a>compact IRI</a>,
results in an <a>absolute IRI</a>.</dd>
<dt><dfn data-cite="JSON-LD11#dfn-processing-mode">processing mode</dfn></dt><dd>
The processing mode defines how a <a>JSON-LD document</a> is processed.
By default, all documents are assumed to be conformant with <a data-cite="JSON-LD10" data-no-xref="">JSON-LD 1.0</a> [[JSON-LD10]].
The <a>processing mode</a> defines how a <a>JSON-LD document</a> is processed.
By default, all documents are assumed to be conformant with this specification.
By defining a different version using the <code>@version</code> <a>entry</a> in a <a>context</a>,
or via explicit API option,
other processing modes can be accessed.
publishers can ensure that processors conformant with <a data-cite="JSON-LD10" data-no-xref="">JSON-LD 1.0</a> [[JSON-LD10]]
will not accidently process JSON-LD 1.1 documents, possibly creating a different output.
The API provides an option for setting the <a>processing mode</a> to `json-ld-1.0`,
which will prevent JSON-LD 1.1 features from being activated,
or error if <code>@version</code> <a>entry</a> in a <a>context</a> is explicitly set to `1.1`.
This specification extends <a data-cite="JSON-LD10" data-no-xref="">JSON-LD 1.0</a>
via the <code>json-ld-1.1</code> <a>processing mode</a>.</dd>
via the `json-ld-1.1` <a>processing mode</a>.</dd>
<dt><dfn data-cite="JSON-LD11#dfn-set-object">set object</dfn></dt><dd>
A <a>set object</a> is a <a>map</a> that has an <code>@set</code> <a>entry</a>.
It may also have an <code>@index</code> key, but no other <a>entries</a>.</dd>
Expand Down
44 changes: 36 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,16 @@
],

formerEditors: [
{ name: "Manu Sporny", url: "http://manu.sporny.org/",
company: "Digital Bazaar", companyURL: "https://digitalbazaar.com/" },
{ name: "Markus Lanthaler", url: "http://www.markus-lanthaler.com/",
company: "Graz University of Technology", companyURL: "http://www.tugraz.at/" }
{ name: "Manu Sporny",
url: "http://manu.sporny.org/",
company: "Digital Bazaar",
companyURL: "https://digitalbazaar.com/",
note: "v1.0" },
{ name: "Markus Lanthaler",
url: "http://www.markus-lanthaler.com/",
company: "Graz University of Technology",
companyURL: "http://www.tugraz.at/",
note: "v1.0" }
],

// authors, add as many as you like.
Expand Down Expand Up @@ -408,6 +414,16 @@ <h4>Algorithm Terms</h4>

<section class="informative">
<h2>Features</h2>

<p class="changed">JSON-LD 1.1 introduces new features that are
compatible with [[[JSON-LD10]]] [[JSON-LD10]],
but if processed by a JSON-LD 1.0 processor may produce different results.
Processors default to `json-ld-1.1`, unless the
<a data-cite="JSON-LD11-API#dom-jsonldoptions-processingMode">processingMode</a> API option
is explicitly set to `json-ld-1.0`.
Publishers are encouraged to use the <code>@version</code> <a>map entry</a> within a <a>context</a>
set to `1.1` to ensure that JSON-LD 1.0 processors will not misinterpret JSON-LD 1.1 features.</p>

<section class="informative">
<h3>Framing</h3>
<p><dfn>Framing</dfn> is used to shape the data in a <a>JSON-LD document</a>,
Expand Down Expand Up @@ -518,7 +534,7 @@ <h3>Framing</h3>
</pre>
</aside>

<p>If <a>processing mode</a> is <code>json-ld-1.1</code>, or the <a>omit graph flag</a> is <code>true</code>,
<p>If <a>processing mode</a> is not <code>json-ld-1.0</code>, or the <a>omit graph flag</a> is <code>true</code>,
the top-level <code>@graph</code> <a>entry</a> may be omitted.</p>

<pre class="example result" data-transform="updateExample"
Expand Down Expand Up @@ -1363,6 +1379,16 @@ <h3>Framing Named Graphs</h3>
than conversion between <a data-lt="relative IRI">relative</a> and
<a>absolute IRIs</a>.</p>

<p class="changed">Unless specified using
<a data-cite="JSON-LD11-API#dom-jsonldoptions-processingMode">processingMode</a> API option,
the <a>processing mode</a> is set using the <code>@version</code> <a>entry</a>
in a local <a>context</a> and
affects the behavior of algorithms including <a data-cite="JSON-LD11-API#dfn-expanded">expansion</a> and <a data-cite="JSON-LD11-API#dfn-compacted">compaction</a>.
Once set, it is an error to attempt to change to a different processing mode,
and processors MUST generate,
a <a data-cite="JSON-LD11-API#dom-jsonlderrorcode-processing-mode-conflict">processing mode conflict</a>
error and abort further processing.</p>

<p>The algorithms in this specification are generally written with more concern for clarity
than efficiency. Thus, <a>JSON-LD Processors</a> MAY
implement the algorithms given in this specification in any way desired,
Expand Down Expand Up @@ -1694,7 +1720,7 @@ <h3>Framing Algorithm</h3>
</li>
</ol>

<p class="changed">If the <a>processing mode</a> is <code>json-ld-1.1</code>,
<p class="changed">If the <a>processing mode</a> is not <code>json-ld-1.0</code>,
remove the <code>@id</code> <a>entry</a> of each <a>node object</a> where the
<a>entry</a> value is a <a>blank node identifier</a> which appears only once
in any property value within <var>result</var>.</p>
Expand Down Expand Up @@ -2040,7 +2066,7 @@ <h3>JsonLdOptions</h3>
<dt class="changed"><dfn data-dfn-for="JsonLdOptions">omitGraph</dfn></dt>
<dd class="changed">Sets the value <a>omit graph flag</a> used in the
<a href="#framing-algorithm">Framing Algorithm</a>. If not set explicitly,
it is set to <code>false</code> if <a>processing mode</a> if <code>json-ld-1.0</code>, <code>true</code> otherwise.</dd>
it is set to <code>false</code> if <a>processing mode</a> is <code>json-ld-1.0</code>, <code>true</code> otherwise.</dd>
<dt><dfn data-dfn-for="JsonLdOptions">requireAll</dfn></dt>
<dd>Sets the value <a>require all flag</a> used in the
<a href="#framing-algorithm">Framing Algorithm</a>.</dd>
Expand Down Expand Up @@ -2231,7 +2257,7 @@ <h2>Changes since 1.0 Draft of 30 August 2012</h2>
object.</li>
<li>Frames can use one or more values for <code>@id</code> to allow for matching
specific objects in a frame.</li>
<li>If <a>processing mode</a> is <code>json-ld-1.1</code>,
<li>If <a>processing mode</a> is not <code>json-ld-1.0</code>,
<code>@id</code> <a>entries</a> with <a>blank node identifiers</a>
used only for that <code>@id</code> are removed.</li>
<li>The JSON syntax has been abstracted into an <a>internal representation</a>
Expand Down Expand Up @@ -2267,6 +2293,8 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
<code>@id</code> and <code>@type</code>.</li>
<li>Removed <code>@first</code> and <code>@last</code> values for the
<a>object embed flag</a> in favor of <code>@once</code>.</li>
<li>The <a>processing mode</a> is now implicitly `json-ld-1.1`, unless set
explicitly to `json-ld-1.0`.</li>
</ul>
</section>

Expand Down
Loading