Make naming of algorithms more consistent (1/2)
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 27 Feb 2013 19:29:56 +0100
changeset 1344 a14d1bb76c6a
parent 1343 934d921c064d
child 1345 bef96121bcfe
Make naming of algorithms more consistent (1/2)

This addresses #218.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Wed Feb 27 19:09:22 2013 +0100
+++ b/spec/latest/json-ld-api/index.html	Wed Feb 27 19:29:56 2013 +0100
@@ -819,7 +819,7 @@
   </section> <!-- end of Remote Context Resolution -->
 
   <section>
-    <h2>Context Processing</h2>
+    <h2>Context Processing Algorithm</h2>
 
     <p>When processing a JSON-LD data structure, each processing rule is applied
       using information provided by the <tref>active context</tref>. This
@@ -956,8 +956,8 @@
     <h2>Create Term Definition Subalgorithm</h2>
 
     <p>This algorithm is called from the
-      <a href="#context-processing">Context Processing algorithm</a> to create
-      <tref title="term definition">term definitions</tref> in a new
+      <a href="#context-processing-algorithm">Context Processing algorithm</a>
+      to create <tref title="term definition">term definitions</tref> in a new
       <tref>active context</tref>.</p>
 
     <section class="informative">
@@ -1170,8 +1170,8 @@
 
     <p><tref>IRI</tref> expansion may occur during context processing or during
       any of the other JSON-LD algorithms. If IRI expansion occurs during context
-      processing, then the <tref>local context</tref> and its related
-      <em>defined</em> map from the <a href="#context-processing">Context Processing algorithm</a>
+      processing, then the <tref>local context</tref> and its related <em>defined</em>
+      map from the <a href="#context-processing-algorithm">Context Processing algorithm</a>
       are passed to this algorithm. This allows for <tref>term definition</tref>
       dependencies to be processed via the
       <a href="#create-term-definition-subalgorithm">Create Term Definition subalgorithm</a>.</p>
@@ -1210,7 +1210,7 @@
         a key in the <tref>local context</tref> and the <em>defined</em> map
         does not have a key for <em>value</em> with an associated value of
         <tref>true</tref>. The <em>defined</em> map is used during
-        <a href="#context-processing">Context Processing</a> to keep track of
+        <a href="#context-processing-algorithm">Context Processing</a> to keep track of
         which <tref title="term">terms</tref> have already been defined or are
         in the process of being defined. We create a
         <tref>term definition</tref> by using the
@@ -1229,10 +1229,9 @@
         <tref title="active context">active context's</tref>
         <tref>vocabulary mapping</tref>, respectively, and
         a <tref>local context</tref> and a map <em>defined</em> to be used when
-        this algorithm is used during
-        <a href="#context-processing">Context Processing</a>. If not passed, the
-        two flags are set to <code>false</code> and <tref>local context</tref> and
-        <em>defined</em> are initialized to <tref>null</tref>.</p>
+        this algorithm is used during <a href="#context-processing-algorithm">Context Processing</a>.
+        If not passed, the two flags are set to <code>false</code> and
+        <tref>local context</tref> and <em>defined</em> are initialized to <tref>null</tref>.</p>
 
       <ol class="algorithm">
         <li>If <em>value</em> is a <tref>keyword</tref> or is <tref>null</tref>,
@@ -1245,7 +1244,7 @@
           passing <tref>active context</tref>, <tref>local context</tref>,
           <em>value</em> as <em>term</em>, and <em>defined</em>. This will ensure that
           a <tref>term definition</tref> is created for <em>value</em> in
-          <tref>active context</tref> during <a href="#context-processing">Context Processing</a>.
+          <tref>active context</tref> during <a href="#context-processing-algorithm">Context Processing</a>.
         </li>
         <li>Initialize <em>result</em> to <tref>null</tref>.</li>
         <li>If <em>vocabRelative</em> is <tref>true</tref>:
@@ -1282,7 +1281,7 @@
                   and <em>defined</em>. This will ensure that a
                   <tref>term definition</tref> is created for <tref>prefix</tref>
                   in <tref>active context</tref> during
-                  <a href="#context-processing">Context Processing</a>.</li>
+                  <a href="#context-processing-algorithm">Context Processing</a>.</li>
                 <li>If <tref>active context</tref> contains a
                   <tref>term definition</tref> for <tref>prefix</tref> that is
                   not a <tref>property generator</tref> then set <em>result</em>
@@ -1413,8 +1412,7 @@
       <p>The algorithm takes four input variables: an <tref>active context</tref>,
         an <tref>active property</tref>, an <em>element</em> to be expanded, and
         an <em>insideList</em> flag. To begin, the <tref>active context</tref> is set
-        to the result of performing, <a
-        href="#context-processing">Context Processing</a> on the passed
+        to the result of performing, <a href="#context-processing-algorithm">Context Processing</a> on the passed
         <code class="idlMemberName"><a href="#widl-JsonLdOptions-expandContext">expandContext</a></code>,
         or empty if <code class="idlMemberName"><a href="#widl-JsonLdOptions-expandContext">expandContext</a></code>
         is <tref>null</tref>, <tref>active property</tref> is set to <tref>null</tref>,
@@ -1463,7 +1461,7 @@
         <li>Otherwise <em>element</em> is a <tref>JSON object</tref>.</li>
         <li>If <em>element</em> contains the key <code>@context</code>, set
           <tref>active context</tref> to the result of the
-          <a href="#context-processing">Context Processing algorithm</a>,
+          <a href="#context-processing-algorithm">Context Processing algorithm</a>,
           passing <tref>active context</tref> and the value of the
           <code>@context</code> key as <tref>local context</tref>.</li>
         <li>Initialize <em>expanded active property</em> to the result of the
@@ -1930,11 +1928,9 @@
           we can remove duplicate values without modifying the original
           <em>element</em>. Then, we compact each value in the shallow copy
           for each key recursively. Some of the keys will be
-          compacted, using the
-          <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
-          to <tref title="term">terms</tref> or
-          <tref title="compact IRI">compact IRIs</tref> and others will be
-          compacted from <tref title="keyword">keywords</tref> to
+          compacted, using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
+          to <tref title="term">terms</tref> or <tref title="compact IRI">compact IRIs</tref>
+          and others will be compacted from <tref title="keyword">keywords</tref> to
           <tref>keyword</tref> aliases or simply left unchanged because
           they do not have definitions in the <tref>context</tref>. Values will
           be converted to <tref>compacted form</tref> via the
@@ -1962,7 +1958,7 @@
         <tref>active context</tref>, an <tref>active property</tref>, and an
         <em>element</em> to be compacted. To begin, the <tref>active context</tref>
         is set to the result of performing
-        <a href="#context-processing">Context Processing</a> on the passed
+        <a href="#context-processing-algorithm">Context Processing</a> on the passed
         <em>context</em>, the <tref>active property</tref> is set to
         <tref>null</tref>, and <em>element</em> is set to the result of performing
         the <a href="#expansion-algorithm">Expansion algorithm</a> on the
@@ -2031,8 +2027,7 @@
                 <ol class="algorithm">
                   <li>If <em>expanded value</em> is a <tref>string</tref>,
                     then initialize <em>compacted value</em> to the result
-                    of using the
-                    <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                    of using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                     passing <tref>active context</tref>,
                     <em>expanded value</em> for <em>iri</em>,
                     and <tref>true</tref> for <em>vocabRelative</em> if
@@ -2045,8 +2040,7 @@
                         <tref>array</tref>.</li>
                       <li>For each item <em>expanded type</em> in
                         <em>expanded value</em>, append the result of
-                        of using the
-                        <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                        of using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                         passing <tref>active context</tref>,
                         <em>expanded type</em> for <em>iri</em>, and
                         <tref>true</tref> for <em>vocabRelative</em>,
@@ -2057,7 +2051,7 @@
                     </ol>
                   </li>
                   <li>Initialize <em>alias</em> to the result of using the
-                    <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                    <a href="#iri-compaction">IRI Compaction algorithm</a>,
                     passing <tref>active context</tref> and
                     <em>expanded property</em> for <em>iri</em>.</li>
                   <li>Add the key-value pair,
@@ -2077,7 +2071,7 @@
                   property by continuing to the next
                   <em>expanded property</em>.</li>
                 <li>Otherwise, initialize <em>alias</em> to the result of using
-                  the <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                  the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                   passing <tref>active context</tref> and
                   <em>expanded property</em> for <em>iri</em>.</li>
                 <li>Add the key-value pair,
@@ -2089,8 +2083,7 @@
             <li>If <em>expanded value</em> is an empty <tref>array</tref>:
               <ol class="algorithm">
                 <li>Initialize <em>item active property</em> to the result of
-                  using the
-                  <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                  using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                   passing <tref>active context</tref>,
                   <em>expanded property</em> for <em>iri</em>,
                   <em>expanded value</em> for <em>value</em>,
@@ -2110,7 +2103,7 @@
               For each item <em>expanded item</em> in <em>expanded value</em>:
               <ol class="algorithm">
                 <li>Initialize <em>item active property</em> to the result of using
-                  the <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                  the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                   passing <tref>active context</tref>,
                   <em>expanded property</em> for <em>iri</em>,
                   <em>expanded item</em> for <em>value</em>,
@@ -2149,15 +2142,14 @@
                           <tref>list object</tref> by setting it to a
                           <tref>JSON object</tref> containing key-value pair
                           where the key is the result of the
-                          <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                          <a href="#iri-compaction">IRI Compaction algorithm</a>,
                           passing <tref>active context</tref> and
                           <code>@list</code> for <em>iri</em>, and the
                           value is <em>compacted item</em>.</li>
                         <li>If <em>expanded item</em> contains the key
                           <code>@index</code>, then add a key-value pair
                           to <em>compacted item</em> where the key is the
-                          result of the
-                          <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>,
+                          result of the <a href="#iri-compaction">IRI Compaction algorithm</a>,
                           passing <tref>active context</tref> and
                           <code>@index</code> for <em>iri</em>, and the
                           value is the value associated with the
@@ -2235,7 +2227,7 @@
         an <tref>array</tref> with two or more items and a <em>context</em> has
         been passed, replace it with a new <tref>JSON object</tref> with a single
         key-value pair where the key is the result of using the
-        <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>, passing
+        <a href="#iri-compaction">IRI Compaction algorithm</a>, passing
         <tref>active context</tref> and <code>@graph</code> for <em>iri</em>, and
         the value is <em>result</em>. Otherwise, if <em>result</em> is an
         <tref>array</tref> with only one item, set <em>result</em> to that item.
@@ -2248,7 +2240,7 @@
   </section> <!-- end of Compaction -->
 
   <section>
-    <h2>Inverse Context Creation Subalgorithm</h2>
+    <h2>Inverse Context Creation</h2>
 
     <p>When there is more than one <tref>term</tref> that could be chosen
       to compact an <tref>IRI</tref>, we want to ensure that our <tref>term</tref>
@@ -2466,10 +2458,10 @@
         <li>Return <em>result</em>.</li>
       </ol>
     </section>
-  </section> <!-- end of Inverse Context Creation subalgorithm -->
+  </section> <!-- end of Inverse Context Creation -->
 
   <section>
-    <h2>IRI Compaction Algorithm</h2>
+    <h2>IRI Compaction</h2>
 
     <p>This section defines an algorithm for transforming an <tref>IRI</tref>
       to a <tref>term</tref> or <tref>compact IRI</tref>, or a <tref>keyword</tref>
@@ -2541,7 +2533,7 @@
         <li>If <em>vocabRelative</em> is <tref>true</tref> and
           <tref>active context</tref> has no associated
           <tref>inverse context</tref>, then generate it using the
-          <a href="#inverse-context-creation-subalgorithm">Inverse Context Creation algorithm</a>.
+          <a href="#inverse-context-creation">Inverse Context Creation algorithm</a>.
           Set <em>inverse context</em> to the <tref>inverse context</tref>
           associated with <tref>active context</tref>.</li>
         <li>If <em>vocabRelative</em> is <tref>true</tref> and <em>iri</em> is a
@@ -2712,7 +2704,7 @@
     <h2>Term Selection Subalgorithm</h2>
 
     <p>This subalgorithm, invoked via the
-      <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>, makes use
+      <a href="#iri-compaction">IRI Compaction algorithm</a>, makes use
       of an <tref title="active context">active context's</tref>
       <tref>inverse context</tref> to find the <tref>term</tref> that is best
       used to <tref title="compaction">compact</tref> an <tref>IRI</tref>. Other
@@ -2750,7 +2742,7 @@
         mappings are resolved by first choosing the shortest terms, and then by
         choosing the lexicographically least term. Note that these ties are
         resolved automatically because they were previously resolved when the
-        <a href="#inverse-context-creation-subalgorithm">Inverse Context Creation algorithm</a>
+        <a href="#inverse-context-creation">Inverse Context Creation algorithm</a>
         was used to create the <tref>inverse context</tref>.</p>
     </section>
 
@@ -2790,7 +2782,7 @@
           <code>@id</code>:
           <ol class="algorithm">
             <li>If the result of using the
-              <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref>, the value associated with the
               <code>@id</code> key in <em>value</em> for
               <em>iri</em>, <tref>true</tref> for <em>vocabRelative</em>, and
@@ -2897,7 +2889,7 @@
 
       <p>For the latter case, where the key <code>@id</code> appears in <em>value</em>,
         we compact the associated value using the
-        <a href="#iri-compaction-algorithm">IRI Compaction algorithm</a>, and
+        <a href="#iri-compaction">IRI Compaction algorithm</a>, and
         use its value if the <tref>type mapping</tref> associated with the
         <tref>active property</tref> is <code>@id</code> or the expanded value for
         the <tref>active property</tref> is <code>@graph</code>. Otherwise, we
@@ -2941,30 +2933,30 @@
             <li>Initialize <em>result</em> to an empty <tref>JSON object</tref>.</li>
             <li>If <em>preserveIndex</em> is <tref>true</tref>, then add
               a key-value pair to <em>result</em> where the key is the result
-              using the <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              using the <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref> and
               <code>@index</code> for <em>iri</em>, and the value is
               the value associated with the <code>@index</code> key in
               <em>value</em>.</li>
             <li>If <em>value</em> contains the key <code>@type</code>, then add
               a key-value pair to <em>result</em> where the key is the result
-              using the <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              using the <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref> and
               <code>@type</code> for <em>iri</em>, and the value is the result
-              of using the <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              of using the <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref>, the value associated
               with the <code>@type</code> key in <em>value</em> for <em>iri</em>,
               and <tref>true</tref> for <em>vocabRelative</em>.</li>
             <li>Otherwise, if <em>value</em> contains the key <code>@language</code>,
               then add a key-value pair to <em>result</em> where the key is the
               result using the
-              <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref> and
               <code>@language</code> for <em>iri</em>, and the value is the
               value associated with the <code>@language</code> key in
               <em>value</em>.</li>
             <li>Add a key-value pair to <em>result</em> where the key is the result
-              using the <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+              using the <a href="#iri-compaction">IRI compaction algorithm</a>,
               passing <tref>active context</tref> and
               <code>@value</code> for <em>iri</em>, and the value is the value
               associated with the <code>@value</code> key in <em>value</em>.</li>
@@ -2977,7 +2969,7 @@
           <tref>active context</tref>, <em>value</em>, and
           <tref>true</tref> for <em>vocabRelative</em>.</li>
         <li>Initialize <em>term</em> to the result of using the
-          <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+          <a href="#iri-compaction">IRI compaction algorithm</a>,
           passing <tref>active context</tref>, the value associated with
           the key <code>@id</code> in <em>value</em> for <em>iri</em>, and
           <tref>true</tref> for <em>vocabRelative</em> if
@@ -2989,7 +2981,7 @@
           <code>@graph</code>, then return <em>term</em>.</li>
         <li>Initialize <em>result</em> to an empty <tref>JSON object</tref>. Add
           a key-value pair to <em>result</em> where the key is the result of
-          using the <a href="#iri-compaction-algorithm">IRI compaction algorithm</a>,
+          using the <a href="#iri-compaction">IRI compaction algorithm</a>,
           passing <tref>active context</tref>, and <code>@id</code> for
           <em>iri</em>, and the value is <em>term</em>.</li>
         <li>Return <em>result</em>.</li>