Skip to content

Commit 1de971e

Browse files
committed
1 parent ea38afd commit 1de971e

13 files changed

+1217
-623
lines changed

draft-3/CommandLineTool.html

+83-41
Large diffs are not rendered by default.

draft-3/SchemaSalad.html

+54-31
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ <h1 id="toc">Table of contents</h1>
196196
</ol></li></ol><li><a href="#SaladEnumSchema">5. SaladEnumSchema</a><ol>
197197
</ol><li><a href="#Documentation">6. Documentation</a><ol>
198198
</ol></li></ol></nav>
199+
199200
<h1 id="Introduction" class="section">1. Introduction <a href="#Introduction">&sect;</a></h1><p>The JSON data model is an extremely popular way to represent structured
200201
data. It is attractive because of it's relative simplicity and is a
201202
natural fit with the standard types of many programming languages.
@@ -284,12 +285,15 @@ <h2 id="Document_context" class="section">2.3 Document context <a href="#Documen
284285
<h3 id="Explicit_context" class="section">2.3.2 Explicit context <a href="#Explicit_context">&sect;</a></h3><p>If a document consists of a root object, this object may contain the
285286
fields <code>$base</code>, <code>$namespaces</code>, <code>$schemas</code>, and <code>$graph</code>:</p>
286287
<ul>
287-
<li><p><code>$base</code>: Must be a string. Set the base URI for the document used to resolve relative references.</p>
288+
<li><p><code>$base</code>: Must be a string. Set the base URI for the document used to
289+
resolve relative references.</p>
288290
</li>
289-
<li><p><code>$namespaces</code>: Must be an object with strings as values. The keys of the object are namespace prefixes used in the document; the values of
291+
<li><p><code>$namespaces</code>: Must be an object with strings as values. The keys of
292+
the object are namespace prefixes used in the document; the values of
290293
the object are the prefix expansions.</p>
291294
</li>
292-
<li><p><code>$schemas</code>: Must be an array of strings. This field may list URI references to documents in RDF-XML format which will be queried for RDF
295+
<li><p><code>$schemas</code>: Must be an array of strings. This field may list URI
296+
references to documents in RDF-XML format which will be queried for RDF
293297
schema data. The subjects and predicates described by the RDF schema
294298
may provide additional semantic context for the document, and may be
295299
used for validation of prefixed extension fields found in the document.</p>
@@ -305,12 +309,14 @@ <h2 id="Document_metadata" class="section">2.5 Document metadata <a href="#Docum
305309
<h2 id="Document_schema" class="section">2.6 Document schema <a href="#Document_schema">&sect;</a></h2><p>Document preprocessing, link validation and schema validation require a
306310
document schema. A schema may consist of:</p>
307311
<ul>
308-
<li><p>At least one record definition object which defines valid fields that make up a record type. Record field definitions include the valid types
312+
<li><p>At least one record definition object which defines valid fields that
313+
make up a record type. Record field definitions include the valid types
309314
that may be assigned to each field and annotations to indicate fields
310315
that represent identifiers and links, described below in "Semantic
311316
Annotations".</p>
312317
</li>
313-
<li><p>Any number of enumerated type objects which define a set of finite set of symbols that are valid value of the type.</p>
318+
<li><p>Any number of enumerated type objects which define a set of finite set of symbols that are
319+
valid value of the type.</p>
314320
</li>
315321
<li><p>Any number of documentation objects which allow in-line documentation of the schema.</p>
316322
</li>
@@ -322,12 +328,15 @@ <h3 id="Record_field_annotations" class="section">2.6.1 Record field annotations
322328
must use the following document preprocessing of fields by the following
323329
rules:</p>
324330
<ul>
325-
<li><p>If the value of <code>jsonldPredicate</code> is <code>@id</code>, the field is an identifier field.</p>
331+
<li><p>If the value of <code>jsonldPredicate</code> is <code>@id</code>, the field is an identifier
332+
field.</p>
326333
</li>
327-
<li><p>If the value of <code>jsonldPredicate</code> is an object, and contains that object contains the field <code>_type</code> with the value <code>@id</code>, the field is a
334+
<li><p>If the value of <code>jsonldPredicate</code> is an object, and contains that
335+
object contains the field <code>_type</code> with the value <code>@id</code>, the field is a
328336
link field.</p>
329337
</li>
330-
<li><p>If the value of <code>jsonldPredicate</code> is an object, and contains that object contains the field <code>_type</code> with the value <code>@vocab</code>, the field is a
338+
<li><p>If the value of <code>jsonldPredicate</code> is an object, and contains that
339+
object contains the field <code>_type</code> with the value <code>@vocab</code>, the field is a
331340
vocabulary field, which is a subtype of link field.</p>
332341
</li>
333342
</ul>
@@ -350,12 +359,17 @@ <h2 id="Field_name_resolution" class="section">3.1 Field name resolution <a href
350359
which are not part of the vocabulary are resolved using the following
351360
rules:</p>
352361
<ul>
353-
<li><p>If an field name URI begins with a namespace prefix declared in the document context (<code>@context</code>) followed by a colon <code>:</code>, the prefix and
354-
colon must be replaced by the namespace declared in <code>@context</code>.</p>
355-
</li>
356-
<li><p>If there is a vocabulary term which maps to the URI of a resolved field, the field name must be replace with the vocabulary term.</p>
362+
<li>If an field name URI begins with a namespace prefix declared in the
363+
document context (<code>@context</code>) followed by a colon <code>:</code>, the prefix and</li>
364+
</ul>
365+
colon must be replaced by the namespace declared in `@context`.
366+
367+
<ul>
368+
<li><p>If there is a vocabulary term which maps to the URI of a resolved
369+
field, the field name must be replace with the vocabulary term.</p>
357370
</li>
358-
<li><p>If a field name URI is an absolute URI consisting of a scheme and path and is not part of the vocabulary, no processing occurs.</p>
371+
<li><p>If a field name URI is an absolute URI consisting of a scheme and path
372+
and is not part of the vocabulary, no processing occurs.</p>
359373
</li>
360374
</ul>
361375
<p>Field name resolution is not relative. It must not be affected by the
@@ -400,19 +414,23 @@ <h2 id="Identifier_resolution" class="section">3.2 Identifier resolution <a href
400414
specific objects. Processing must resolve relative identifiers to absolute
401415
identifiers using the following rules:</p>
402416
<ul>
403-
<li><p>If an identifier URI is prefixed with <code>#</code> it is a URI relative fragment identifier. It is resolved relative to the base URI by setting
417+
<li><p>If an identifier URI is prefixed with <code>#</code> it is a URI relative
418+
fragment identifier. It is resolved relative to the base URI by setting
404419
or replacing the fragment portion of the base URI.</p>
405420
</li>
406-
<li><p>If an identifier URI does not contain a scheme and is not prefixed <code>#</code> it is a parent relative fragment identifier. It is resolved relative to the
421+
<li><p>If an identifier URI does not contain a scheme and is not prefixed <code>#</code> it
422+
is a parent relative fragment identifier. It is resolved relative to the
407423
base URI by the following rule: if the base URI does not contain a
408424
document fragment, set the fragment portion of the base URI. If the base
409425
URI does contain a document fragment, append a slash <code>/</code> followed by the
410426
identifier field to the fragment portion of the base URI.</p>
411427
</li>
412-
<li><p>If an identifier URI begins with a namespace prefix declared in <code>$namespaces</code> followed by a colon <code>:</code>, the prefix and colon must be
428+
<li><p>If an identifier URI begins with a namespace prefix declared in
429+
<code>$namespaces</code> followed by a colon <code>:</code>, the prefix and colon must be
413430
replaced by the namespace declared in <code>$namespaces</code>.</p>
414431
</li>
415-
<li><p>If an identifier URI is an absolute URI consisting of a scheme and path, no processing occurs.</p>
432+
<li><p>If an identifier URI is an absolute URI consisting of a scheme and path,
433+
no processing occurs.</p>
416434
</li>
417435
</ul>
418436
<p>When preprocessing visits a node containing an identifier, that identifier
@@ -483,10 +501,12 @@ <h2 id="Link_resolution" class="section">3.3 Link resolution <a href="#Link_reso
483501
objects. Processing must resolve links to either absolute URIs using the
484502
following rules:</p>
485503
<ul>
486-
<li><p>If a reference URI is prefixed with <code>#</code> it is a relative fragment identifier. It is resolved relative to the base URI by setting
504+
<li><p>If a reference URI is prefixed with <code>#</code> it is a relative
505+
fragment identifier. It is resolved relative to the base URI by setting
487506
or replacing the fragment portion of the base URI.</p>
488507
</li>
489-
<li><p>If a reference URI does not contain a scheme and is not prefixed with <code>#</code> it is a path relative reference. If the reference URI contains <code>#</code> in any
508+
<li><p>If a reference URI does not contain a scheme and is not prefixed with <code>#</code>
509+
it is a path relative reference. If the reference URI contains <code>#</code> in any
490510
position other than the first character, the reference URI must be divided
491511
into a path portion and a fragment portion split on the first instance of
492512
<code>#</code>. The path portion is resolved relative to the base URI by the following
@@ -497,10 +517,12 @@ <h2 id="Link_resolution" class="section">3.3 Link resolution <a href="#Link_reso
497517
fragment portion of the base URI with the fragment portion of the reference
498518
URI.</p>
499519
</li>
500-
<li><p>If a reference URI begins with a namespace prefix declared in <code>$namespaces</code> followed by a colon <code>:</code>, the prefix and colon must be replaced by the
520+
<li><p>If a reference URI begins with a namespace prefix declared in <code>$namespaces</code>
521+
followed by a colon <code>:</code>, the prefix and colon must be replaced by the
501522
namespace declared in <code>$namespaces</code>.</p>
502523
</li>
503-
<li><p>If a reference URI is an absolute URI consisting of a scheme and path, no processing occurs.</p>
524+
<li><p>If a reference URI is an absolute URI consisting of a scheme and path,
525+
no processing occurs.</p>
504526
</li>
505527
</ul>
506528
<p>Link resolution must not affect the base URI used to resolve identifiers
@@ -570,14 +592,13 @@ <h3 id="Link_resolution_example" class="section">3.3.1 Link resolution example <
570592
}
571593
</code></pre>
572594
<h2 id="Vocabulary_resolution" class="section">3.4 Vocabulary resolution <a href="#Vocabulary_resolution">&sect;</a></h2><p>The schema may designate one or more vocabulary fields which use terms
573-
defined in the vocabulary. Processing must resolve vocabulary fields to
574-
either vocabulary terms or absolute URIs by first applying the link
575-
resolution rules defined above, then applying the following additional
576-
rule:</p>
577-
<pre><code>* If a reference URI is a vocabulary field, and there is a vocabulary term which maps to the resolved URI, the reference must be replace with
578-
the vocabulary term.
579-
580-
</code></pre>
595+
defined in the vocabulary. Processing must resolve vocabulary fields to
596+
either vocabulary terms or absolute URIs by first applying the link
597+
resolution rules defined above, then applying the following additional
598+
rule:</p>
599+
<pre><code>* If a reference URI is a vocabulary field, and there is a vocabulary
600+
term which maps to the resolved URI, the reference must be replace with
601+
the vocabulary term.</code></pre>
581602
<h3 id="Vocabulary_resolution_example" class="section">3.4.1 Vocabulary resolution example <a href="#Vocabulary_resolution_example">&sect;</a></h3><p>Given the following schema:</p>
582603
<pre><code>{
583604
"$namespaces": {
@@ -973,11 +994,13 @@ <h3>Fields</h3>
973994
<div class="col-xs-7 col-lg-3"><a href="#PrimitiveType">string</a></div>
974995
<div class="col-xs-12 col-lg-6 description-col"><p>The context type hint, corresponds to JSON-LD <code>@type</code> directive.</p>
975996
<ul>
976-
<li><p>If the value of this field is <code>@id</code> and <code>identity</code> is false or unspecified, the parent field must be resolved using the link
997+
<li><p>If the value of this field is <code>@id</code> and <code>identity</code> is false or
998+
unspecified, the parent field must be resolved using the link
977999
resolution rules. If <code>identity</code> is true, the parent field must be
9781000
resolved using the identifier expansion rules.</p>
9791001
</li>
980-
<li><p>If the value of this field is <code>@vocab</code>, the parent field must be resolved using the vocabulary resolution rules.</p>
1002+
<li><p>If the value of this field is <code>@vocab</code>, the parent field must be
1003+
resolved using the vocabulary resolution rules.</p>
9811004
</li>
9821005
</ul>
9831006
</div>

0 commit comments

Comments
 (0)