Enumerate all error codes and changed them to simple strings
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 08 Jan 2013 19:33:29 +0100
changeset 1116 cbf00fed06d4
parent 1115 e3d4a44aa3f2
child 1117 e281e6e6499e
Enumerate all error codes and changed them to simple strings

... as suggested by @darobin in #200.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Tue Jan 08 18:26:44 2013 +0100
+++ b/spec/latest/json-ld-api/index.html	Tue Jan 08 19:33:29 2013 +0100
@@ -778,7 +778,7 @@
         <li>If the <tref title="active property">active property's</tref>
           <tref>container mapping</tref> is set to <code>@list</code> and the expanded
           <em>item</em> is an <tref>array</tref> or a <tref>list object</tref> trigger
-          a <code class="error">listOfListsDetected</code> error.</li>
+          a <code class="error">list of lists detected</code> error.</li>
         <li>If the expanded <em>item</em> is <tref>null</tref>, drop it.</li>
         <li>Otherwise, if the expanded <em>item</em> is an <tref>array</tref>, merge its
           entries with <em>result's</em> entries.</li>
@@ -808,23 +808,23 @@
                   member of <em>result</em> to the result of expanding <em>value</em>
                   according the <a href="#iri-expansion">IRI Expansion algorithm</a> (passing <code>true</code>
                   for the <em>documentRelative</em> flag). If <em>value</em> is not a <tref>string</tref>
-                  trigger an <code class="error">INVALID_ID_VALUE</code> error.</li>
+                  trigger an <code class="error">invalid @id value</code> error.</li>
                 <li>If <em>expanded property</em> equals <code>@type</code>, set the <code>@type</code>
                   member of <em>result</em> to the result of expanding <em>value</em>
                   according the <a href="#iri-expansion">IRI Expansion algorithm</a> (passing <code>true</code>
                   for both the <em>documentRelative</em> and the <em>vocabRelative</em> flag). If <em>value</em>
                   is neither a <tref>string</tref> nor an <tref>array</tref> of
-                  <tref title="string">strings</tref> trigger an <code class="error">INVALID_TYPE_VALUE</code>
+                  <tref title="string">strings</tref> trigger an <code class="error">invalid type value</code>
                   error. Empty <tref title="array">arrays</tref> are ignored.</li>
                 <li>If <em>expanded property</em> equals <code>@value</code>, set the <code>@value</code>
                   member of <em>result</em> to <em>value</em>. If <em>value</em> is neither a <tref>scalar</tref>
-                  nor <tref>null</tref> trigger an <code class="error">INVALID_VALUE_OBJECT_VALUE</code> error.</li>
+                  nor <tref>null</tref> trigger an <code class="error">invalid value object value</code> error.</li>
                 <li>If <em>expanded property</em> equals <code>@language</code>, set the <code>@language</code>
                   member of <em>result</em> to the lowercased <em>value</em>. If <em>value</em> is not
-                  a <tref>string</tref>, trigger an <code class="error">INVALID_LANGUAGE_VALUE</code> error.</li>
+                  a <tref>string</tref>, trigger an <code class="error">invalid language value</code> error.</li>
                 <li>If <em>expanded property</em> equals <code>@annotation</code>, set the <code>@annotation</code>
                   member of <em>result</em> to <em>value</em>. If <em>value</em> is not a <tref>string</tref>
-                  trigger an <code class="error">INVALID_ANNOTATION_VALUE</code> error.</li>
+                  trigger an <code class="error">invalid @annotation value</code> error.</li>
                 <li>If <em>expanded property</em> equals <code>@set</code> or <code>@list</code>, set the
                   <em>expanded property</em> member of <em>result</em> to the result of expanding <em>value</em> by
                   recursively using this algorithm, passing copies of the <tref>active context</tref> and
@@ -851,7 +851,7 @@
                       consisting of two members: <code>@value</code> set to the currently
                       processed item and <code>@language</code> set to the lowercased <em>key</em>.
                       If <em>val</em> is not a <tref>string</tref>, trigger a
-                      <code class="error">LANGUAGE_MAP_INVALID_VALUE</code> error. Otherwise append
+                      <code class="error">language map invalid value</code> error. Otherwise append
                       the object to <em>language map values</em>.</li>
                   </ol>
                 </li>
@@ -909,12 +909,12 @@
             <li>decrease <em>numProperties</em> by 1.</li>
             <li>If <em>element</em> has an <code>@language</code> member, decrease <em>numProperties</em>
               by 1 and check that the value of the <code>@value</code> member is a string. If not,
-              trigger an <code class="error">INVALID_LANGUAGE_TAGGED_STRING</code> error.</li>
+              trigger an <code class="error">invalid language tagged string</code> error.</li>
             <li>Otherwise, if <em>element</em> has an <code>@type</code> member, decrease
               <em>numProperties</em> by 1 and check that the value of the <code>@type</code> member is a
-              string. If not, trigger an <code class="error">INVALID_TYPED_VALUE</code> error.</li>
+              string. If not, trigger an <code class="error">invalid typed value</code> error.</li>
             <li>If <em>numProperties</em> is greater than 0, trigger an
-              <code class="error">INVALID_VALUE_OBJECT</code> error.</li>
+              <code class="error">invalid value object</code> error.</li>
             <li>If the value of the <code>@value</code> member equals <tref>null</tref>, set
               <em>element</em> to <tref>null</tref>.</li>
             <li>Return.</li>
@@ -924,7 +924,7 @@
           transform it to an <tref>array</tref>.</li>
         <li>If <em>element</em> has an <code>@list</code> or <code>@set</code> member and
           <em>numProperties</em> is greater than 1, trigger an
-          <code class="error">INVALID_SET_OR_LIST_OBJECT</code> error.</li>
+          <code class="error">invalid set or list object</code> error.</li>
         <li>Otherwise, if <em>element</em> has an <code>@set</code> member, set <em>element</em> to
           the value of that member.</li>
         <li>Otherwise, if <em>element</em> has just an <code>@language</code> member, set <em>element</em>
@@ -977,7 +977,7 @@
           <ol class="algorithm">
             <li>Expand <em>context</em> according to <a href="#iri-expansion">IRI Expansion</a>.</li>
             <li>If <em>context</em> is in the <em>remoteContexts</em> array, raise an
-              <code class="error">RECURSIVE_CONTEXT_INCLUSION</code> error. Otherwise, add
+              <code class="error">recursive context inclusion</code> error. Otherwise, add
               <em>context</em> to <em>remoteContexts</em>.</li>
             <li>Dereference <em>context</em>.</li>
             <li>If the resulting document is a JSON document consisting of a top-level
@@ -986,23 +986,23 @@
               <code>@context</code> member as <tref>local context</tref>, and a copy of
                 the <em>remoteContexts</em> array. <tref title="relative IRI">Relative IRIs</tref>
                 are expanded using the remote context's IRI. Otherwise raise an
-                <code class="error">INVALID_REMOTE_CONTEXT</code> error.</li>
+                <code class="error">invalid remote context</code> error.</li>
             <li>Continue with the next item from <em>context</em>.</li>
           </ol>
         </li>
         <li>If <em>context</em> is not a <tref>JSON object</tref>, raise an
-          <code class="error">INVALID_LOCAL_CONTEXT</code> error.</li>
+          <code class="error">invalid local context</code> error.</li>
         <li>Otherwise, if <em>context</em> is an <tref>JSON object</tref>, perform the following steps:
           <ol class="algorithm">
             <li>If <em>context</em> has a <code>@vocab</code> member: if its value is neither
               an <tref>absolute IRI</tref>, i.e., it does not contain a colon (<code>:</code>),
-              nor <tref>null</tref>, trigger an <code class="error">INVALID_VOCAB_MAPPING</code>
+              nor <tref>null</tref>, trigger an <code class="error">invalid vocab mapping</code>
               error; otherwise set the <tref title="active context">active context's</tref>
               <tref>vocabulary mapping</tref> to its value and remove the <code>@vocab</code>
               member from <em>context</em>.</li>
             <li>If <em>context</em> has a <code>@language</code> member: if its value is neither
               a <tref>string</tref> nor <tref>null</tref>, trigger an
-              <code class="error">INVALID_DEFAULT_LANGUAGE</code> error; otherwise set the
+              <code class="error">invalid default language</code> error; otherwise set the
               <tref title="active context">active context's</tref> <tref>default language</tref> to
               its value and remove the <code>@language</code> member from <em>context</em>.</li>
             <li>For each other <em>key</em>-<em>value</em> pair in <em>context</em> perform the
@@ -1020,7 +1020,7 @@
                   an <tref>IRI mapping</tref> set to the expanded <em>value</em>. Continue with
                   the next <em>key</em>-<em>value</em> pair.</li>
                 <li>If <em>value</em> is not a <tref>JSON object</tref>, trigger an
-                  <code class="error">INVALID_TERM_DEFINITION</code> error</li>
+                  <code class="error">invalid term definition</code> error</li>
                 <li>If <tref>term definition</tref> for <em>key</em> exists in the
                   <tref>active context</tref>, remove it.</li>
                 <li>Initialize a new, empty <tref>term definition</tref> <em>definition</em>.</li>
@@ -1031,11 +1031,11 @@
                         <li>expand each <em>item</em> in the array according the
                           <a href="#iri-expansion">IRI Expansion algorithm</a> if it is a
                           <tref>string</tref>. If am <em>item</em> is not a <tref>string</tref>,
-                          raise an <code class="error">INVALID_PROPERTY_GENERATOR</code> error; if
+                          raise an <code class="error">invalid property generator</code> error; if
                           <em>item</em> does not expand to an <tref>absolute IRI</tref> or
                           <tref>blank node identifier</tref>, i.e., it does not contain a colon
                           (<code>:</code>) after expansion, raise an
-                          <code class="error">INVALID_PROPERTY_GENERATOR_IRI_MAPPING</code> error.</li>
+                          <code class="error">invalid property generator IRI mapping</code> error.</li>
                         <li>Lexicographically sort <em>val</em> and set the <tref>IRI mapping</tref>
                           of <em>definition</em> to <em>val</em>.</li>
                       </ol>
@@ -1053,22 +1053,22 @@
                 <li>Otherwise, if the <tref>IRI mapping</tref> of <em>definition</em> is set to
                   a <tref>string</tref> which does not contain a colon (<code>:</code>), i.e., it is
                   neither an <tref>absolute IRI</tref> nor a <tref>blank node identifier</tref>,
-                  raise an <code class="error">INVALID_TERM_IRI_MAPPING</code> error.</li>
+                  raise an <code class="error">invalid term IRI mapping</code> error.</li>
                 <li>If <em>value</em> has an <code>@type</code> member with a value <em>val</em> and <em>val</em>
                   is not a <tref>string</tref> or does not expand to an <tref>absolute IRI</tref> using the
                   <a href="#iri-expansion">IRI Expansion algorithm</a>, raise an
-                  <code class="error">INVALID_TYPE_MAPPING</code> error. Otherwise set the
+                  <code class="error">invalid type mapping</code> error. Otherwise set the
                   <tref>IRI mapping</tref> of <em>definition</em> to the expanded <em>val</em>.</li>
                 <li>Otherwise, if <em>value</em> has an <code>@language</code> member with a value <em>val</em>
                   that is a <tref>string</tref> or <tref>null</tref>, set the <tref>language mapping</tref> of
                   <em>definition</em> to the lowercased <em>val</em>. If <em>val</em> is neither a
                   <tref>string</tref> nor <tref>null</tref>, raise an
-                  <code class="error">INVALID_LANGUAGE_MAPPING</code> error.</li>
+                  <code class="error">invalid language mapping</code> error.</li>
                 <li>f <em>value</em> has an <code>@container</code> member with a value <em>val</em> that
                   equals <code>@list</code>, <code>@set</code>, or <code>@annotation</code>, set the
                   <tref>container mapping</tref> of <em>definition</em> to <em>val</em>.
                   If <em>val</em> is not one of those values, raise an
-                  <code class="error">INVALID_CONTAINER_MAPPING</code> error.</li>
+                  <code class="error">invalid container mapping</code> error.</li>
               </ol>
             </li>
           </ol>
@@ -1109,7 +1109,7 @@
     <li>If a <tref>local context</tref> has been passed
       <ol class="algorithm">
         <li>and <em>value</em> is in the <em>path</em> array, raise a
-          <code class="error">CYCLIC_IRI_MAPPING</code> error. Otherwise append <em>value</em>
+          <code class="error">cyclic IRI mapping</code> error. Otherwise append <em>value</em>
           to <em>path</em>.</li>
         <li>If <tref>local context</tref> contains an <tref>IRI mapping</tref> for <em>value</em>
           that is not a <tref>property generator</tref> return the result of recursively calling
@@ -1117,7 +1117,7 @@
           <em>value</em>, the <tref>active context</tref> and <tref>local context</tref>,
           <em>path</em>, and <code>true</code> for the <em>vocabRelative</em> flag. If the result
           is a <tref>property generator</tref>, raise an
-          <code class="error">PROPERTY_GENERATOR_IN_TERM_DEFINITION</code> error.</li>
+          <code class="error">property generator in term definition</code> error.</li>
       </ol>
     </li>
     <li>If an <tref>IRI mapping</tref> exists for <em>value</em> in the <tref>active context</tref>
@@ -1357,7 +1357,7 @@
             <li>If the <tref title="active property">active property's</tref> <tref>container mapping</tref>
               is set to <code>@list</code>, set the <tref>active property</tref> member of <em>result</em>
               to the value of <em>item's</em> <code>@list</code> member. If such an member already exists
-              in result, raise an <code class="error">COMPACTION_TO_LIST_OF_LISTS</code> error; otherwise
+              in result, raise an <code class="error">compaction to list of lists</code> error; otherwise
               continue with the next <em>property</em>-<em>value</em> pair from <em>element</em>.</li>
           </ol>
         </li>
@@ -2438,15 +2438,94 @@
         codes.</p>
 
       <dl title="enum JsonLdErrorCode" class="idl">
-        <dt>invalidSyntax</dt>
-        <dd>A violation of the grammar as defined by the JSON-LD syntax specification
-          [[!JSON-LD]] was detected.</dd>
-        <dt>retrievalFailure</dt>
-        <dd>There was a problem encountered loading a remote context.</dd>
-        <dt>listOfListsDetected</dt>
+        <dt>invalid syntax</dt>
+        <dd>The document could not be parsed as JSON.</dd>
+        <dt>list of lists detected</dt>
         <dd>A list of lists was detected. List of lists are not supported in
           this version of JSON-LD due to the algorithmic complexity associated
           with conversion to RDF.</dd>
+        <dt>invalid @annotation value</dt>
+        <dd>An <code>@annotation</code> member was encountered whose value was
+          not a <tref>string</tref>.</dd>
+        <dt>invalid @id value</dt>
+        <dd>An <code>@id</code> member was encountered whose value was not a
+          <tref>string</tref>.</dd>
+        <dt>invalid local context</dt>
+        <dd>In invalid <tref>local context</tref> was detected.</dd>
+        <dt>loading remote context failed</dt>
+        <dd>There was a problem encountered loading a remote context.</dd>
+        <dt>invalid remote context</dt>
+        <dd>No valid context document has been found for a referenced,
+         remote context.</dd>
+        <dt>recursive context inclusion</dt>
+        <dd>A cycle in remote context inclusions has been detected.</dd>
+        <dt>invalid default language</dt>
+        <dd>The value of the <tref>default language</tref> is not a <tref>string</tref>
+          or <tref>null</tref> and thus invalid.</dd>
+        <dt>invalid vocab mapping</dt>
+        <dd>An invalid <tref>vocabulary mapping</tref> has been detected, i.e.,
+          it is neither an <tref>absolute IRI</tref> nor <tref>null</tref>.</dd>
+        <dt>invalid term definition</dt>
+        <dd>An invalid <tref>term definition</tref> has been detected.</dd>
+        <dt>invalid term IRI mapping</dt>
+        <dd>A <tref>local context</tref> contains a <tref>term</tref> that
+          has not been mapped to an <tref>absolute IRI</tref>.</dd>
+        <dt>cyclic IRI mapping</dt>
+        <dd>A cycle in <tref title="IRI mapping">IRI mappings</tref> has been detected.</dd>
+        <dt>invalid type mapping</dt>
+        <dd>An <code>@type</code> member in a <tref>term definition</tref>
+          was encountered whose value could not be expanded to an
+          <tref>absolute IRI</tref>.</dd>
+        <dt>invalid language mapping</dt>
+        <dd>An <code>@language</code> member in a <tref>term definition</tref>
+          was encountered whose value was neither a <tref>string</tref> nor
+          <tref>null</tref> and thus invalid.</dd>
+        <dt>invalid container mapping</dt>
+        <dd>An <code>@container</code> member was encountered whose value was
+          not one of the following <tref title="string">strings</tref>:
+          <code>@list</code>, <code>@set</code>, or <code>@annotation</code>.</dd>
+        <dt>invalid property generator</dt>
+        <dd>A non-<tref>string</tref> value has been detected in a
+          <tref title="property generator">property generator's</tref>
+          <tref>IRI mapping</tref>.</dd>
+        <dt>invalid property generator IRI mapping</dt>
+        <dd>Expanding all values of a
+          <tref title="property generator">property generator's</tref>
+          <tref>IRI mapping</tref> to <tref>absolute IRI</tref> failed.</dd>
+        <dt>property generator in term definition</dt>
+        <dd>A <tref>property generator</tref> was used in the
+          <tref>IRI mapping</tref> of another <tref>term</tref> or
+          <tref>property generator</tref>.</dd>
+        <dt>invalid type value</dt>
+        <dd>An invalid value for a <code>@type</code> member has been detected,
+          i.e., the value was neither a <tref>string</tref> nor an <tref>array</tref>
+          of <tref title="string">strings</tref>.</dd>
+        <dt>invalid value object</dt>
+        <dd>A <tdef>value object</tdef> with disallowed members has been
+          detected.</dd>
+        <dt>invalid value object value</dt>
+        <dd>An invalid value for the <code>@value</code> member of a
+          <tref>value object</tref> has been detected, i.e., it is neither
+          a <tref>scalar</tref> nor <tref>null</tref>.</dd>
+        <dt>invalid language tagged string</dt>
+        <dd>A <tref>language-tagged string</tref> with disallowed members has
+          been detected.</dd>
+        <dt>invalid language value</dt>
+        <dd>A <tref>language-tagged string</tref> with an invalid language
+          value was detected.</dd>
+        <dt>invalid typed value</dt>
+        <dd>A <tref>typed value</tref> with disallowed members has been
+          detected.</dd>
+        <dt>invalid set or list object</dt>
+        <dd>A <tdef>set object</tref> or <tref>list object</tref> with
+          disallowed members has been detected.</dd>
+        <dt>language map invalid value</dt>
+        <dd>An invalid value in a <tdef>language map</tdef> was detected. It has
+          to be a <tref>string</tref> or an <tref>array</tref> of
+          <tref title="string">strings</tref>.</dd>
+        <dt>compaction to list of lists</dt>
+        <dd>The compacted document contains a list of lists as multiple
+          lists have been compacted to the same term.</dd>
       </dl>
     </section>