@@ -2488,6 +2488,60 @@ <h2>Data Indexing</h2>
24882488 </ table >
24892489</ section >
24902490
2491+ < section class ="informative ">
2492+ < h2 > Node Identifier Indexing</ h2 >
2493+
2494+ < p > In addition to index maps, JSON-LD introduces the notion of < a > id maps</ a >
2495+ for structuring data. The id indexing feature allows an author to
2496+ structure data using a simple key-value map where the keys map
2497+ to < a > IRIs</ a > . This enables direct access to associated node objects
2498+ instead of having to scan an array in search of a specific item.
2499+ In JSON-LD such data can be specified by associating the
2500+ < code > @id</ code > < a > keyword</ a > with a
2501+ < code > @container</ code > declaration in the context:</ p >
2502+
2503+ < pre class ="example " data-transform ="updateExample "
2504+ title ="Indexing data in JSON-LD by node identifiers ">
2505+ <!--
2506+ {
2507+ "@context":
2508+ {
2509+ "schema": "http://schema.org/",
2510+ "name": "schema:name",
2511+ "body": "schema:articleBody",
2512+ "words": "schema:wordCount",
2513+ "post": {
2514+ "@id": "schema:blogPost",
2515+ ****"@container": "@id"****
2516+ }
2517+ },
2518+ "@id": "http://example.com/",
2519+ "@type": "schema:Blog",
2520+ "name": "World Financial News",
2521+ ****"post": {
2522+ "http://example.com/posts/1/en": {
2523+ "body": "World commodities were up today with heavy trading of crude oil...",
2524+ "words": 1539
2525+ },
2526+ "http://example.com/posts/1/de": {
2527+ "body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...",
2528+ "words": 1204
2529+ }****
2530+ }
2531+ }
2532+ -->
2533+ </ pre >
2534+
2535+ < p > In the example above, the < strong > post</ strong > < a > term</ a > has
2536+ been marked as an < a > id map</ a > . The < strong > http://example.com/posts/1/en</ strong > and
2537+ < strong > http://example.com/posts/1/de</ strong > keys will be interpreted
2538+ as the < code > @id</ code > property of the < a > node object</ a > value.</ p >
2539+
2540+ < p > The interpretation of the data above is exactly the same
2541+ as that in < a class ="sectionRef " href ="#data-indexing "> </ a >
2542+ using a JSON-LD processor:</ p >
2543+ </ section >
2544+
24912545< section class ="informative ">
24922546 < h3 > Expanded Document Form</ h3 >
24932547
@@ -3091,6 +3145,20 @@ <h2>Index Maps</h2>
30913145 < p > See < a class ="sectionRef " href ="#data-indexing "> </ a > for further information on this topic.</ p >
30923146 </ section >
30933147
3148+ < section >
3149+ < h2 > Id Maps</ h2 >
3150+
3151+ < p > An < a > id map</ a > is used to associate an < a > IRI</ a > with a value that allows easy
3152+ 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 >
3153+ is defined with < code > @container</ code > set to < code > @id</ code > . The keys of an < a > id map</ a > MUST be < a > IRIs</ a >
3154+ (< a > relative IRI</ a > , < a > compact IRI</ a > (including < a > blank node identifiers</ a > ), or < a > absolute IRI</ a > )
3155+ and the values MUST be < a > node objects</ a > .</ p >
3156+
3157+ < p > If the value contains a property expanding to < code > @id</ code > , it's value MUST
3158+ be equivalent to the referencing key. Otherwise, the key is used as
3159+ the < code > @id</ code > of the < a > node object</ a > value when expanding.</ p >
3160+ </ section >
3161+
30943162< section class ="normative ">
30953163 < h2 > Context Definitions</ h2 >
30963164
0 commit comments