You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h1id="Introduction" class="section">1. Introduction <ahref="#Introduction">§</a></h1><p>The JSON data model is an extremely popular way to represent structured
200
201
data. It is attractive because of it's relative simplicity and is a
201
202
natural fit with the standard types of many programming languages.
<h3id="Explicit_context" class="section">2.3.2 Explicit context <ahref="#Explicit_context">§</a></h3><p>If a document consists of a root object, this object may contain the
285
286
fields <code>$base</code>, <code>$namespaces</code>, <code>$schemas</code>, and <code>$graph</code>:</p>
286
287
<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>
288
290
</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
290
293
the object are the prefix expansions.</p>
291
294
</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
293
297
schema data. The subjects and predicates described by the RDF schema
294
298
may provide additional semantic context for the document, and may be
295
299
used for validation of prefixed extension fields found in the document.</p>
<h2id="Document_schema" class="section">2.6 Document schema <ahref="#Document_schema">§</a></h2><p>Document preprocessing, link validation and schema validation require a
306
310
document schema. A schema may consist of:</p>
307
311
<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
309
314
that may be assigned to each field and annotations to indicate fields
310
315
that represent identifiers and links, described below in "Semantic
311
316
Annotations".</p>
312
317
</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>
314
320
</li>
315
321
<li><p>Any number of documentation objects which allow in-line documentation of the schema.</p>
316
322
</li>
@@ -322,12 +328,15 @@ <h3 id="Record_field_annotations" class="section">2.6.1 Record field annotations
322
328
must use the following document preprocessing of fields by the following
323
329
rules:</p>
324
330
<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>
326
333
</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
328
336
link field.</p>
329
337
</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
331
340
vocabulary field, which is a subtype of link field.</p>
332
341
</li>
333
342
</ul>
@@ -350,12 +359,17 @@ <h2 id="Field_name_resolution" class="section">3.1 Field name resolution <a href
350
359
which are not part of the vocabulary are resolved using the following
351
360
rules:</p>
352
361
<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>
357
370
</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>
359
373
</li>
360
374
</ul>
361
375
<p>Field name resolution is not relative. It must not be affected by the
specific objects. Processing must resolve relative identifiers to absolute
401
415
identifiers using the following rules:</p>
402
416
<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
404
419
or replacing the fragment portion of the base URI.</p>
405
420
</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
407
423
base URI by the following rule: if the base URI does not contain a
408
424
document fragment, set the fragment portion of the base URI. If the base
409
425
URI does contain a document fragment, append a slash <code>/</code> followed by the
410
426
identifier field to the fragment portion of the base URI.</p>
411
427
</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
413
430
replaced by the namespace declared in <code>$namespaces</code>.</p>
414
431
</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>
416
434
</li>
417
435
</ul>
418
436
<p>When preprocessing visits a node containing an identifier, that identifier
objects. Processing must resolve links to either absolute URIs using the
484
502
following rules:</p>
485
503
<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
487
506
or replacing the fragment portion of the base URI.</p>
488
507
</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
490
510
position other than the first character, the reference URI must be divided
491
511
into a path portion and a fragment portion split on the first instance of
492
512
<code>#</code>. The path portion is resolved relative to the base URI by the following
fragment portion of the base URI with the fragment portion of the reference
498
518
URI.</p>
499
519
</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
501
522
namespace declared in <code>$namespaces</code>.</p>
502
523
</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>
504
526
</li>
505
527
</ul>
506
528
<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 <
570
592
}
571
593
</code></pre>
572
594
<h2id="Vocabulary_resolution" class="section">3.4 Vocabulary resolution <ahref="#Vocabulary_resolution">§</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>
581
602
<h3id="Vocabulary_resolution_example" class="section">3.4.1 Vocabulary resolution example <ahref="#Vocabulary_resolution_example">§</a></h3><p>Given the following schema:</p>
<divclass="col-xs-12 col-lg-6 description-col"><p>The context type hint, corresponds to JSON-LD <code>@type</code> directive.</p>
975
996
<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
977
999
resolution rules. If <code>identity</code> is true, the parent field must be
978
1000
resolved using the identifier expansion rules.</p>
979
1001
</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>
0 commit comments