Require that keys in an object are unique
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 13 Mar 2013 19:23:44 +0100
changeset 1436 f4924cfe254b
parent 1435 a73a78cc1fba
child 1437 e6c7d6b764d2
Require that keys in an object are unique

OK, I'll add this. We can easily remove if someone objects

/cc @gkellogg, @dlongley, @niklasl, @msporny
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Wed Mar 13 19:05:21 2013 +0100
+++ b/spec/latest/json-ld-syntax/index.html	Wed Mar 13 19:23:44 2013 +0100
@@ -266,12 +266,11 @@
 
     <dl>
       <dt><tdef>JSON object</tdef></dt><dd>
-        An object structure is represented as a pair of curly brackets
-        surrounding zero or more key-value pairs. A key is a
-        <tref>string</tref>. A single colon comes after each key, separating the
-        key from the value. A single comma separates a value from a following
-        key.
-      </dd>
+        An object structure is represented as a pair of curly brackets surrounding
+        zero or more key-value pairs. A key is a <tref>string</tref>.
+        A single colon comes after each key, separating the key from the value.
+        A single comma separates a value from a following key. In contrast to JSON,
+        in JSON-LD the keys in an object must be unique.</dd>
       <dt><tdef>array</tdef></dt>
       <dd>An array structure is represented as square brackets surrounding zero
         or more values. Values are separated by commas.
@@ -2622,7 +2621,10 @@
 
   <p>A <tref>JSON-LD document</tref> MUST be a single <tref>node object</tref>
     or a JSON <tref>array</tref> containing a set of one or more
-    <tref title="node object">node objects</tref>.</p>
+    <tref title="node object">node objects</tref> at the top level.</p>
+
+  <p>In contrast to JSON, in JSON-LD the keys in <tref title="JSON object">objects</tref>
+    MUST be unique.</p>
 
   <p class="note">JSON-LD allows <tref title="keyword">keywords</tref> to be aliased
     (see <a href="#aliasing-keywords"></a> for details). Whenever a <tref>keyword</tref> is