Merge branch 'master' of github.com:json-ld/json-ld.org
authorDave Longley <dlongley@digitalbazaar.com>
Wed, 23 Nov 2011 19:21:24 -0500
changeset 275 f5bccf11e50e
parent 271 445fd5c6ba7c (current diff)
parent 274 7f3074aeff8b (diff)
child 276 99958980ced0
Merge branch 'master' of github.com:json-ld/json-ld.org
--- a/spec/latest/json-ld-api/index.html	Wed Nov 23 19:21:03 2011 -0500
+++ b/spec/latest/json-ld-api/index.html	Wed Nov 23 19:21:24 2011 -0500
@@ -827,6 +827,7 @@
         <li>
           Otherwise, for each key in <em>value</em> having the lexical form of <cite><a
           href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName">NCName</a></cite> (see [[XML-NAMES]]),
+          or is an empty string,
           it's value MUST have be a simple <tref>string</tref> with the lexical form of absolute IRI. Merge the
           key-value pair into the <tref>local context</tref>.
         </li>
@@ -2683,10 +2684,8 @@
           described in <a href="#context">Context</a>.
         </li>
         <li>
-          Create a new <tref>JSON object</tref> by mapping the keys from the current <tref>JSON object</tref> using the
-          <tref>active context</tref> to new keys using the associated value from the current <tref>JSON object</tref>.
-          Repeat the mapping until no entry is found within the <tref>active context</tref> for the key. Use the new
-          <tref>JSON object</tref> in subsequent steps.
+          Create a copy of the current <tref>JSON object</tref>, changing keys that map to JSON-LD keywords
+          with those keywords. Use the new <tref>JSON object</tref> in subsequent steps.
         </li>
         <li>
           If the <tref>JSON object</tref> has an <code>@iri</code> key, set the <tref>active object</tref> by
@@ -2708,14 +2707,15 @@
               a <code>@language</code> key, use it's value to set the language of the plain literal.
             </li>
             <li>
-              Generate a triple representing the <tref>active subject</tref>, the <tref>active property</tref> and the
-              <tref>active object</tref>. Return the <tref>active object</tref> to the calling location.
+              If the neither the <tref>active subject</tref> nor the <tref>active property</tref>, generate a triple
+              representing the <tref>active subject</tref>, the <tref>active property</tref> and the <tref>active object</tref>.
             </li>
+            <li>Return the <tref>active object</tref> to the calling location.</li>
           </ol>
         </li>
         <li>
           If the <tref>JSON object</tref> has a <code>@list</code> key and the value is an <tref>array</tref>
-          process the value as a list starting at <a href="#processing-step-list">Step 4</a> as if the
+          process the value as a list starting at <a href="#processing-step-list">Step 3.1</a> as if the
           <tref>active property</tref> is the target of a <code>@list</code> coercion.
         </li>
         <li id="processing-step-subject">If the <tref>JSON object</tref> has a <code>@subject</code> key:
@@ -2731,12 +2731,7 @@
               <tref>active subject</tref> and <tref>active property</tref>.
               <ol class="algorithm">
                 <li>
-                  If the <tref>active property</tref> is the target of a <code>@list</code> coercion,
-                  and the value is an <tref>array</tref>,
-                  process the value as a list starting at <a href="#processing-step-list">Step 4</a>.
-                </li>
-                <li>
-                  Otherwise, process the value starting at
+                  Process the value starting at
                   <a href="#processing-step-associative">Step 2</a>.
                 </li>
                 <li>Proceed using the previous <tref>processor state</tref>.</li>
@@ -2762,7 +2757,12 @@
             <li>Otherwise, set the <tref>active property</tref> to the result of performing
             <a href="#iri-expansion">IRI Expansion</a> on the key.</li>
             <li>
-              Create a new <tref>processor state</tref> copies of the <tref>active context</tref>,
+              If the <tref>active property</tref> is the target of a <code>@list</code> coercion,
+              and the value is an <tref>array</tref>,
+              process the value as a list starting at <a href="#processing-step-list">Step 3.1</a>.
+            </li>
+            <li>
+              Otherwise, create a new <tref>processor state</tref> copies of the <tref>active context</tref>,
               <tref>active subject</tref> and <tref>active property</tref> and process the value
               starting at <a href="#processing-step-associative">Step 2</a> and proceed using the
               previous <tref>processor state</tref>.
@@ -2779,7 +2779,7 @@
       If a regular <tref>array</tref> is detected
       <ol class="algorithm">
         <li id="processing-step-list">If the <tref>active property</tref> is the target of an
-          <code>@list</code> coercion Generate an <cite><a href="http://www.w3.org/TR/rdf-schema/#ch_collectionvocab">RDF Collection</a></cite> (see [[!RDF-SCHEMA]]) by linking each element of the list using
+          <code>@list</code> coercion generate an <cite><a href="http://www.w3.org/TR/rdf-schema/#ch_collectionvocab">RDF Collection</a></cite> (see [[!RDF-SCHEMA]]) by linking each element of the list using
           <code>rdf:first</code> and <code>rdf:next</code>, terminating the list with <code>rdf:nil</code> using the
           following sequence:
           <ol class="algorithm">
@@ -2796,9 +2796,19 @@
               <ol class="algorithm">
                 <li>Create a processor state using the active context,
                   <em>first <tref>blank node</tref></em> as the <tref>active subject</tref>, and
-                  <code>rdf:first</code> as the <tref>active property</tref>.</li>
-                <li>Unless this is the last element in the list, generate a new BNode identified as<
-                  em>rest <tref>blank node</tref></em>, otherwise use <code>rdf:nil</code>.</li>
+                  <code>rdf:first</code> as the <tref>active property</tref>.
+                  <ol class="algorithm">
+                    <li>Process the value starting at <a href="#processing-step-associative">Step 2</a>.</li>
+                    <li>Proceed using the previous <tref>processor state</tref>.</li>
+                  </ol>
+                  <div class="issue">There's a bug here, coercion can't take place without using the current
+                    <tref>active property</tref>, yet we need to pass <code>rdf:first</code> to have the
+                    appropriate triple changed. Might need a different strategy that relies on using a
+                    returned value to generate a triple within this context.
+                  </div>
+                </li>
+                <li>Unless this is the last element in the list, generate a new BNode identified as
+                  <em>rest <tref>blank node</tref></em>, otherwise use <code>rdf:nil</code>.</li>
                 <li>Generate a new triple using <em>first <tref>blank node</tref></em>,
                   <code>rdf:rest</code> and <em>rest <tref>blank node</tref></em>.</li>
                 <li>Set <em>first <tref>blank node</tref></em> to
--- a/spec/latest/json-ld-syntax/index.html	Wed Nov 23 19:21:03 2011 -0500
+++ b/spec/latest/json-ld-syntax/index.html	Wed Nov 23 19:21:24 2011 -0500
@@ -578,7 +578,8 @@
 <p>In JSON-LD, a <tdef>context</tdef> is used to map <tref>term</tref>s, i.e., keys and values
   in an JSON document, to <tref>IRI</tref>s. A <tdef>term</tdef> is a short word that MAY be expanded to an
   <tref>IRI</tref>. A <tref>term</tref> MUST have the lexical form of <cite><a
-  href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName">NCName</a></cite> (see [[XML-NAMES]]).</p>
+  href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName">NCName</a></cite> (see [[XML-NAMES]]), or
+  be an empty string.</p>
 <p>The Web uses IRIs for unambiguous identification. The
   idea is that these <tref>term</tref>s mean something that may be of use to other developers and that it is useful to
   give them an unambiguous identifier. That is, it is useful for <tref>term</tref>s to expand to IRIs so that