Skip to content

Commit 6dcfd6b

Browse files
committed
Notes about normalizing language tags, issuing warnings when not well-formed, and not considering case when using for term selection.
1 parent b2f5983 commit 6dcfd6b

File tree

1 file changed

+57
-25
lines changed

1 file changed

+57
-25
lines changed

index.html

Lines changed: 57 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,10 @@ <h3>Algorithm</h3>
12751275
If it is not a <a>string</a>, an
12761276
<a data-link-for="JsonLdErrorCode">invalid default language</a>
12771277
error has been detected and processing is aborted.
1278-
<span class="changed note">Processors MAY normalize <a>language tags</a> to lowercase.</span>
1278+
<span class="changed">If <var>value</var> is not a <a>well-formed</a> according to
1279+
<a data-cite="BCP47#section-2.2.9">section 2.2.9</a> of [[BCP47]],
1280+
processors SHOULD issue a warning.</span>
1281+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span>
12791282
</li>
12801283
</ol>
12811284
</li>
@@ -1633,11 +1636,14 @@ <h3>Algorithm</h3>
16331636
<ol>
16341637
<li>Initialize <var>language</var> to the value associated with the
16351638
<code>@language</code> <a>entry</a>, which MUST be either <code>null</code>
1636-
or a <a>string</a>. Otherwise, an
1637-
<a data-link-for="JsonLdErrorCode">invalid language mapping</a>
1639+
or a <a>string</a>.
1640+
<span class="changed">If <var>language</var> is not a <a>well-formed</a> according to
1641+
<a data-cite="BCP47#section-2.2.9">section 2.2.9</a> of [[BCP47]],
1642+
processors SHOULD issue a warning.</span>
1643+
Otherwise, an <a data-link-for="JsonLdErrorCode">invalid language mapping</a>
16381644
error has been detected and processing is aborted.</li>
16391645
<li>Set the <a>language mapping</a> of <var>definition</var> to <var>language</var>.
1640-
<span class="changed note">Processors MAY normalize <a>language tags</a> to lowercase.</span>
1646+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span>
16411647
</li>
16421648
</ol>
16431649
</li>
@@ -2138,13 +2144,16 @@ <h3>Algorithm</h3>
21382144
<var>value</var> is not a <a>string</a>, an
21392145
<a data-link-for="JsonLdErrorCode">invalid language-tagged string</a>
21402146
error has been detected and processing is aborted.
2147+
<span class="changed">If <var>value</var> is not a <a>well-formed</a> according to
2148+
<a data-cite="BCP47#section-2.2.9">section 2.2.9</a> of [[BCP47]],
2149+
processors SHOULD issue a warning.</span>
21412150
<span class="changed">
21422151
Otherwise, set <var>expanded value</var> to <var>value</var>.
21432152
When the {{JsonLdOptions/frameExpansion}} flag is set, <var>value</var>
21442153
may also be an empty <a>map</a> or an array of zero or
21452154
<a>strings</a>. <var>expanded value</var> will be an
21462155
<a>array</a> of one or more <a>string</a> values.</span>
2147-
<span class="changed note">Processors MAY normalize <a>language tags</a> to lowercase.</span>
2156+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span>
21482157
</li>
21492158
<li class="changed">If <var>expanded property</var> is <code>@direction</code> and
21502159
<var>value</var> is neither `"ltr"` nor `"rtl"`, an
@@ -2284,7 +2293,10 @@ <h3>Algorithm</h3>
22842293
consisting of two
22852294
key-value pairs: (<code>@value</code>-<var>item</var>)
22862295
and (<code>@language</code>-<var>language</var>).
2287-
<span class="changed note">Processors MAY normalize <a>language tags</a> to lowercase.</span>
2296+
<span class="changed">If <var>item</var> is neither `@none` nor a <a>well-formed</a> according to
2297+
<a data-cite="BCP47#section-2.2.9">section 2.2.9</a> of [[BCP47]],
2298+
processors SHOULD issue a warning.</span>
2299+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span>
22882300
</li>
22892301
<li class="changed">If <var>language</var> is <code>@none</code>,
22902302
or expands to <code>@none</code>, remove <code>@language</code> from <var>v</var>.</li>
@@ -3323,6 +3335,11 @@ <h3>Overview</h3>
33233335
to choosing more generic <a>terms</a> when a more
33243336
specifically-matching <a>term</a> is not available for a particular
33253337
<a>IRI</a> and value combination.</p>
3338+
3339+
<p class="changed">Although normalizing <a>language tags</a> is optional,
3340+
the <a>inverse context</a> creates entries based on normalized
3341+
<a>language tags</a>, so that the proper term can be selected
3342+
regardless of representation.</p>
33263343
</section>
33273344

33283345
<section class="algorithm">
@@ -3335,7 +3352,8 @@ <h3>Algorithm</h3>
33353352
<li>Initialize <var>result</var> to an empty <a class="changed">map</a>.</li>
33363353
<li>Initialize <var>default language</var> to <code>@none</code>.
33373354
If the <var>active context</var> has a <a>default language</a>,
3338-
set <var>default language</var> to the <a>default language</a> from the <a>active context</a>.</li>
3355+
set <var>default language</var> to the <a>default language</a> from the <a>active context</a>
3356+
<span class="changed">normalized to lower case</span>.</li>
33393357
<li>For each key <a>term</a> and value <a>term definition</a> in
33403358
the <var>active context</var>, ordered by shortest <a>term</a>
33413359
first (breaking ties by choosing the lexicographically least
@@ -3412,9 +3430,11 @@ <h3>Algorithm</h3>
34123430
<li>If neither the <a>language mapping</a> nor the <a>direction mapping</a>
34133431
are `null`, set <var>lang dir</var> to the concatenation
34143432
of <a>language mapping</a> and <a>direction mapping</a>
3415-
separated by an underscore (`"_"`).</li>
3433+
separated by an underscore (`"_"`)
3434+
normalized to lower case.</li>
34163435
<li>Otherwise, if <a>language mapping</a> is not `null`,
3417-
set <var>lang dir</var> to the <a>language mapping</a>.
3436+
set <var>lang dir</var> to the <a>language mapping</a>,
3437+
normalized to lower case.
34183438
<li>Otherwise, if <a>direction mapping</a> is not `null`,
34193439
set <var>lang dir</var> to <a>direction mapping</a>
34203440
preceded by an underscore (`"_"`).</li>
@@ -3428,7 +3448,8 @@ <h3>Algorithm</h3>
34283448
<ol>
34293449
<li>If the <a>language mapping</a> equals <code>null</code>,
34303450
set <var>language</var> to <code>@null</code>; otherwise set it
3431-
to the <a>language mapping</a>.</li>
3451+
to the <a>language mapping</a>,
3452+
<span class="changed">normalized to lower case</span>.</li>
34323453
<li>If <var>language map</var> does not have a <var>language</var> <a>entry</a>,
34333454
create one and set its value to the <a>term</a>
34343455
being processed.</li>
@@ -3450,7 +3471,8 @@ <h3>Algorithm</h3>
34503471
<ol>
34513472
<li>Initialize a variable <var>lang dir</var>
34523473
with the concatenation of <a>default language</a> and <a>default base direction</a>,
3453-
separate by an underscore (`"_"`).</li>
3474+
separate by an underscore (`"_"`),
3475+
normalized to lower case.</li>
34543476
<li>If <var>language map</var> does not have a <var>lang dir</var> <a>entry</a>,
34553477
create one and set its value to the <a>term</a>
34563478
being processed.</li>
@@ -3464,8 +3486,9 @@ <h3>Algorithm</h3>
34643486
</li>
34653487
<li>Otherwise:
34663488
<ol>
3467-
<li>If <var>language map</var> does not have a <var>default language</var>
3468-
<a>entry</a>, create one and set its value to the <a>term</a>
3489+
<li>If <var>language map</var> does not have a <var>default language</var> <a>entry</a>
3490+
<span class="changed">(after being normalized to lower case)</span>,
3491+
create one and set its value to the <a>term</a>
34693492
being processed.</li>
34703493
<li>If <var>language map</var> does not have an <code>@none</code>
34713494
<a>entry</a>, create one and set its value to the <a>term</a>
@@ -3529,7 +3552,8 @@ <h3>Overview</h3>
35293552

35303553
<p class="changed">When considering <a>language mapping</a>,
35313554
the <a>direction mapping</a> is also considered, either with, or without,
3532-
a <a>language mapping</a>.</p>
3555+
a <a>language mapping</a>,
3556+
and the <a>language mapping</a> is normalized to lower case.</p>
35333557

35343558
<p class="changed">In the case were this algorithm would return the input <a>IRI</a> as is,
35353559
and that <a>IRI</a> can be mistaken for a <a>compact IRI</a> in the <a>active context</a>,
@@ -3557,14 +3581,17 @@ <h3>Algorithm</h3>
35573581
<ol>
35583582
<li class="changed">Initialize <var>default language</var>
35593583
based on the <a data-lt="active context">active context's</a>
3560-
<a>default language</a> and <a>default base direction</a>:
3584+
<a>default language</a>, normalized to lower case and <a>default base direction</a>:
35613585
<ol>
35623586
<li>If the <a data-lt="active context">active context's</a> <a>default base direction</a>
35633587
is not `null`, to the concatenation of
35643588
the <a data-lt="active context">active context's</a> <a>default language</a>
3565-
and <a>default base direction</a>, separated by an underscore (`"_"`).</li>
3589+
and <a>default base direction</a>, separated by an underscore (`"_"`),
3590+
normalized to lower case.</li>
35663591
<li>Otherwise, to the <a data-lt="active context">active context's</a> <a>default language</a>,
3567-
if it has one, otherwise to `@none`.</li>
3592+
if it has one,
3593+
normalized to lower case,
3594+
otherwise to `@none`.</li>
35683595
</ol>
35693596
</li>
35703597
<li class="changed">If <var>value</var> is a <a>map</a> containing
@@ -3612,10 +3639,11 @@ <h3>Algorithm</h3>
36123639
<li class="changed">If <var>item</var> contains an `@direction` <a>entry</a>,
36133640
then set <var>item language</var> to the concatenation of
36143641
the <var>item</var>'s `@language` entry (if any)
3615-
the <var>item</var>'s `@direction`, separated by an underscore (`"_"`).</li>
3642+
the <var>item</var>'s `@direction`, separated by an underscore (`"_"`),
3643+
normalized to lower case.</li>
36163644
<li>Otherwise, if <var>item</var> contains an <code>@language</code> <a>entry</a>,
3617-
then set <var>item language</var> to its associated
3618-
value.</li>
3645+
then set <var>item language</var> to its associated value,
3646+
normalized to lower case.</li>
36193647
<li>Otherwise, if <var>item</var> contains a
36203648
<code>@type</code> <a>entry</a>, set <var>item type</var> to its
36213649
associated value.</li>
@@ -3687,13 +3715,15 @@ <h3>Algorithm</h3>
36873715
and does not contain an `@index` <a>entry</a>,
36883716
then set <var>type/language value</var> to the concatenation of
36893717
the <var>value</var>'s `@language` entry (if any)
3690-
the <var>value</var>'s `@direction`, separated by an underscore (`"_"`).
3718+
the <var>value</var>'s `@direction`, separated by an underscore (`"_"`),
3719+
normalized to lower case.
36913720
Append `@language` and `@language@set` to
36923721
<var>containers</var>.</li>
36933722
<li>Otherwise, if <var>value</var> contains an <code>@language</code> <a>entry</a>
36943723
and does not contain an <code>@index</code> <a>entry</a>,
36953724
then set <var>type/language value</var> to its associated
3696-
value and, append <code>@language</code>
3725+
value and, append <code>@language</code>,
3726+
normalized to lower case,
36973727
<span class="changed">and <code>@language@set</code></span> to
36983728
<var>containers</var>.</li>
36993729
<li>Otherwise, if <var>value</var> contains a
@@ -4809,6 +4839,7 @@ <h3>Algorithm</h3>
48094839
set <var>datatype</var> to the result of appending <var>language</var>
48104840
and the value of `@direction` in <var>item</var> separated by an underscore (`"_"`)
48114841
to `https://www.w3.org/ns/i18n#`.
4842+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span>
48124843
Initialize <var>literal</var> as an <a>RDF literal</a> using
48134844
<var>value</var> and <var>datatype</var>.
48144845
<div class="note">As `@direction` may be used without `@language`,
@@ -4823,7 +4854,8 @@ <h3>Algorithm</h3>
48234854
<li>If the <var>item</var> has an entry for `@language`,
48244855
create a new triple using <var>literal</var> as the subject,
48254856
`rdf:language` as the predicate, and the value of `@language` in <var>item</var>
4826-
as the object, and add it to <var>list triples</var>.</li>
4857+
as the object, and add it to <var>list triples</var>.
4858+
<span class="changed note">Processors MAY normalize <a>language tags</a> to lower case.</span></li>
48274859
<li>Create a new triple using <var>literal</var> as the subject,
48284860
`rdf:direction` as the predicate, and the value of `@direction` in <var>item</var>
48294861
as the object, and add it to <var>list triples</var>.</li>
@@ -5373,7 +5405,7 @@ <h2>Data Round Tripping</h2>
53735405
<li>Native Numeric values SHOULD be serialized according to
53745406
<a data-cite="?ECMASCRIPT#sec-tostring-applied-to-the-number-type">Section 7.1.12.1</a> of [[?ECMASCRIPT]],</li>
53755407
<li>Strings SHOULD be serialized with Unicode codepoints from <code>U+0000</code> through <code>U+001F</code>
5376-
using lowercase hexadecimal Unicode notation (<code>\uhhhh</code>) unless in the set
5408+
using lower case hexadecimal Unicode notation (<code>\uhhhh</code>) unless in the set
53775409
of predefined JSON control characters <code>U+0008</code>, <code>U+0009</code>,
53785410
<code>U+000A</code>, <code>U+000C</code> or <code>U+000D</code>
53795411
which SHOULD be serialized as <code>\b</code>, <code>\t</code>, <code>\n</code>, <code>\f</code> and <code>\r</code> respectively.
@@ -6668,7 +6700,7 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
66686700
to that content.</li>
66696701
<li><a>Value objects</a>, and associated <a>context</a> and <a>term definitions</a> have been updated to
66706702
support `@direction` for setting the <a>base direction</a> of strings.</li>
6671-
<li>It is no longer required that language tags be normalized to lowercase,
6703+
<li>It is no longer required that language tags be normalized to lower case,
66726704
other than for testing considerations.
66736705
Language tags that are not valid according to [[BCP47]] are rejected.</li>
66746706
</ul>

0 commit comments

Comments
 (0)