@@ -220,7 +220,7 @@ <h2>How to Read this Document</h2>
220
220
providing a standard library interface for common JSON-LD operations.</ p >
221
221
222
222
< p > To understand the basics in this specification you must first be familiar with
223
- < a data-cite ="rfc7159 "> JSON</ a > , which is detailed in [[!RFC7159]].</ p >
223
+ < a data-cite ="RFC7159 "> JSON</ a > , which is detailed in [[!RFC7159]].</ p >
224
224
225
225
< p > This document almost exclusively uses the term IRI
226
226
(< a data-cite ="ld-glossary#internationalized-resource-identifier "> Internationalized Resource Indicator</ a > )
@@ -450,7 +450,7 @@ <h1>Basic Concepts</h1>
450
450
tokens such as "name", "homepage", etc.</ p >
451
451
452
452
< p > Linked Data, and the Web in general, uses < a > IRIs</ a >
453
- (< a data-cite ="rfc3987 #section-2 "> Internationalized Resource Identifiers</ a > as described in [[!RFC3987]]) for unambiguous
453
+ (< a data-cite ="RFC3987 #section-2 "> Internationalized Resource Identifiers</ a > as described in [[!RFC3987]]) for unambiguous
454
454
identification. The idea is to use < a > IRIs</ a >
455
455
to assign unambiguous identifiers to data that may be of use to other developers.
456
456
It is useful for < a > terms</ a > ,
@@ -571,7 +571,7 @@ <h2>The Context</h2>
571
571
is ignored when the document is used as an external JSON-LD context document.</ p >
572
572
573
573
< p > JSON documents can be interpreted as JSON-LD without having to be modified by
574
- referencing a < a > context</ a > via an < a data-cite ="rfc5988 #section-5 "> HTTP Link Header</ a >
574
+ referencing a < a > context</ a > via an < a data-cite ="RFC5988 #section-5 "> HTTP Link Header</ a >
575
575
as described in < a class ="sectionRef " href ="#interpreting-json-as-json-ld "> </ a > . It is also
576
576
possible to apply a custom context using the JSON-LD API [[JSON-LD-API]].</ p >
577
577
@@ -613,12 +613,12 @@ <h2>The Context</h2>
613
613
< section class ="informative ">
614
614
< h2 > IRIs</ h2 >
615
615
616
- < p > < a > IRIs</ a > (< a data-cite ="rfc3987 #section-2 "> Internationalized Resource Identifiers</ a >
616
+ < p > < a > IRIs</ a > (< a data-cite ="RFC3987 #section-2 "> Internationalized Resource Identifiers</ a >
617
617
[[!RFC3987]]) are fundamental to Linked Data as that is how most
618
618
< a > nodes</ a > and < a > properties</ a >
619
619
are identified. In JSON-LD, IRIs may be represented as an
620
620
< a > absolute IRI</ a > or a < a > relative IRI</ a > . An
621
- < a data-cite ="rfc3987 #section-1.3 "> absolute IRI</ a > is defined in [[!RFC3987]] as containing a
621
+ < a data-cite ="RFC3987 #section-1.3 "> absolute IRI</ a > is defined in [[!RFC3987]] as containing a
622
622
< em > scheme</ em > along with < em > path</ em > and optional < em > query</ em > and
623
623
< em > fragment</ em > segments. A < a > relative IRI</ a > is an IRI
624
624
that is relative to some other < a > absolute IRI</ a > .
@@ -863,7 +863,7 @@ <h2>Base IRI</h2>
863
863
864
864
< p > JSON-LD allows < a > IRI</ a > s to be specified in a relative form which is
865
865
resolved against the document base according
866
- < a data-cite ="rfc3986 #section-5.1 "> section 5.1 Establishing a Base URI</ a >
866
+ < a data-cite ="RFC3986 #section-5.1 "> section 5.1 Establishing a Base URI</ a >
867
867
of [[RFC3986]]. The < a > base IRI</ a > may be explicitly set with a < a > context</ a >
868
868
using the < code > @base</ code > keyword.</ p >
869
869
@@ -1491,7 +1491,7 @@ <h2>Advanced Context Usage</h2>
1491
1491
< h2 > Interpreting JSON as JSON-LD</ h2 >
1492
1492
1493
1493
< p > Ordinary JSON documents can be interpreted as JSON-LD by referencing a JSON-LD
1494
- < a > context</ a > document in an < a data-cite ="rfc5988 #section-5 "> HTTP Link Header</ a > . Doing so allows JSON to
1494
+ < a > context</ a > document in an < a data-cite ="RFC5988 #section-5 "> HTTP Link Header</ a > . Doing so allows JSON to
1495
1495
be unambiguously machine-readable without requiring developers to drastically
1496
1496
change their documents and provides an upgrade path for existing infrastructure
1497
1497
without breaking existing clients that rely on the < code > application/json</ code >
@@ -1500,7 +1500,7 @@ <h2>Interpreting JSON as JSON-LD</h2>
1500
1500
1501
1501
< p > In order to use an external context with an ordinary JSON document, an author
1502
1502
MUST specify an < a > IRI</ a > to a valid < a > JSON-LD document</ a > in
1503
- an < a data-cite ="rfc5988 #section-5 "> HTTP Link Header</ a > [[!RFC5988]] using the < code > http://www.w3.org/ns/json-ld#context</ code >
1503
+ an < a data-cite ="RFC5988 #section-5 "> HTTP Link Header</ a > [[!RFC5988]] using the < code > http://www.w3.org/ns/json-ld#context</ code >
1504
1504
link relation. The referenced document MUST have a top-level < a > JSON object</ a > .
1505
1505
The < code > @context</ code > subtree within that object is added to the top-level
1506
1506
< a > JSON object</ a > of the referencing document. If an < a > array</ a >
@@ -1510,7 +1510,7 @@ <h2>Interpreting JSON as JSON-LD</h2>
1510
1510
of the < code > @context</ code > subtree in the referenced document MUST be
1511
1511
discarded. Effectively this means that the < a > active context</ a > is
1512
1512
initialized with the referenced external < a > context</ a > . A response MUST NOT
1513
- contain more than one < a data-cite ="rfc5988 #section-5 "> HTTP Link Header</ a > [[!RFC5988]] using the
1513
+ contain more than one < a data-cite ="RFC5988 #section-5 "> HTTP Link Header</ a > [[!RFC5988]] using the
1514
1514
< code > http://www.w3.org/ns/json-ld#context</ code > link relation.</ p >
1515
1515
1516
1516
< p > The following example demonstrates the use of an external context with an
@@ -1542,7 +1542,7 @@ <h2>Interpreting JSON as JSON-LD</h2>
1542
1542
served with the < code > application/ld+json</ code >
1543
1543
media type MUST have all context information, including references to external
1544
1544
contexts, within the body of the document. Contexts linked via a
1545
- < code > http://www.w3.org/ns/json-ld#context</ code > < a data-cite ="rfc5988 #section-5 "> HTTP Link Header</ a > MUST be
1545
+ < code > http://www.w3.org/ns/json-ld#context</ code > < a data-cite ="RFC5988 #section-5 "> HTTP Link Header</ a > MUST be
1546
1546
ignored for such documents.</ p >
1547
1547
</ section >
1548
1548
@@ -1571,7 +1571,7 @@ <h2>String Internationalization</h2>
1571
1571
1572
1572
< p > The example above would associate the < code > ja</ code > language
1573
1573
code with the two < a > strings</ a > < em > 花澄</ em > and < em > 科学者</ em > .
1574
- < a data-cite ="bcp47 #section-2 "> Languages codes</ a > are defined in [[!BCP47]]. The < a > default language</ a > applies to all
1574
+ < a data-cite ="BCP47 #section-2 "> Languages codes</ a > are defined in [[!BCP47]]. The < a > default language</ a > applies to all
1575
1575
< a > string</ a > values that are not < a href ="#type-coercion "> type coerced</ a > .</ p >
1576
1576
1577
1577
< p > To clear the < a > default language</ a > for a subtree, < code > @language</ code > can
@@ -2150,7 +2150,7 @@ <h2>Scoped Contexts</h2>
2150
2150
{
2151
2151
"name": "http://schema.org/name",
2152
2152
"interest": {
2153
- "@id":"http://xmlns.com/foaf/0.1/interest",
2153
+ "@id": "http://xmlns.com/foaf/0.1/interest",
2154
2154
****"@context": {"@vocab": "http://xmlns.com/foaf/0.1/"}****
2155
2155
}
2156
2156
},
@@ -2186,7 +2186,6 @@ <h2>Scoped Contexts</h2>
2186
2186
< a > expanded term definitions</ a >
2187
2187
to create reverse properties as shown in the following example:</ p >
2188
2188
2189
-
2190
2189
< pre class ="example " data-transform ="updateExample "
2191
2190
title ="Using @reverse to define reverse properties ">
2192
2191
<!--
@@ -2210,6 +2209,35 @@ <h2>Scoped Contexts</h2>
2210
2209
}
2211
2210
-->
2212
2211
</ pre >
2212
+
2213
+ < p > Scoping can also be performed using a term used as a value of < code > @type</ code > :</ p >
2214
+
2215
+ < pre class ="example " data-transform ="updateExample "
2216
+ title ="Defining an @context within a term definition used on @type ">
2217
+ <!--
2218
+ {
2219
+ "@context":
2220
+ {
2221
+ "name": "http://schema.org/name",
2222
+ "interest": "http://xmlns.com/foaf/0.1/interest",
2223
+ ****"Document"****: {
2224
+ "@id": "http://xmlns.com/foaf/0.1/Document",
2225
+ ****"@context": {"@vocab": "http://xmlns.com/foaf/0.1/"}****
2226
+ }
2227
+ },
2228
+ "@type": "Person",
2229
+ "name": "Manu Sporny",
2230
+ "interest": {
2231
+ "@id": "https://www.w3.org/TR/json-ld/",
2232
+ ****"@type": "Document"****,
2233
+ "name": "JSON-LD",
2234
+ "topic": "Linking Data"
2235
+ }
2236
+ }
2237
+ -->
2238
+ </ pre >
2239
+
2240
+ < p > Scoping on < code > @type</ code > is useful when common properties are used to relate things of different types, where the vocabularies in use within different entities calls for different context scoping. For example, `hasPart`/`partOf` may be common terms used in a document, but mean different things depending on the context.</ p >
2213
2241
</ section >
2214
2242
2215
2243
@@ -3017,7 +3045,7 @@ <h1>Data Model</h1>
3017
3045
< p > JSON-LD is a serialization format for Linked Data based on JSON.
3018
3046
It is therefore important to distinguish between the syntax, which is
3019
3047
defined by JSON in [[!RFC7159]], and the < dfn > data model</ dfn > which is
3020
- an extension of the < a data-cite ="rdf11-concepts #data-model "> RDF data model</ a > [[!RDF11-CONCEPTS]]. The precise
3048
+ an extension of the < a data-cite ="RDF11-CONCEPTS #data-model "> RDF data model</ a > [[!RDF11-CONCEPTS]]. The precise
3021
3049
details of how JSON-LD relates to the RDF data model are given in
3022
3050
< a class ="sectionRef " href ="#relationship-to-rdf "> </ a > .</ p >
3023
3051
@@ -3071,14 +3099,14 @@ <h1>Data Model</h1>
3071
3099
< li > A < a > typed value</ a > consists of a value, which is a string, and a type, which is an
3072
3100
< a > IRI</ a > .</ li >
3073
3101
< li > A < a > language-tagged string</ a >
3074
- consists of a string and a non-empty < a data-cite ="bcp47 #section-2 "> language tag</ a > as defined by [[BCP47]].
3102
+ consists of a string and a non-empty < a data-cite ="BCP47 #section-2 "> language tag</ a > as defined by [[BCP47]].
3075
3103
The language tag MUST be well-formed according to section
3076
- < a data-cite ="bcp47 #section-2.2.9 "> 2.2.9 Classes of Conformance</ a >
3104
+ < a data-cite ="BCP47 #section-2.2.9 "> 2.2.9 Classes of Conformance</ a >
3077
3105
of [[BCP47]].</ li >
3078
3106
< li > A < a > list</ a > is a sequence of zero or more < a > IRIs</ a > ,
3079
3107
< a > blank nodes</ a > , and < a > JSON-LD values</ a > .
3080
3108
< a > Lists</ a > are interpreted as
3081
- < dfn data-cite ="rdf11-mt #rdf-collections "> RDF list structures</ dfn > [[RDF11-MT]].</ li >
3109
+ < dfn data-cite ="RDF11-MT #rdf-collections "> RDF list structures</ dfn > [[RDF11-MT]].</ li >
3082
3110
</ ul >
3083
3111
3084
3112
< p > < a > JSON-LD documents</ a > MAY contain data
@@ -3098,7 +3126,7 @@ <h1>JSON-LD Grammar</h1>
3098
3126
< p > This appendix restates the syntactic conventions described in the
3099
3127
previous sections more formally.</ p >
3100
3128
3101
- < p > A < a > JSON-LD document</ a > MUST be valid < a data-cite ="rfc7159 #section-2 "> JSON text</ a > as described
3129
+ < p > A < a > JSON-LD document</ a > MUST be valid < a data-cite ="RFC7159 #section-2 "> JSON text</ a > as described
3102
3130
in [[!RFC7159]].</ p >
3103
3131
3104
3132
< p > A < a > JSON-LD document</ a > MUST be a single < a > node object</ a >
@@ -3277,7 +3305,7 @@ <h2>Value Objects</h2>
3277
3305
an < a > absolute IRI</ a > , a < a > relative IRI</ a > , or < a > null</ a > .</ p >
3278
3306
3279
3307
< p > The value associated with the < code > @language</ code > key MUST have the
3280
- < a data-cite ="bcp47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]], or be < a > null</ a > .</ p >
3308
+ < a data-cite ="BCP47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]], or be < a > null</ a > .</ p >
3281
3309
3282
3310
< p > The value associated with the < code > @index</ code > key MUST be a
3283
3311
< a > string</ a > .</ p >
@@ -3429,7 +3457,7 @@ <h2>Context Definitions</h2>
3429
3457
and < code > @vocab</ code > .</ p >
3430
3458
3431
3459
< p > If the < a > context definition</ a > has an < code > @language</ code > key,
3432
- its value MUST have the < a data-cite ="bcp47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]] or be < a > null</ a > .</ p >
3460
+ its value MUST have the < a data-cite ="BCP47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]] or be < a > null</ a > .</ p >
3433
3461
3434
3462
< p > If the < a > context definition</ a > has an < code > @base</ code > key,
3435
3463
its value MUST be an < a > absolute IRI</ a > , a < a > relative IRI</ a > ,
@@ -3475,7 +3503,7 @@ <h2>Context Definitions</h2>
3475
3503
< a > keyword</ a > < code > @id</ code > or < code > @vocab</ code > .</ p >
3476
3504
3477
3505
< p > If the < a > expanded term definition</ a > contains the < code > @language</ code > < a > keyword</ a > ,
3478
- its value MUST have the < a data-cite ="bcp47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]] or be < a > null</ a > .</ p >
3506
+ its value MUST have the < a data-cite ="BCP47 #section-2.1.1 "> lexical form</ a > described in [[!BCP47]] or be < a > null</ a > .</ p >
3479
3507
3480
3508
< p > If the < a > expanded term definition</ a > contains the < code > @container</ code >
3481
3509
< a > keyword</ a > , its value MUST be either < code > @list</ code > , < code > @set</ code > ,
@@ -3506,12 +3534,12 @@ <h2>Context Definitions</h2>
3506
3534
< h2 > Relationship to RDF</ h2 >
3507
3535
3508
3536
< p > JSON-LD is a
3509
- < dfn data-cite ="rdf11-concepts #dfn-concrete-rdf-syntax "> concrete RDF syntax</ dfn >
3537
+ < dfn data-cite ="RDF11-CONCEPTS #dfn-concrete-rdf-syntax "> concrete RDF syntax</ dfn >
3510
3538
as described in [[RDF11-CONCEPTS]]. Hence, a JSON-LD document is both an
3511
3539
RDF document < em > and</ em > a JSON document and correspondingly represents an
3512
3540
instance of an RDF data model. However, JSON-LD also extends the RDF data
3513
3541
model to optionally allow JSON-LD to serialize
3514
- < dfn data-cite ="rdf11-concepts #dfn-generalized-rdf-dataset " data-lt ="generalized rdf dataset "> generalized RDF Datasets</ dfn > .
3542
+ < dfn data-cite ="RDF11-CONCEPTS #dfn-generalized-rdf-dataset " data-lt ="generalized rdf dataset "> generalized RDF Datasets</ dfn > .
3515
3543
The JSON-LD extensions to the RDF data model are:</ p >
3516
3544
3517
3545
< ul >
@@ -3559,7 +3587,7 @@ <h2>Relationship to RDF</h2>
3559
3587
< a > blank nodes</ a > used as
3560
3588
< a > properties</ a > to < a > IRIs</ a > ,
3561
3589
by minting new "Skolem IRIs" as per
3562
- < a data-cite ="rdf11-concepts #section-skolemization "> Replacing Blank Nodes with IRIs</ a >
3590
+ < a data-cite ="RDF11-CONCEPTS #section-skolemization "> Replacing Blank Nodes with IRIs</ a >
3563
3591
of [[RDF11-CONCEPTS]].</ li >
3564
3592
</ ul >
3565
3593
@@ -3569,7 +3597,7 @@ <h2>Relationship to RDF</h2>
3569
3597
3570
3598
< p > Even though JSON-LD serializes
3571
3599
< a > generalized RDF Datasets</ a > , it can
3572
- also be used as a < dfn data-cite ="rdf11-concepts #dfn-rdf-source "> RDF graph source</ dfn > .
3600
+ also be used as a < dfn data-cite ="RDF11-CONCEPTS #dfn-rdf-source "> RDF graph source</ dfn > .
3573
3601
In that case, a consumer MUST only use the default graph and ignore all named graphs.
3574
3602
This allows servers to expose data in languages such as Turtle and JSON-LD
3575
3603
using content negotiation.</ p >
@@ -4101,7 +4129,7 @@ <h3>application/ld+json</h3>
4101
4129
< p > When processing the "profile" media type parameter, it is important to
4102
4130
note that its value contains one or more URIs and not IRIs. In some cases
4103
4131
it might therefore be necessary to convert between IRIs and URIs as specified in
4104
- < a data-cite ="rfc3986 #section-5.1 "> section 3 Relationship between IRIs and URIs</ a >
4132
+ < a data-cite ="RFC3986 #section-5.1 "> section 3 Relationship between IRIs and URIs</ a >
4105
4133
of [[RFC3987]].</ p >
4106
4134
</ dd >
4107
4135
</ dl >
@@ -4169,7 +4197,7 @@ <h3>application/ld+json</h3>
4169
4197
4170
4198
< p > Fragment identifiers used with < a href ="#application-ld-json "> application/ld+json</ a >
4171
4199
are treated as in RDF syntaxes, as per
4172
- < a data-cite ="rdf11-concepts #section-fragID "> RDF 1.1 Concepts and Abstract Syntax</ a >
4200
+ < a data-cite ="RDF11-CONCEPTS #section-fragID "> RDF 1.1 Concepts and Abstract Syntax</ a >
4173
4201
[[RDF11-CONCEPTS]].</ p >
4174
4202
</ section >
4175
4203
0 commit comments