Change list coercion to the "@container" syntax
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sun, 18 Mar 2012 19:54:34 +0800
changeset 384 4ec1ec4fdb36
parent 383 a91a7a5122dc
child 385 4253aa71a670
Change list coercion to the "@container" syntax

Updated the specification to use the `"@container": "@list"` syntax.

This closes #60.
spec/latest/json-ld-api/index.html
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-api/index.html	Sun Mar 18 19:31:50 2012 +0800
+++ b/spec/latest/json-ld-api/index.html	Sun Mar 18 19:54:34 2012 +0800
@@ -710,6 +710,8 @@
   <dt><code>@language</code></dt><dd>Used to specify the language for a literal.</dd>
   <dt><code>@type</code></dt><dd>Used to set the type of the active subject or the datatype of a literal.</dd>
   <dt><code>@value</code></dt><dd>Used to specify the value of a literal.</dd>
+  <dt><code>@container</code></dt><dd>Used to set the container of a particular value.</dd>
+  <dt><code>@list</code></dt><dd>Used to express an ordered set of data.</dd>
   <dt><code>:</code></dt><dd>The separator for JSON keys and values that use <tref title="compact_iri">compact IRIs</tref>.</dd>
   </dl>
 
@@ -865,8 +867,8 @@
                       performing <a href="#iri-expansion">IRI Expansion</a> on the associated value. If the result of the
                       IRI mapping is an <tref>absolute IRI</tref> or <code>@id</code>, merge into the <tref>local context</tref>
                       <tref>coercion mapping</tref>.</li>
-                    <li>If the value has a <code>@list</code> key, the value MUST be
-                      <code>true</code> or <code>false</code>. Merge into the <tref>local context</tref> <tref>list
+                    <li>If the value has a <code>@container</code> key, the value MUST be
+                      <code>@list</code>. Merge into the <tref>local context</tref> <tref>list
                       mapping</tref>.</li>
                   </ol>
                 </li>
@@ -1617,7 +1619,7 @@
             the a <tref>JSON object</tref> having a key/value pair of <code>@list</code> and an
             <tref>array</tref> containing <em>object representation</em>.</li>
           <li>Otherwise, the last key/value entry in <em>value</em> MUST be a <tref>JSON object</tref>
-            having a single key of <em>@list</em> with a value that is an <tref>array</tref>.
+            having a single key of <code>@list</code> with a value that is an <tref>array</tref>.
             Append <em>object representation</em>.</li>
         </ol>
       </li>
--- a/spec/latest/json-ld-syntax/index.html	Sun Mar 18 19:31:50 2012 +0800
+++ b/spec/latest/json-ld-syntax/index.html	Sun Mar 18 19:54:34 2012 +0800
@@ -400,36 +400,37 @@
   <dl>
   <dt><code>@context</code></dt>
   <dd>Used to define the short-hand names that are used throughout a JSON-LD
-  document. These short-hand names are called <tref>term</tref>s and help
-  developers express specific identifiers in a compact manner. The
-  <code>@context</code> keyword is described in detail in the section titled
-  <a href="#the-context">The Context</a>.</dd>
+    document. These short-hand names are called <tref>term</tref>s and help
+    developers express specific identifiers in a compact manner. The
+    <code>@context</code> keyword is described in detail in the section titled
+    <a href="#the-context">The Context</a>.</dd>
   <dt><code>@id</code></dt>
   <dd>Used to uniquely identify things that are being described in the document.
-  This keyword is described in the section titled
-  <a href="#identifying-the-subject">Identifying the Subject</a>.</dd>
+    This keyword is described in the section titled
+    <a href="#identifying-the-subject">Identifying the Subject</a>.</dd>
   <dt><code>@value</code></dt>
   <dd>Used to specify the data that is associated with a particular
-  <tref>property</tref> in the graph. This keyword is described
-  in the sections titled
-  <a href="#string-internationalization">String Internationalization</a> and
-  <a href="#typed-values">Typed Values</a>.</dd>
+    <tref>property</tref> in the graph. This keyword is described
+    in the sections titled
+    <a href="#string-internationalization">String Internationalization</a> and
+    <a href="#typed-values">Typed Values</a>.</dd>
   <dt><code>@language</code></dt>
   <dd>Used to specify the native language for a particular value.
-  This keyword is described in the section titled
-  <a href="#string-internationalization">String Internationalization</a>.</dd>
+    This keyword is described in the section titled
+    <a href="#string-internationalization">String Internationalization</a>.</dd>
   <dt><code>@type</code></dt>
   <dd>Used to set the data type of a <tref>subject</tref> or
-  <tref>typed value</tref>.
-  This keyword is described in the section titled
-  <a href="#typed-values">Typed Values</a>.</dd>
+    <tref>typed value</tref>. This keyword is described in the section titled
+    <a href="#typed-values">Typed Values</a>.</dd>
+  <dt><code>@container</code></dt>
+  <dd>Used to set the container of a particular value.
+    This keyword is described in the section titled <a href="#lists">Lists</a>.</dd>
   <dt><code>@list</code></dt>
   <dd>Used to express an ordered set of data.
-  This keyword is described in the section titled
-  <a href="#lists">Lists</a>.</dd>
+    This keyword is described in the section titled <a href="#lists">Lists</a>.</dd>
   <dt><code>:</code></dt>
   <dd>The separator for JSON keys and values that use
-  <tref title="compact_iri">compact IRIs</tref>.</dd>
+    <tref title="compact_iri">compact IRIs</tref>.</dd>
   </dl>
 
   <p>For the avoidance of doubt, all keys, keywords and values in JSON-LD are
@@ -570,7 +571,7 @@
   page, API or database in which it resides. The value of a term mapping
   MUST be either; 1) a simple string with the lexical form of an absolute
   <tref>IRI</tref> or, 2) an <tref>JSON object</tref> containing an
-  <code>@id</code>, <code>@type</code>, or <code>@list</code> keyword.
+  <code>@id</code>, <code>@type</code>, <code>@language</code>, or <code>@container</code> keyword.
 </p>
 
 <p>These Linked Data <tref>term</tref>s are typically collected in a
@@ -1244,8 +1245,8 @@
     This describes the use of this <tref>array</tref> as being ordered,
     and order is maintained through alternate representations as
     described in [[JSON-LD-API]]. If every use of a given multi-valued property
-    is a list, this may be abbreviated by adding a
-    <code>@type</code> <tref>coercion</tref>:
+    is a list, this may be abbreviated by setting <code>@container</code> to
+    <code>@list</code> in the <tref>context</tref>:
   </p>
   <pre class="example" data-transform="updateExample">
   <!--
@@ -1256,7 +1257,7 @@
       "nick":
       {
         "@id": "http://xmlns.com/foaf/0.1/nick",
-        "@list": true
+        "@container": "@list"
       }
     }****,
   ...
@@ -1266,11 +1267,13 @@
   }
   -->
   </pre>
-  <p>List coercion is specified within an expanded <tref>term</tref> definition using the <code>@list</code> key.
-    The value of this key, if present, MUST be <code>true</code>.
-    This indicates that array values of keys coerced as <code>@list</code> are to be serialized
-    as a <a href="#lists">List</a>.</p>
-  <p class="note">List of lists are not allowed in this version of JSON-LD. If a list of lists is detected, a JSON-LD processor will throw an exception.</p>
+  <p>List coercion is specified within an expanded <tref>term</tref>
+    definition using the <code>@container</code> key. The value of this key,
+    if present, MUST be <code>@list</code>. This indicates that array values
+    of keys coerced as <code>@list</code> are to be serialized as a
+    <a href="#lists">List</a>.</p>
+  <p class="note">List of lists are not allowed in this version of JSON-LD.
+    If a list of lists is detected, a JSON-LD processor will throw an exception.</p>
 </section>
 
 </section>
@@ -1802,7 +1805,8 @@
     "homepage":
     ****{
       "@id": "http://xmlns.com/foaf/0.1/homepage",
-      "@type": "@id", "@list": true
+      "@type": "@id",
+      "@container": "@list"
     }****
   },
   "name": "John Smith",