@@ -3105,7 +3105,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3105
3105
< a > processing mode</ a > set to < code > json-ld-1.1</ code > .</ p >
3106
3106
</ section >
3107
3107
3108
- < section class ="informative changed "> < h2 > Sealed Contexts </ h2 >
3108
+ < section class ="informative changed "> < h2 > Sealed Term Definitions </ h2 >
3109
3109
< p > JSON-LD is used in many specifications as the specified data format.
3110
3110
However, there is also a desire to allow some JSON-LD contents to be processed as plain JSON,
3111
3111
without using any of the JSON-LD algorithms.
@@ -3116,15 +3116,15 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3116
3116
On the other hand, "plain JSON" implementations may not be able to interpret these embedded contexts,
3117
3117
and hence will still interpret those terms with their original meaning.
3118
3118
To prevent this divergence of interpretation,
3119
- JSON-LD 1.1 allows a context to be sealed.
3119
+ JSON-LD 1.1 allows term definitions to be < em > sealed</ em > .
3120
3120
</ p >
3121
- < p > A < dfn > sealed context </ dfn > is a context with a member < code > @sealed</ code > set to < code > true</ code > .
3122
- It prevents further contexts to override its term definitions .
3121
+ < p > A < dfn > sealed term definition </ dfn > is a term definition with a member < code > @sealed</ code > set to < code > true</ code > .
3122
+ It prevents further contexts to override this term definition .
3123
3123
</ p >
3124
3124
3125
3125
3126
3126
< aside class ="example ds-selector-tabs changed "
3127
- title ="A sealed @context prevents its term definitions to be overridden ">
3127
+ title ="A sealed term definition can not be overridden ">
3128
3128
< div class ="selectors ">
3129
3129
< button class ="selected " data-selects ="original "> Original</ button >
3130
3130
< button data-selects ="expanded "> Expanded</ button >
@@ -3138,13 +3138,15 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3138
3138
"@context": [
3139
3139
{
3140
3140
****"@version": 1.1****,
3141
- ****"@sealed": true****,
3142
3141
"Person": "http://schema.org/Person",
3143
- "name": "http://schema.org/name",
3144
- "knows": "http://schema.org/knows"
3142
+ "knows": "http://schema.org/knows",
3143
+ "name": {
3144
+ "@id": "http://schema.org/name",
3145
+ ****"@sealed": true****
3146
+ }
3145
3147
},
3146
3148
{
3147
- ****"Person ": "this_attempt_to_override_Person_will_fail "****
3149
+ ****"name ": "this_attempt_to_override_name_will_fail "****
3148
3150
}
3149
3151
],
3150
3152
"@type": "Person",
@@ -3160,7 +3162,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3160
3162
</ pre >
3161
3163
< pre class ="expanded nohighlight "
3162
3164
data-transform ="updateExample "
3163
- data-result-for ="A sealed @context prevents its term definitions to be overridden-original ">
3165
+ data-result-for ="A sealed term definition can not be overridden-original ">
3164
3166
<!--
3165
3167
[{
3166
3168
"@type": ["http://schema.org/Person"],
@@ -3172,7 +3174,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3172
3174
-->
3173
3175
</ pre >
3174
3176
< table class ="statements "
3175
- data-result-for ="A sealed @context prevents its term definitions to be overridden-expanded "
3177
+ data-result-for ="A sealed term definition can not be overridden-expanded "
3176
3178
data-to-rdf >
3177
3179
< thead > < tr > < th > Subject</ th > < th > Property</ th > < th > Value</ th > </ tr > </ thead >
3178
3180
< tbody >
@@ -3184,7 +3186,7 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3184
3186
</ table >
3185
3187
< pre class ="turtle "
3186
3188
data-content-type ="text/turtle "
3187
- data-result-for ="A sealed @context prevents its term definitions to be overridden-expanded "
3189
+ data-result-for ="A sealed term definition can not be overridden-expanded "
3188
3190
data-transform ="updateExample "
3189
3191
data-to-rdf >
3190
3192
<!--
@@ -3201,12 +3203,16 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3201
3203
</ pre >
3202
3204
</ aside >
3203
3205
3204
- < p > Terms defined by a sealed context may still be overridden by scoped contexts,
3205
- as long as those are defined < em > inside</ em > the same sealed context as the original term definition.
3206
+ < p > When all or most term definitions of a context need to be sealed,
3207
+ it is possible to add a member < code > @sealed</ code > set to < code > true</ code >
3208
+ to the context itself.
3209
+ It has the same effect as sealing each of its term definitions individually.
3210
+ Exceptions can be made by adding a member < code > @sealed</ code > set to < code > false</ code >
3211
+ in some term definitions.
3206
3212
</ p >
3207
3213
3208
3214
< aside class ="example ds-selector-tabs changed "
3209
- title ="A sealed @context can override its own terms ">
3215
+ title ="A sealed @context with an exception ">
3210
3216
< div class ="selectors ">
3211
3217
< button class ="selected " data-selects ="original "> Original</ button >
3212
3218
< button data-selects ="expanded "> Expanded</ button >
@@ -3225,79 +3231,76 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3225
3231
"member": "http://schema.org/member",
3226
3232
"Person": {
3227
3233
"@id": "http://schema.org/Person",
3228
- "@context": [null, {
3229
- "Person": "http://schema.org/Person",
3230
- "name": "http://schema.org/familyName"
3231
- }]
3234
+ ****"@sealed": false****
3232
3235
}
3233
3236
}
3234
3237
],
3235
3238
"name": "Digital Bazaar",
3236
3239
"member": {
3240
+ "@context": {
3241
+ "Person": "http://xmlns.com/foaf/0.1/Person",
3242
+ "name": "this_attempt_to_override_name_will_fail"
3243
+ }
3237
3244
"@type": "Person",
3238
- "name": "Sporny"
3245
+ "name": "Manu Sporny"
3239
3246
}
3240
3247
}
3241
3248
-->
3242
3249
</ pre >
3243
3250
< pre class ="expanded nohighlight "
3244
3251
data-transform ="updateExample "
3245
- data-result-for ="A sealed @context can override its own terms -original ">
3252
+ data-result-for ="A sealed @context with an exception -original ">
3246
3253
<!--
3247
3254
[{
3248
3255
"http://schema.org/name": [{"@value": "Digital Bazaar"}],
3249
3256
"http://schema.org/member": [
3250
3257
{
3251
- "@type": ["http://schema.org /Person"],
3252
- "http://schema.org/familyName ": [{"@value": "Sporny"}]
3258
+ "@type": ["http://xmlns.com/foaf/0.1 /Person"],
3259
+ "http://schema.org/name ": [{"@value": "Manu Sporny"}]
3253
3260
}
3254
3261
]
3255
3262
}]
3256
3263
-->
3257
3264
</ pre >
3258
3265
< table class ="statements "
3259
- data-result-for ="A sealed @context can override its own terms -expanded "
3266
+ data-result-for ="A sealed @context with an exception -expanded "
3260
3267
data-to-rdf >
3261
3268
< thead > < tr > < th > Subject</ th > < th > Property</ th > < th > Value</ th > </ tr > </ thead >
3262
3269
< tbody >
3263
3270
< tr > < td > _:b0</ td > < td > schema:name</ td > < td > Digital Bazaar</ td > </ tr >
3264
3271
< tr > < td > _:b0</ td > < td > schema:member</ td > < td > _:b1</ td > </ tr >
3265
- < tr > < td > _:b1</ td > < td > rdf:type</ td > < td > schema :Person</ td > </ tr >
3266
- < tr > < td > _:b1</ td > < td > schema:familyName </ td > < td > Sporny</ td > </ tr >
3272
+ < tr > < td > _:b1</ td > < td > rdf:type</ td > < td > foaf :Person</ td > </ tr >
3273
+ < tr > < td > _:b1</ td > < td > schema:name </ td > < td > Manu Sporny</ td > </ tr >
3267
3274
</ tbody >
3268
3275
</ table >
3269
3276
< pre class ="turtle "
3270
3277
data-content-type ="text/turtle "
3271
- data-result-for ="A sealed @context can override its own terms -expanded "
3278
+ data-result-for ="A sealed @context with an exception -expanded "
3272
3279
data-transform ="updateExample "
3273
3280
data-to-rdf >
3274
3281
<!--
3282
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
3275
3283
@prefix schema: <http://schema.org/> .
3276
3284
3277
3285
[
3278
3286
schema:name "Digital Bazaar";
3279
3287
schema:member [
3280
- a schema :Person;
3281
- schema:familyName " Sporny"
3288
+ a foaf :Person;
3289
+ schema:name "Manu Sporny"
3282
3290
]
3283
3291
] .
3284
3292
-->
3285
3293
</ pre >
3286
3294
</ aside >
3287
3295
3288
- < p > A sealed context is not necessarily effective in the whole document.
3289
- Its effect starts in the node where it is referenced or embedded,
3290
- and propagates to deeper nodes only when traversing terms < em > that it defines</ em > .
3291
- Traversing other terms stops the effect of the sealed context,
3292
- so in the remaining subtrees of the JSON document,
3293
- the terms from the sealed context are no longer protected against overridding.
3294
- The rationale is that "prose-based" implementations would generally ignore any term
3295
- < em > not</ em > defined by the underlying specification,
3296
- and so the specification does apply to the parts of the documents beyond those unspecified terms.
3297
- </ p >
3296
+ < p > While sealed term definitions can not be directly overridden,
3297
+ it is worth noting that setting < code > @context</ code > to < code > null</ code >
3298
+ will erase everything from the active context,
3299
+ < em > including</ em > sealed term definitions.
3300
+ </ p >
3298
3301
3299
3302
< aside class ="example ds-selector-tabs changed "
3300
- title ="Sealing does not extend beyond other terms ">
3303
+ title ="@context null erases sealed term definitions ">
3301
3304
< div class ="selectors ">
3302
3305
< button class ="selected " data-selects ="original "> Original</ button >
3303
3306
< button data-selects ="expanded "> Expanded</ button >
@@ -3312,44 +3315,35 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3312
3315
{
3313
3316
****"@version": 1.1****,
3314
3317
****"@sealed": true****,
3315
- "name": "http://schema.org/name",
3316
- "employee": "http://schema.org/employee",
3317
3318
"Organization": "http://schema.org/Organization"
3318
- },
3319
- {
3320
- "member": "http://xmlns.com/foaf/0.1/member"
3319
+ "name": "http://schema.org/name",
3320
+ "employee": {
3321
+ "@id": http://schema.org/employee",
3322
+ ****"@context": null****
3321
3323
}
3322
3324
],
3323
3325
"@type": "Organization",
3324
3326
"name": "Digital Bazaar",
3325
3327
"employee" : {
3328
+ #### -- because of "@context": null in the scoped context, ####
3329
+ #### -- the active context at this point is empty; ####
3330
+ #### -- so we can (and we must) redefine "name" below ####
3326
3331
"@context": {
3327
- "name": "http://example.org/this_attempt_to_override_name_will_fail"
3332
+ **** "name": "http://xmlns.com/foaf/0.1/name"****
3328
3333
},
3329
- "name" : "Dave Longley"
3330
- },
3331
- "member": {
3332
- "@context": [null, {
3333
- "name": "http://xmlns.com/foaf/0.1/name"
3334
- }],
3335
3334
"name": "Manu Sporny"
3336
3335
}
3337
3336
}
3338
3337
-->
3339
3338
</ pre >
3340
3339
< pre class ="expanded nohighlight "
3341
3340
data-transform ="updateExample "
3342
- data-result-for ="Sealing does not extend beyond other terms -original ">
3341
+ data-result-for ="@context null erases sealed term definitions -original ">
3343
3342
<!--
3344
3343
[{
3345
3344
"@type": ["http://schema.org/Organization"],
3346
3345
"http://schema.org/name": [{"@value": "Digital Bazaar"}],
3347
3346
"http://schema.org/employee": [
3348
- {
3349
- "http://schema.org/name": [{"@value": "Dave Longley"}]
3350
- }
3351
- ],
3352
- "http://xmlns.com/foaf/0.1/member": [
3353
3347
{
3354
3348
"http://xmlns.com/foaf/0.1/name": [{"@value": "Manu Sporny"}]
3355
3349
}
@@ -3358,42 +3352,37 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3358
3352
-->
3359
3353
</ pre >
3360
3354
< table class ="statements "
3361
- data-result-for ="Sealing does not extend beyond other terms -expanded "
3355
+ data-result-for ="@context null erases sealed term definitions -expanded "
3362
3356
data-to-rdf >
3363
3357
< thead > < tr > < th > Subject</ th > < th > Property</ th > < th > Value</ th > </ tr > </ thead >
3364
3358
< tbody >
3365
3359
< tr > < td > _:b0</ td > < td > rdf:type</ td > < td > schema:Organization</ td > </ tr >
3366
3360
< tr > < td > _:b0</ td > < td > schema:name</ td > < td > Digital Bazaar</ td > </ tr >
3367
3361
< tr > < td > _:b0</ td > < td > schema:employee</ td > < td > _:b1</ td > </ tr >
3368
- < tr > < td > _:b0</ td > < td > foaf:member</ td > < td > _:b2</ td > </ tr >
3369
- < tr > < td > _:b1</ td > < td > schema:name</ td > < td > Dave Longley</ td > </ tr >
3370
- < tr > < td > _:b2</ td > < td > foaf:name</ td > < td > Manu Sporny</ td > </ tr >
3362
+ < tr > < td > _:b1</ td > < td > foaf:name</ td > < td > Manu Sporny</ td > </ tr >
3371
3363
</ tbody >
3372
3364
</ table >
3373
3365
< pre class ="turtle "
3374
3366
data-content-type ="text/turtle "
3375
- data-result-for ="Sealing does not extend beyond other terms -expanded "
3367
+ data-result-for ="@context null erases sealed term definitions -expanded "
3376
3368
data-transform ="updateExample "
3377
3369
data-to-rdf >
3378
3370
<!--
3379
- @prefix schema: <http://schema.org/>.
3380
3371
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
3372
+ @prefix schema: <http://schema.org/>.
3381
3373
3382
3374
[
3383
3375
a schema:Organization;
3384
3376
schema:name "Digital Bazaar";
3385
3377
schema:employee [
3386
- schema:name "Dave Longley"
3387
- ];
3388
- foaf:member [
3389
3378
foaf:name "Manu Sporny"
3390
3379
];
3391
3380
] .
3392
3381
-->
3393
3382
</ pre >
3394
3383
</ aside >
3395
3384
3396
- < p class ="note "> Sealed Contexts are a new feature in JSON-LD 1.1, requiring
3385
+ < p class ="note "> Sealed term definitions are a new feature in JSON-LD 1.1, requiring
3397
3386
< a > processing mode</ a > set to < code > json-ld-1.1</ code > .</ p >
3398
3387
</ section >
3399
3388
</ section >
0 commit comments