@@ -1184,7 +1184,7 @@ <h2>String Internationalization</h2>
1184
1184
< h2 > JSON-LD Syntax</ h2 >
1185
1185
1186
1186
< p > A JSON-LD document is first, and foremost, a JSON document
1187
- (as defined in [[!RFC5988 ]]), and any syntactically correct JSON document
1187
+ (as defined in [[!RFC4627 ]]), and any syntactically correct JSON document
1188
1188
MUST be processed by a conforming JSON-LD processor. However, JSON-LD
1189
1189
describes a specific syntax to use for expressing Linked Data. This
1190
1190
includes the use of specific keywords, as identified in < a
@@ -1400,7 +1400,7 @@ <h2>Language Values</h2>
1400
1400
< tdef > language value</ tdef > , is indicated by associating a value with
1401
1401
an < tref > string</ tref > having the lexical from defined in [[!BCP47]]
1402
1402
which indicates the value's language. Language values may be
1403
- expressed in JSON-LD in three ways:
1403
+ expressed in JSON-LD in four ways:
1404
1404
</ p >
1405
1405
1406
1406
< ol >
@@ -1409,6 +1409,10 @@ <h2>Language Values</h2>
1409
1409
< li > By utilizing the < code > @language</ code > < tref > keyword</ tref > when defining
1410
1410
a < tref > term</ tref > within a < code > @context</ code > section.</ li >
1411
1411
< li > By utilizing the expanded form for specifying objects.</ li >
1412
+ < li > By utilizing the < code > @container</ code > < tref > keyword</ tref > with a
1413
+ value of < code > @language</ code > when defining a < tref > term</ tref > within
1414
+ a < code > @context</ code > section. This usage pattern is called a
1415
+ < tdef > language map</ tdef > .</ li >
1412
1416
</ ol >
1413
1417
1414
1418
< p > The first example uses the < code > @language</ code > keyword to associate a
@@ -1452,9 +1456,9 @@ <h2>Language Values</h2>
1452
1456
}
1453
1457
},
1454
1458
...
1455
- "modified ":
1459
+ "title ":
1456
1460
****{
1457
- "@value": "JSON-LD",
1461
+ "@value": "JSON-LD Syntax ",
1458
1462
"@language": "en"
1459
1463
}****
1460
1464
...
@@ -1463,7 +1467,45 @@ <h2>Language Values</h2>
1463
1467
</ pre >
1464
1468
1465
1469
< p > Both examples above would generate an object with the value of
1466
- < code > JSON-LD</ code > and the language of "English".</ p >
1470
+ < code > JSON-LD Syntax</ code > and the language of < code > en</ code > , which is the
1471
+ [[!BCP47]] code for the English language.</ p >
1472
+
1473
+ < p > Systems that support multiple languages often need to express data values in
1474
+ each language. Typically, such systems also try to ensure that developers have
1475
+ a programatically easy way to navigate the datastructures for the
1476
+ language-specific data. In this case, < tref > language map</ tref > s
1477
+ may be utilized.</ p >
1478
+
1479
+ < pre class ="example " data-transform ="updateExample "
1480
+ title ="Language map expressing a property in three languages ">
1481
+ <!--
1482
+ {
1483
+ "@context":
1484
+ {
1485
+ "title":
1486
+ {
1487
+ "@id": "http://purl.org/dc/terms/title"
1488
+ "@container": "@language"
1489
+ }
1490
+ },
1491
+ ...
1492
+ "title":
1493
+ ****{
1494
+ "en": "JSON-LD Syntax",
1495
+ "ru": "JSON-LD Синтаксис",
1496
+ "ja": "JSON-LDの構文"
1497
+ }****
1498
+ ...
1499
+ }
1500
+ -->
1501
+ </ pre >
1502
+
1503
+ < p > In the example above, the title is expressed in three languages; English,
1504
+ Russian, and Japanese. To access the data above in a programming language
1505
+ supporting dot-notation accessors for object properties, a developer may use the
1506
+ < strong > PROPERTY</ strong > .< strong > LANGUAGE</ strong > pattern. For example, to
1507
+ access the Japanese version of the title, a developer would use the following
1508
+ code snippet: < code > obj.title.ja</ code > .</ p >
1467
1509
1468
1510
</ section >
1469
1511
@@ -2784,7 +2826,10 @@ <h2>Context Definition</h2>
2784
2826
< p > If the < tref > expanded term definition</ tref > contains the < code > @language</ code > < tref > keyword</ tref > ,
2785
2827
the value MUST have the lexical form described in [[!BCP47]] or be < tref > null</ tref > .</ p >
2786
2828
< p > If the < tref > expanded term definition</ tref > contains the < code > @container</ code > < tref > keyword</ tref > ,
2787
- the value MUST be either < code > @list</ code > , < code > @set</ code > or be < tref > null</ tref > .</ p >
2829
+ the value MUST be either < code > @list</ code > , < code > @set</ code > , < code > @language</ code > , or be < tref > null</ tref > .
2830
+ If the value is < code > @language</ code > , when the < tref > term</ tref > is used outside of the < code > @context</ code > , the
2831
+ associated value MUST be a < tref > JSON object</ tref > whose keys are < tref > string</ tref > s that are [[BCP47]] language identifiers.
2832
+ The values associated with each [[BCP47]] language string MUST be a < tref > string</ tref > or an < tref > array</ tref > of < tref > string</ tref > s.</ p >
2788
2833
< p > See < a href ="#the-context "> </ a > and < a href ="#expanded-term-definition "> </ a >
2789
2834
for a further discussion of contexts.</ p >
2790
2835
</ section >
0 commit comments