@@ -2463,76 +2463,6 @@ <h1>Advanced Concepts</h1>
2463
2463
allows the value to be a <a>term</a> or <a>compact IRI</a>.
2464
2464
Note that terms used in the value of `@vocab` must be in scope at the time the context is introduced,
2465
2465
otherwise there would be a circular dependency between `@vocab` and other terms defined in the same context.</p>
2466
-
2467
- <section id="document-relative-vocabulary-mapping" class="changed">
2468
- <h3>Using the Document Base for the Default Vocabulary</h3>
2469
- <p>In some cases, vocabulary terms are defined directly within the document
2470
- itself, rather than in an external vocabulary.
2471
- Since <code>json-ld-1.1</code>, the <a>vocabulary mapping</a> in a <a>local context</a>
2472
- can be set to a <a>relative IRI</a>,
2473
- which is, if there is no vocabulary mapping in scope, resolved against the <a>base IRI</a>.
2474
- This causes terms which are expanded relative to the vocabulary,
2475
- such as the keys of <a>node objects</a>,
2476
- to be based on the <a>base IRI</a> to create <a>absolute IRIs</a>.</p>
2477
-
2478
- <pre class="example input nohighlight" data-transform="updateExample"
2479
- title="Using "#" as the vocabulary mapping"
2480
- data-base="http://example/document">
2481
- <!--
2482
- {
2483
- "@context": {
2484
- ****"@version": 1.1,****
2485
- ****"@base": "http://example/document",****
2486
- "@vocab": ****"#"****
2487
- },
2488
- "@id": "http://example.org/places#BrewEats",
2489
- "@type": ****"Restaurant"****,
2490
- ****"name"****: "Brew Eats"
2491
- ####...####
2492
- }
2493
- -->
2494
- </pre>
2495
-
2496
- <p>If this document were located at <code>http://example/document</code>, it would expand as follows:</p>
2497
-
2498
- <aside class="example ds-selector-tabs"
2499
- title="Using "#" as the vocabulary mapping (expanded)">
2500
- <div class="selectors">
2501
- <button class="selected" data-selects="expanded">Expanded (Result)</button>
2502
- <button data-selects="statements">Statements</button>
2503
- <button data-selects="turtle">Turtle</button>
2504
- <a class="playground" target="_blank"></a>
2505
- </div>
2506
- <pre class="expanded result selected nohighlight" data-transform="updateExample">
2507
- <!--
2508
- [{
2509
- "@id": "http://example.org/places#BrewEats",
2510
- "@type": ["http://example/document#Restaurant"],
2511
- "http://example/document#name": [{"@value": "Brew Eats"}]
2512
- }]
2513
- -->
2514
- </pre>
2515
- <table class="statements"
2516
- data-result-for="Using "#" as the vocabulary mapping (expanded)-expanded"
2517
- data-to-rdf>
2518
- <thead><tr><th>Subject</th><th>Property</th><th>Value</th></tr></thead>
2519
- <tbody>
2520
- <tr><td>http://example.org/places#BrewEats</td><td>rdf:type</td><td>http://example/document#Restaurant</td></tr>
2521
- <tr><td>http://example.org/places#BrewEats</td><td>http://example/document#name</td><td>Brew Eats</td></tr>
2522
- </tbody>
2523
- </table>
2524
- <pre class="turtle"
2525
- data-content-type="text/turtle"
2526
- data-result-for="Using "#" as the vocabulary mapping (expanded)-expanded"
2527
- data-transform="updateExample"
2528
- data-to-rdf>
2529
- <!--
2530
- <http://example.org/places#BrewEats> a <http://example/document#Restaurant>;
2531
- <http://example/document#name> "Brew Eats" .
2532
- -->
2533
- </pre>
2534
- </aside>
2535
- </section>
2536
2466
</section>
2537
2467
2538
2468
<section class="informative"><h2>Base IRI</h2>
@@ -2625,6 +2555,76 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
2625
2555
external contexts.</p>
2626
2556
</section>
2627
2557
2558
+ <section id="document-relative-vocabulary-mapping" class="changed">
2559
+ <h3>Using the Document Base for the Default Vocabulary</h3>
2560
+ <p>In some cases, vocabulary terms are defined directly within the document
2561
+ itself, rather than in an external vocabulary.
2562
+ Since <code>json-ld-1.1</code>, the <a>vocabulary mapping</a> in a <a>local context</a>
2563
+ can be set to a <a>relative IRI</a>,
2564
+ which is, if there is no vocabulary mapping in scope, resolved against the <a>base IRI</a>.
2565
+ This causes terms which are expanded relative to the vocabulary,
2566
+ such as the keys of <a>node objects</a>,
2567
+ to be based on the <a>base IRI</a> to create <a>absolute IRIs</a>.</p>
2568
+
2569
+ <pre class="example input nohighlight" data-transform="updateExample"
2570
+ title="Using "#" as the vocabulary mapping"
2571
+ data-base="http://example/document">
2572
+ <!--
2573
+ {
2574
+ "@context": {
2575
+ ****"@version": 1.1,****
2576
+ ****"@base": "http://example/document",****
2577
+ "@vocab": ****"#"****
2578
+ },
2579
+ "@id": "http://example.org/places#BrewEats",
2580
+ "@type": ****"Restaurant"****,
2581
+ ****"name"****: "Brew Eats"
2582
+ ####...####
2583
+ }
2584
+ -->
2585
+ </pre>
2586
+
2587
+ <p>If this document were located at <code>http://example/document</code>, it would expand as follows:</p>
2588
+
2589
+ <aside class="example ds-selector-tabs"
2590
+ title="Using "#" as the vocabulary mapping (expanded)">
2591
+ <div class="selectors">
2592
+ <button class="selected" data-selects="expanded">Expanded (Result)</button>
2593
+ <button data-selects="statements">Statements</button>
2594
+ <button data-selects="turtle">Turtle</button>
2595
+ <a class="playground" target="_blank"></a>
2596
+ </div>
2597
+ <pre class="expanded result selected nohighlight" data-transform="updateExample">
2598
+ <!--
2599
+ [{
2600
+ "@id": "http://example.org/places#BrewEats",
2601
+ "@type": ["http://example/document#Restaurant"],
2602
+ "http://example/document#name": [{"@value": "Brew Eats"}]
2603
+ }]
2604
+ -->
2605
+ </pre>
2606
+ <table class="statements"
2607
+ data-result-for="Using "#" as the vocabulary mapping (expanded)-expanded"
2608
+ data-to-rdf>
2609
+ <thead><tr><th>Subject</th><th>Property</th><th>Value</th></tr></thead>
2610
+ <tbody>
2611
+ <tr><td>http://example.org/places#BrewEats</td><td>rdf:type</td><td>http://example/document#Restaurant</td></tr>
2612
+ <tr><td>http://example.org/places#BrewEats</td><td>http://example/document#name</td><td>Brew Eats</td></tr>
2613
+ </tbody>
2614
+ </table>
2615
+ <pre class="turtle"
2616
+ data-content-type="text/turtle"
2617
+ data-result-for="Using "#" as the vocabulary mapping (expanded)-expanded"
2618
+ data-transform="updateExample"
2619
+ data-to-rdf>
2620
+ <!--
2621
+ <http://example.org/places#BrewEats> a <http://example/document#Restaurant>;
2622
+ <http://example/document#name> "Brew Eats" .
2623
+ -->
2624
+ </pre>
2625
+ </aside>
2626
+ </section>
2627
+
2628
2628
<section class="informative"><h2>Compact IRIs</h2>
2629
2629
2630
2630
<p>A <a>compact IRI</a> is a way of expressing an <a>IRI</a>
0 commit comments