@@ -67,12 +67,12 @@ api.process = ({activeCtx, localCtx, options,
67
67
68
68
// reset to initial context
69
69
if ( ctx === null ) {
70
- // We can't nullify if there are sealed terms and we're
70
+ // We can't nullify if there are protected terms and we're
71
71
// not in a term definition
72
72
if ( ! propertyTermDefinition &&
73
- Object . keys ( activeCtx . sealed ) . length !== 0 ) {
73
+ Object . keys ( activeCtx . protected ) . length !== 0 ) {
74
74
throw new JsonLdError (
75
- 'Tried to nullify a context with sealed terms outside of ' +
75
+ 'Tried to nullify a context with protected terms outside of ' +
76
76
'a term definition.' ,
77
77
'jsonld.SyntaxError' ,
78
78
{ code : 'invalid context nullification' } ) ;
@@ -193,10 +193,10 @@ api.process = ({activeCtx, localCtx, options,
193
193
defined [ '@language' ] = true ;
194
194
}
195
195
196
- // handle @sealed ; determine whether this sub-context is declaring
197
- // all its terms to be "sealed " (exceptions can be made on a
196
+ // handle @protected ; determine whether this sub-context is declaring
197
+ // all its terms to be "protected " (exceptions can be made on a
198
198
// per-definition basis)
199
- defined [ '@sealed ' ] = ctx [ '@sealed ' ] || false ;
199
+ defined [ '@protected ' ] = ctx [ '@protected ' ] || false ;
200
200
201
201
// process all other keys
202
202
for ( const key in ctx ) {
@@ -251,13 +251,11 @@ api.createTermDefinition = (activeCtx, localCtx, term, defined) => {
251
251
{ code : 'invalid term definition' , context : localCtx } ) ;
252
252
}
253
253
254
- // Is this term currently sealed?
255
- // Then redefining it here is an error!
256
- if ( activeCtx . sealed [ term ] ) {
254
+ if ( activeCtx . protected [ term ] ) {
257
255
throw new JsonLdError (
258
- 'Invalid JSON-LD syntax; tried to redefine a sealed term.' ,
256
+ 'Invalid JSON-LD syntax; tried to redefine a protected term.' ,
259
257
'jsonld.SyntaxError' ,
260
- { code : 'sealed term redefinition' , context : localCtx , term} ) ;
258
+ { code : 'protected term redefinition' , context : localCtx , term} ) ;
261
259
}
262
260
263
261
// remove old mapping
@@ -299,7 +297,7 @@ api.createTermDefinition = (activeCtx, localCtx, term, defined) => {
299
297
300
298
// JSON-LD 1.1 support
301
299
if ( api . processingMode ( activeCtx , 1.1 ) ) {
302
- validKeys . push ( '@context' , '@nest' , '@prefix' , '@sealed ' ) ;
300
+ validKeys . push ( '@context' , '@nest' , '@prefix' , '@protected ' ) ;
303
301
}
304
302
305
303
for ( const kw in value ) {
@@ -404,14 +402,14 @@ api.createTermDefinition = (activeCtx, localCtx, term, defined) => {
404
402
}
405
403
}
406
404
407
- // Handle term sealing
408
- if ( '@sealed ' in value ) {
409
- if ( value [ '@sealed ' ] ) {
410
- activeCtx . sealed [ term ] = true ;
405
+ // Handle term protection
406
+ if ( '@protected ' in value ) {
407
+ if ( value [ '@protected ' ] ) {
408
+ activeCtx . protected [ term ] = true ;
411
409
}
412
- } else if ( '@sealed ' in defined ) {
413
- if ( defined [ '@sealed ' ] ) {
414
- activeCtx . sealed [ term ] = true ;
410
+ } else if ( '@protected ' in defined ) {
411
+ if ( defined [ '@protected ' ] ) {
412
+ activeCtx . protected [ term ] = true ;
415
413
}
416
414
}
417
415
@@ -687,7 +685,7 @@ api.getInitialContext = options => {
687
685
inverse : null ,
688
686
getInverse : _createInverseContext ,
689
687
clone : _cloneActiveContext ,
690
- sealed : { }
688
+ protected : { }
691
689
} ;
692
690
// TODO: consider using LRU cache instead
693
691
if ( INITIAL_CONTEXT_CACHE . size === INITIAL_CONTEXT_CACHE_MAX_SIZE ) {
@@ -863,7 +861,7 @@ api.getInitialContext = options => {
863
861
child . clone = this . clone ;
864
862
child . inverse = null ;
865
863
child . getInverse = this . getInverse ;
866
- child . sealed = util . clone ( this . sealed ) ;
864
+ child . protected = util . clone ( this . protected ) ;
867
865
if ( '@language' in this ) {
868
866
child [ '@language' ] = this [ '@language' ] ;
869
867
}
@@ -973,9 +971,9 @@ api.isKeyword = v => {
973
971
case '@omitDefault' :
974
972
case '@prefix' :
975
973
case '@preserve' :
974
+ case '@protected' :
976
975
case '@requireAll' :
977
976
case '@reverse' :
978
- case '@sealed' :
979
977
case '@set' :
980
978
case '@type' :
981
979
case '@value' :
0 commit comments