Skip to content

Commit 710f936

Browse files
committed
Define processor levels, with only a _full Processor_ capable of using JSON-LD embedded in HTML.
1 parent a3bd0f1 commit 710f936

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

index.html

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ <h1>Introduction</h1>
301301
network, in a single document.</li>
302302
</ul>
303303

304-
<p>
305-
JSON-LD is designed to be usable directly as JSON, with no knowledge of RDF
304+
<p>JSON-LD is designed to be usable directly as JSON, with no knowledge of RDF
306305
[[RDF11-CONCEPTS]]. It is also designed to be usable as RDF, if desired, for
307306
use with other Linked Data technologies like SPARQL [[SPARQL11-OVERVIEW]]. Developers who
308307
require any of the facilities listed above or need to serialize an RDF <a>Graph</a>
@@ -312,8 +311,7 @@ <h1>Introduction</h1>
312311
to RDF are in section <a href="#relationship-to-rdf"></a>.
313312
</p>
314313

315-
<p>
316-
The syntax is designed to not disturb already
314+
<p>The syntax is designed to not disturb already
317315
deployed systems running on JSON, but provide a smooth upgrade path from
318316
JSON to JSON-LD. Since the shape of such data varies wildly, JSON-LD
319317
features mechanisms to reshape documents into a deterministic structure
@@ -436,7 +434,31 @@ <h2>Design Goals and Rationale</h2>
436434
Complete details of how JSON-LD relates to RDF are in section
437435
<a href="#relationship-to-rdf"></a>.</dd>
438436
</dl>
439-
</section>
437+
</section>
438+
439+
<section class="informative">
440+
<h2>Processor Levels</h2>
441+
<p>JSON-LD mostly uses the JSON syntax [[RFC8259]] along with
442+
various micro-syntaxes based on XML Schema datatypes [[XMLSCHEMA11-2]].
443+
However, it has become increasingly common to include JSON within
444+
a <a data-cite="HTML/semantics-scripting.html#the-script-element">script element</a>
445+
within an HTML document [[HTML]],
446+
as described in <a href="#embedding-json-ld-in-html-documents" class="sectionRef"></a>.
447+
As not all processors operate in an environment which can include HTML,
448+
this specification describes various categories of JSON-LD processors.</p>
449+
450+
<p>A <dfn>pure JSON Processor</dfn> only requires the use of a
451+
JSON processor and is restricted to processing documents retrieved
452+
with a JSON content type (e.g., <code>application/ld+json</code> or other JSON type).</p>
453+
454+
<p>A <dfn>event-based JSON Processor</dfn> processes a stream of characters
455+
expecting an event after each syntactic element is encountered.
456+
Such processors are sensitive to the order of the members of <a>JSON objects</a>,
457+
which can have a performance impact if the members of <a>JSON objects</a> are encountered in an unexpected order.</p>
458+
459+
<p>A <dfn>full Processor</dfn> is capable of JSON-LD embedded in HTML,
460+
in addition to the capabilities of a <a>pure JSON Processor</a>.</p>
461+
</section>
440462

441463
<section class="informative">
442464
<h2>Data Model Overview</h2>
@@ -10080,6 +10102,8 @@ <h3>Graph Containers</h3>
1008010102

1008110103
<section class="changed"><h2>Embedding JSON-LD in HTML Documents</h2>
1008210104

10105+
<p class="note">This section describes features available to a <a>full Processor</a>.</p>
10106+
1008310107
<p>
1008410108
JSON-LD content can be easily embedded in HTML [[HTML]] by placing
1008510109
it in a <a data-cite="HTML/semantics-scripting.html#the-script-element">script element</a> with the <code>type</code> attribute set to
@@ -12533,7 +12557,8 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
1253312557
Define the <code>rdf:JSON</code> datatype.</li>
1253412558
<li><a>Term definitions</a> with keys which are of the form of a <a>compact IRI</a> or <a>absolute IRI</a> MUST NOT
1253512559
expand to an <a>IRI</a> other than the expansion of the key itself.</li>
12536-
<li>If a retrieved context URL returns an HTML document, the first script element
12560+
<li>Define different processor modes: <a>pure JSON Processor</a>, <a>event-based JSON processor</a>, and <a>full Processor</a>.</li>
12561+
<li>For a <a>full Processor</a>, if a retrieved context URL returns an HTML document, the first script element
1253712562
of type <code>application/ld+json;profile=http://www.w3.org/ns/json-ld#context</code>,
1253812563
or <code>application/ld+json</code> is used as the context for further processing.
1253912564
This allows a mechanism for documenting the content of a context using HTML.</li>

0 commit comments

Comments
 (0)