Update Value Compaction to work with containers
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 20 Dec 2012 21:47:38 +0100
changeset 1077 1c3fdf956d5b
parent 1076 bf1a64e0bce2
child 1078 04e261c13940
Update Value Compaction to work with containers

This addresses #171.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Thu Dec 20 21:35:04 2012 +0100
+++ b/spec/latest/json-ld-api/index.html	Thu Dec 20 21:47:38 2012 +0100
@@ -1312,8 +1312,8 @@
               <code>@annotation</code> member of <em>item</em> (depending on the value of the
               <tref title="active property">active property's</tref> <tref>container mapping</tref>).</li>
             <li>First compact <em>item</em> using the <a href="#value-compaction">Value Compaction algorithm</a>
-              then compact it by recursively invoking this algorithm passing a copy of the
-              <tref>active context</tref>, <tref>inverse context</tref>, and the
+              passing <em>index</em> as <em>containerValue</em>, then compact it by recursively invoking this
+              algorithm passing a copy of the <tref>active context</tref>, <tref>inverse context</tref>, and the
               <tref>active property</tref>.</li>
             <li>If no <em>index</em> member exists in the <em>mapObject</em> create one and set its value
               to <em>item</em>; otherwise append <em>item</em> to the <em>index</em> member (converting it to
@@ -1626,9 +1626,13 @@
     is said to be in <tdef>compacted form</tdef>.</p>
 
   <p>This algorithm takes a <em>value</em>, an <tref>active context</tref>, an
-    <tref>inverse context</tref>, and an <tref>active property</tref>.</p>
+    <tref>inverse context</tref>, an <tref>active property</tref>, and an optional
+    <em>containerValue</em>.</p>
 
   <ol class="algorithm">
+    <li>If a <em>containerValue</em> has been passed, the <tref>active property</tref> has a
+      <tref>container mapping</tref> set to <code>@annotation</code> and <em>value</em>
+      has an <code>@annotation</code> member which equals <em>containerValue</em>, remove that member.</li>
     <li>If <em>value</em> is a <tref>JSON object</tref> having a single member <code>@id</code>,
       return the result of performing <a href="#iri-compaction-algorithm">IRI Compaction</a> on that
       member's value.</li>
@@ -1641,6 +1645,10 @@
         <li>Otherwise, if the <tref>active property</tref> has a <tref>language mapping</tref> and
           <em>value</em> has a corresponding <code>@language</code> member, remove the
           <code>@language</code> member from <em>value</em>.</li>
+        <li>Otherwise, if a <em>containerValue</em> has been passed, the <tref>active property</tref>
+          has a <tref>container mapping</tref> set to <code>@language</code>, and <em>value</em> has
+          a <code>@language</code> member which equals <em>containerValue</em>, remove the
+          <code>@language</code> member from <em>value</em>.</li>
         <li>Otherwise, if the <tref>active context</tref> has a <tref>default language</tref>
           <ol class="algorithm">
             <li>and the <em>value</em> has a corresponding <code>@language</code> member, remove the