Ensure that only strings are language-tagged
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 14 Mar 2013 15:15:41 +0100
changeset 1444 3ad414f94c0c
parent 1443 b64fc094df37
child 1445 7dedc56c2039
Ensure that only strings are language-tagged

This addresses #218.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Thu Mar 14 14:59:57 2013 +0100
+++ b/spec/latest/json-ld-api/index.html	Thu Mar 14 15:15:41 2013 +0100
@@ -1525,7 +1525,7 @@
                   error has been detected.</li>
                 <li>If <i>expanded property</i> is <code>@language</code> then
                   <i>value</i> must be a <tref>string</tref>, otherwise an
-                  <code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-language-tagged-string">invalid language tagged string</a></code>
+                  <code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-language-tagged-string">invalid language-tagged string</a></code>
                   error has been detected. Set <i>expanded value</i> to lowercased
                   <i>value</i>.</li>
                 <li>If <i>expanded property</i> is <code>@index</code>
@@ -1718,10 +1718,11 @@
               error has been detected.</li>
             <li>If the value of <i>result</i>'s <code>@value</code> key is
               <tref>null</tref>, then set <i>result</i> to <tref>null</tref>.</li>
-            <li>Otherwise, if <i>result</i> contains the key
-              <code>@language</code> and the value of <i>result</i>'s
-              <code>@value</code> key is not a <tref>string</tref>, then remove
-              the <code>@language</code> key from <i>result</i>.</li>
+            <li>Otherwise, if the value of <i>result</i>'s <code>@value</code> member
+              is not a <tref>string</tref> and <i>result</i> contains the key
+              <code>@language</code>, a
+              <code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-language-tagged-value">invalid language-tagged value</a></code>
+              error has been detected (only <tref title="string">strings</tref> can be language-tagged).</li>
           </ol>
         </li>
         <li>Otherwise, if <i>result</i> contains the key <code>@type</code>
@@ -3938,9 +3939,12 @@
         <dd>An invalid value for the <code>@value</code> member of a
           <tref>value object</tref> has been detected, i.e., it is neither
           a <tref>scalar</tref> nor <tref>null</tref>.</dd>
-        <dt>invalid language tagged string</dt>
+        <dt>invalid language-tagged string</dt>
         <dd>A <tref>language-tagged string</tref> with an invalid language
           value was detected.</dd>
+        <dt>invalid language-tagged value</dt>
+        <dd>A <tref>number</tref>, <tref>true</tref>, or <tref>false</tref> with an
+          associated language tag was detected.</dd>
         <dt>invalid set or list object</dt>
         <dd>A <tref>set object</tref> or <tref>list object</tref> with
           disallowed members has been detected.</dd>