@@ -3425,6 +3425,88 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
3425
3425
</ pre >
3426
3426
</ aside >
3427
3427
3428
+ < p > It is important to note that < a > terms</ a > are only used in expansion
3429
+ for vocabulary-relative positions, such as for keys and values of < a > dictionary members</ a > .
3430
+ Values of < code > @id</ code > are considered to be document-relative,
3431
+ and do not use term definitions for expansion. For example, consider the following:</ p >
3432
+
3433
+ < aside class ="example ds-selector-tabs changed "
3434
+ title ="Term expansion for values, not identifiers ">
3435
+ < div class ="selectors ">
3436
+ < button class ="selected " data-selects ="original "> Original</ button >
3437
+ < button data-selects ="expanded "> Expanded</ button >
3438
+ < button data-selects ="statements "> Statements</ button >
3439
+ < button data-selects ="turtle "> Turtle</ button >
3440
+ < a class ="playground " target ="_blank "> </ a >
3441
+ </ div >
3442
+ < pre class ="original selected nohighlight " data-transform ="updateExample ">
3443
+ <!--
3444
+ {
3445
+ "@context": {
3446
+ "@base": "http://example1.com/",
3447
+ "@vocab": "http://example2.com/",
3448
+ "fred": {"@type": "@vocab"}
3449
+ },
3450
+ "fred": [
3451
+ {"@id": "barney", "mnemonic": "the sidekick"},
3452
+ "barney"
3453
+ ]
3454
+ }
3455
+ -->
3456
+ </ pre >
3457
+ < pre class ="expanded nohighlight "
3458
+ data-transform ="updateExample "
3459
+ data-result-for ="Term expansion for values, not identifiers-original ">
3460
+ <!--
3461
+ [{
3462
+ "http://example2.com/fred": [
3463
+ {
3464
+ "@id": "http://example1.com/barney",
3465
+ "http://example2.com/mnemonic": [{"@value": "the sidekick"}]
3466
+ },
3467
+ {
3468
+ "@id": "http://example2.com/barney"
3469
+ }
3470
+ ]
3471
+ }]
3472
+ -->
3473
+ </ pre >
3474
+ < table class ="statements "
3475
+ data-result-for ="Term expansion for values, not identifiers-expanded "
3476
+ data-to-rdf >
3477
+ < thead > < tr > < th > Subject</ th > < th > Property</ th > < th > Value</ th > </ tr > </ thead >
3478
+ < tbody >
3479
+ < tr > < td > http://example1.com/barney</ td > < td > http://example2.com/mnemonic</ td > < td > the sidekick</ td > </ tr >
3480
+ < tr > < td > _:b0</ td > < td > http://example2.com/fred</ td > < td > http://example1.com/barney</ td > </ tr >
3481
+ < tr > < td > _:b0</ td > < td > http://example2.com/fred</ td > < td > http://example2.com/barney</ td > </ tr >
3482
+ </ tbody >
3483
+ </ table >
3484
+ < pre class ="turtle "
3485
+ data-content-type ="text/turtle "
3486
+ data-result-for ="Term expansion for values, not identifiers-expanded "
3487
+ data-transform ="updateExample "
3488
+ data-to-rdf >
3489
+ <!--
3490
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
3491
+ @prefix ex1: <http://example1.com/> .
3492
+ @prefix ex2: <http://example2.com/> .
3493
+
3494
+ ex1:barney ex2:mnemonic "the sidekick" .
3495
+
3496
+ [ ex2:fred ex2:barney, ex1:barney] .
3497
+ -->
3498
+ </ pre >
3499
+ </ aside >
3500
+
3501
+ < p > The unexpected result is that "barney" expands to both < code > http://example1.com/barney</ code >
3502
+ and < code > http://example2.com/barney</ code > depending on where it is encountered.
3503
+ String values interpreted as < a > IRIs</ a > because of the associated < a > term definition</ a >
3504
+ are typically considered to be document-relative.
3505
+ In some cases, it makes sense that there be interpreted relative to the vocabulary,
3506
+ in which case < code > "@type": "@vocab"</ code > used in a < a > term definition</ a > ,
3507
+ but this can lead to such unexpected consequences.
3508
+ For more on this see < a class ="sectionRef " href ="#default-vocabulary "> </ a > </ p >
3509
+
3428
3510
< p > Terms may also be defined using < a > absolute IRIs</ a >
3429
3511
or < a > compact IRIs</ a > . This allows coercion rules
3430
3512
to be applied to keys which are not represented as a simple < a > term</ a > .
0 commit comments