@@ -2583,6 +2583,60 @@ <h2>Data Indexing</h2>
2583
2583
</ table >
2584
2584
</ section >
2585
2585
2586
+ < section class ="informative changed ">
2587
+ < h2 > Node Identifier Indexing</ h2 >
2588
+
2589
+ < p > In addition to index maps, JSON-LD introduces the notion of < a > id maps</ a >
2590
+ for structuring data. The id indexing feature allows an author to
2591
+ structure data using a simple key-value map where the keys map
2592
+ to < a > IRIs</ a > . This enables direct access to associated node objects
2593
+ instead of having to scan an array in search of a specific item.
2594
+ In JSON-LD such data can be specified by associating the
2595
+ < code > @id</ code > < a > keyword</ a > with a
2596
+ < code > @container</ code > declaration in the context:</ p >
2597
+
2598
+ < pre class ="example " data-transform ="updateExample "
2599
+ title ="Indexing data in JSON-LD by node identifiers ">
2600
+ <!--
2601
+ {
2602
+ "@context":
2603
+ {
2604
+ "schema": "http://schema.org/",
2605
+ "name": "schema:name",
2606
+ "body": "schema:articleBody",
2607
+ "words": "schema:wordCount",
2608
+ "post": {
2609
+ "@id": "schema:blogPost",
2610
+ ****"@container": "@id"****
2611
+ }
2612
+ },
2613
+ "@id": "http://example.com/",
2614
+ "@type": "schema:Blog",
2615
+ "name": "World Financial News",
2616
+ ****"post": {
2617
+ "http://example.com/posts/1/en": {
2618
+ "body": "World commodities were up today with heavy trading of crude oil...",
2619
+ "words": 1539
2620
+ },
2621
+ "http://example.com/posts/1/de": {
2622
+ "body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...",
2623
+ "words": 1204
2624
+ }****
2625
+ }
2626
+ }
2627
+ -->
2628
+ </ pre >
2629
+
2630
+ < p > In the example above, the < strong > post</ strong > < a > term</ a > has
2631
+ been marked as an < a > id map</ a > . The < strong > http://example.com/posts/1/en</ strong > and
2632
+ < strong > http://example.com/posts/1/de</ strong > keys will be interpreted
2633
+ as the < code > @id</ code > property of the < a > node object</ a > value.</ p >
2634
+
2635
+ < p > The interpretation of the data above is exactly the same
2636
+ as that in < a class ="sectionRef " href ="#data-indexing "> </ a >
2637
+ using a JSON-LD processor:</ p >
2638
+ </ section >
2639
+
2586
2640
< section class ="informative ">
2587
2641
< h3 > Expanded Document Form</ h3 >
2588
2642
@@ -3186,6 +3240,20 @@ <h2>Index Maps</h2>
3186
3240
< p > See < a class ="sectionRef " href ="#data-indexing "> </ a > for further information on this topic.</ p >
3187
3241
</ section >
3188
3242
3243
+ < section class ="changed ">
3244
+ < h2 > Id Maps</ h2 >
3245
+
3246
+ < p > An < a > id map</ a > is used to associate an < a > IRI</ a > with a value that allows easy
3247
+ programatic access. An < a > id map</ a > may be used as a term value within a < a > node object</ a > if the < a > term</ a >
3248
+ is defined with < code > @container</ code > set to < code > @id</ code > . The keys of an < a > id map</ a > MUST be < a > IRIs</ a >
3249
+ (< a > relative IRI</ a > , < a > compact IRI</ a > (including < a > blank node identifiers</ a > ), or < a > absolute IRI</ a > )
3250
+ and the values MUST be < a > node objects</ a > .</ p >
3251
+
3252
+ < p > If the value contains a property expanding to < code > @id</ code > , it's value MUST
3253
+ be equivalent to the referencing key. Otherwise, the key is used as
3254
+ the < code > @id</ code > of the < a > node object</ a > value when expanding.</ p >
3255
+ </ section >
3256
+
3189
3257
< section class ="normative ">
3190
3258
< h2 > Context Definitions</ h2 >
3191
3259
0 commit comments