Add definitions for absolute IRI and relative IRI.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Thu, 26 Jan 2012 17:16:24 -0800
changeset 369 e443fb800aff
parent 368 c2dad244979e
child 370 43b5b10cb29f
Add definitions for absolute IRI and relative IRI.
Add requirements that keys expand to absolute IRIs to be processed.
(It's an open issue of what to do with the value of keys that do not expand to absolute IRIs).
This partially addresses issue #49 and the resolution of 1/24/2012 http://json-ld.org/minutes/2012-01-24/#resolution-1
spec/latest/json-ld-api/index.html
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-api/index.html	Thu Jan 26 16:40:49 2012 -0800
+++ b/spec/latest/json-ld-api/index.html	Thu Jan 26 17:16:24 2012 -0800
@@ -493,7 +493,7 @@
          <dt>INVALID_SYNTAX</dt>
          <dd>A general syntax error was detected in the <code>@context</code>.
          For example, if a <code>@type</code> key maps to anything other than
-         <code>@id</code> or an absolute <tref>IRI</tref>, this exception would be raised.</dd>
+         <code>@id</code> or an <tref>absolute IRI</tref>, this exception would be raised.</dd>
          <dt>LOAD_ERROR</dt>
          <dd>There was a problem encountered loading a remote context.</dd>
         </dl>
@@ -518,7 +518,7 @@
           <dt>INVALID_SYNTAX</dt>
           <dd>A general syntax error was detected in the <code>@context</code>.
             For example, if a <code>@type</code> key maps to anything other than
-            <code>@id</code> or an absolute <tref>IRI</tref>, this exception would be raised.</dd>
+            <code>@id</code> or an <tref>absolute IRI</tref>, this exception would be raised.</dd>
           <dt>LOAD_ERROR</dt>
           <dd>There was a problem encountered loading a remote context.</dd>
         </dl>
@@ -586,7 +586,7 @@
           <dt>INVALID_SYNTAX</dt>
           <dd>A general syntax error was detected in the <code>@context</code>.
             For example, if a <code>@type</code> key maps to anything other than
-            <code>@id</code> or an absolute <tref>IRI</tref>, this exception would be raised.</dd>
+            <code>@id</code> or an <tref>absolute IRI</tref>, this exception would be raised.</dd>
           <dt>LOAD_ERROR</dt>
           <dd>There was a problem encountered loading a remote context.</dd>
         </dl>
@@ -614,7 +614,7 @@
           <dt>INVALID_SYNTAX</dt>
           <dd>A general syntax error was detected in the <code>@context</code>.
             For example, if a <code>@type</code> key maps to anything other than
-            <code>@id</code> or an absolute <tref>IRI</tref>, this exception would be raised.</dd>
+            <code>@id</code> or an <tref>absolute IRI</tref>, this exception would be raised.</dd>
           <dt>LOAD_ERROR</dt>
           <dd>There was a problem encountered loading a remote context.</dd>
         </dl>
@@ -787,7 +787,7 @@
       <ol id="process-context" class="algorithm">
         <li>If <em>value</em> is an <tref>array</tref>, process
           each element as <em>value</em>, in order using <a href="#process-context">Step 2</a>.</li>
-        <li>If <em>value</em> is a simple <tref>string</tref>, it MUST have a lexical form of absolute <tref>IRI</tref>.
+        <li>If <em>value</em> is a simple <tref>string</tref>, it MUST have a lexical form of <tref>absolute IRI</tref>.
           <ol class="algorithm">
             <li>Dereference <em>value</em>.</li>
             <li>If the resulting document is a JSON document, extract the top-level <code>@context</code>
@@ -805,21 +805,21 @@
               or being an empty string, perform the following steps:
               <ol class="algorithm">
                 <li>If the key's value is a simple <tref>string</tref>, the value MUST have the form of
-                  <tref>term</tref>, <tref>compact IRI</tref>, absolute <tref>IRI</tref>. Determine the IRI mapping value by
+                  <tref>term</tref>, <tref>compact IRI</tref>, <tref>absolute IRI</tref>. Determine the IRI mapping value by
                   performing <a href="#iri-expansion">IRI Expansion</a> on the associated value. If the result of the IRI
-                  mapping is an absolute IRI, merge the key-value pair into the <tref>local context</tref>
+                  mapping is an <tref>absolute IRI</tref>, merge the key-value pair into the <tref>local context</tref>
                   <tref>term mapping</tref>.</li>
                 <li>Otherwise, the key's value MUST be a <tref>JSON object</tref>.
                   <ol class="algorithm">
                     <li>The value MUST have a <code>@id</code> key with a string value, the value MUST have the
-                      form of <tref>term</tref>, <tref>compact IRI</tref>, absolute <tref>IRI</tref>. Determine the IRI mapping value
+                      form of <tref>term</tref>, <tref>compact IRI</tref>, <tref>absolute IRI</tref>. Determine the IRI mapping value
                       by performing <a href="#iri-expansion">IRI Expansion</a> on the associated value. If the result of
-                      the IRI mapping is an absolute <tref>IRI</tref>, merge the key-value pair into the <tref>local context</tref>
+                      the IRI mapping is an <tref>absolute IRI</tref>, merge the key-value pair into the <tref>local context</tref>
                       <tref>term mapping</tref>.</li>
                     <li>If the value has a <code>@type</code> key, the value MUST have the form of <tref>term</tref>,
-                      <tref>compact IRI</tref>, absolute <tref>IRI</tref> or the <tref>keyword</tref> <code>@id</code>. Determine the IRI by
+                      <tref>compact IRI</tref>, <tref>absolute IRI</tref> or the <tref>keyword</tref> <code>@id</code>. Determine the IRI by
                       performing <a href="#iri-expansion">IRI Expansion</a> on the associated value. If the result of the
-                      IRI mapping is an absolute <tref>IRI</tref> or <code>@id</code>, merge into the <tref>local context</tref>
+                      IRI mapping is an <tref>absolute IRI</tref> or <code>@id</code>, merge into the <tref>local context</tref>
                       <tref>coercion mapping</tref>.</li>
                     <li>If the value has a <code>@list</code> key, the value MUST be
                       <code>true</code> or <code>false</code>. Merge into the <tref>local context</tref> <tref>list
@@ -837,11 +837,11 @@
     </li>
   </ol>
 
-  <p class="note">It can be difficult to distinguish between a <tref>compact IRI</tref> and an absolute <tref>IRI</tref>,
+  <p class="note">It can be difficult to distinguish between a <tref>compact IRI</tref> and an <tref>absolute IRI</tref>,
     as a <tref>compact IRI</tref> may seem to be a valid IRI <em>scheme</em>. When performing repeated IRI expansion,
     a term used as a prefix may not have a valid mapping due to dependencies in resolving term definitions. By
     continuing <a href="#object-context">Step 2.3.2</a> until no changes are made, mappings to IRIs created
-    using an undefined term prefix will eventually resolve to absolute <tref>IRI</tref>s.</p>
+    using an undefined term prefix will eventually resolve to <tref>absolute IRI</tref>s.</p>
 
   <p class="issue"><a href="https://github.com/json-ld/json-ld.org/issues/43">Issue 43</a>
     concerns performing IRI expansion in the key position of a context definition.</p>
@@ -851,7 +851,12 @@
   <h2>IRI Expansion</h2>
   <p>Keys and some values are evaluated to produce an <tref>IRI</tref>. This section defines an algorithm for
     transforming a value representing an IRI into an actual IRI.</p>
-  <p><tref>IRI</tref>s may be represented as an absolute IRI, a <tref>term</tref> or a <tref>compact IRI</tref>.</p>
+  <p><tref>IRI</tref>s may be represented as an <tref>absolute IRI</tref>, a <tref>term</tref> or a <tref>compact IRI</tref>.</p>
+  <p>An <tdef>absolute IRI</tdef> is defined in [[!RFC3987]] containing a <em>scheme</em> along with
+    <em>path</em> and optional <em>query</em> and fragment segments. A <tdef>relative IRI</tdef> is an IRI
+    that is relative some other <tref>absolute IRI</tref>; in the case of JSON-LD this is the base location
+    of the document.</p>
+
   <p>The algorithm for generating an IRI is:
     <ol class="algorithm">
       <li>Split the value into a <em>prefix</em> and <em>suffix</em> from the first occurrence of ':'.</li>
@@ -865,7 +870,7 @@
   </p>
   <p class="note">
     Previous versions of this specification used <code>@base</code> and <code>@vocab</code> to define IRI prefixes
-    used to resolve relative IRIs. It was determined that this added too much complexity, but the issue
+    used to resolve <tref title="relative IRI">relative IRIs</tref>. It was determined that this added too much complexity, but the issue
     can be re-examined in the future based on community input.
   </p>
 </section>
@@ -1827,12 +1832,13 @@
             <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>
-              If the <tref>active property</tref> is the target of a <code>@list</code> coercion,
-              and the value is an <tref>array</tref>,
+              If the <tref>active property</tref> is an <tref>absolute IRI</tref> and is the
+              target of a <code>@list</code> coercion, and the value is an <tref>array</tref>,
               process the value as a list as described in in <a href="#list-conversion">List Conversion</a>.
             </li>
             <li>
-              Otherwise, create a new <tref>processor state</tref> copies of the <tref>active context</tref>,
+              Otherwise, If the <tref>active property</tref> is an <tref>absolute IRI</tref>,
+              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>.
--- a/spec/latest/json-ld-syntax/index.html	Thu Jan 26 16:40:49 2012 -0800
+++ b/spec/latest/json-ld-syntax/index.html	Thu Jan 26 17:16:24 2012 -0800
@@ -558,7 +558,7 @@
   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]]),
-  <tref>compact IRI</tref>, absolute <tref>IRI</tref>, or
+  <tref>compact IRI</tref>, <tref>absolute IRI</tref>, or
   be an empty string.</p>
 <p>The Web uses <tref title="IRI">IRIs</tref> 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
@@ -703,7 +703,7 @@
 <code>foaf</code> <tref>prefix</tref>. The <code>foaf</code> vocabulary
 contains a term called <strong>name</strong>. If you join the
 <code>foaf</code> <tref>prefix</tref> with the <strong>name</strong> suffix,
-you can build a <tref>compact IRI</tref> that will expand out into an absolute IRI for the
+you can build a <tref>compact IRI</tref> that will expand out into an <tref>absolute IRI</tref> for the
 <code>http://xmlns.com/foaf/0.1/name</code> <tref>vocabulary</tref> term.
 That is, the compact IRI (or short-form), is <code>foaf:name</code> and the
 expanded-form is <code>http://xmlns.com/foaf/0.1/name</code>. This vocabulary
@@ -783,7 +783,7 @@
 
 <ol>
   <li>Except within a <tref>context</tref> definition, <tref>term</tref>s in the key position in
-    a <tref>JSON object</tref> that have a mapping to an <tref>IRI</tref> or another <tref>term</tref> in the
+    a <tref>JSON object</tref> that have a mapping to an <tref>absolute IRI</tref> or another <tref>term</tref> in the
     <tref>active context</tref> are expanded to an IRI by JSON-LD processors.</li>
   <li>An <tref>IRI</tref> is generated for the <tref>string</tref> value specified using
     <code>@id</code> or <code>@type</code>.</li>
@@ -791,8 +791,12 @@
     are <tref>coercion</tref> rules in effect that identify the value as an <code>@id</code>.</li>
 </ol>
 
-<p>IRIs may be represented as an absolute IRI, an IRI that is relative to the
-base location of the document, a <tref>term</tref>, or a <tref>compact IRI</tref>.</p>
+<p>IRIs may be represented as an <tref>absolute IRI</tref>, a <tref>relative IRI</tref>, a <tref>term</tref>, or a <tref>compact IRI</tref>.</p>
+
+<p>An <tdef>absolute IRI</tdef> is defined in [[!RFC3987]] containing a <em>scheme</em> along with
+  <em>path</em> and optional <em>query</em> and fragment segments. A <tdef>relative IRI</tdef> is an IRI
+  that is relative some other <tref>absolute IRI</tref>; in the case of JSON-LD this is the base location
+  of the document.</p>
 
 <p>IRIs can be expressed directly in the key position like so:</p>
 
@@ -847,6 +851,10 @@
 
 <p><tref>Term</tref>s are case sensitive, and MUST be matched using a case-sensitive comparison.</p>
 
+<p>Keys that do not expand to an absolute IRI are ignored.</p>
+<p class="issue">It is not determined if processing proceeds into values of undefined keys. If so,
+  this would result in a graph which is not <tref title="embedding">embedded</tref>.</p>
+
 <p><code>foaf:name</code> above will automatically expand out to the IRI
 <code>http://xmlns.com/foaf/0.1/name</code>. See <a href="#compact-iris">Compact IRIs</a> for more details.</p>
 
@@ -1300,7 +1308,7 @@
     hand for the Friend-of-a-Friend vocabulary, which is identified using
     the IRI <code>http://xmlns.com/foaf/0.1/</code>. A developer may append
     any of the FOAF <tref>vocabulary</tref> terms to the end of the prefix
-    to specify a short-hand version of the absolute IRI for the
+    to specify a short-hand version of the <tref>absolute IRI</tref> for the
     <tref>vocabulary</tref> term. For example, <code>foaf:name</code> would
     be expanded out to the IRI <code>http://xmlns.com/foaf/0.1/name</code>.
     Instead of having to remember and type out the entire IRI, the developer
@@ -1668,7 +1676,7 @@
 
 <p>Type coercion is specified within an <a href="#expanded-term-definition">expanded term definition</a>
   using the <code>@type</code> key. The values of this key represent type IRIs and MUST take the form of
-  <tref>term</tref>, <tref>compact IRI</tref>, absolute <tref>IRI</tref> or the keyword <code>@id</code>. Specifying
+  <tref>term</tref>, <tref>compact IRI</tref>, <tref>absolute IRI</tref> or the keyword <code>@id</code>. Specifying
   <code>@id</code> indicates that within the body of a JSON-LD document, string values of keys coerced as
   <code>@id</code> are to be interpreted as <tref>IRI</tref>s.</p>
 
@@ -2303,7 +2311,7 @@
 
 <div class="note">
 <p>JSON-LD has no equivalent for the Turtle <code>@base</code> declaration. Authors could, of course,
-  use a prefix definition to resolve relative IRIs. For example, an empty prefix could be used
+  use a prefix definition to resolve <tref>relative IRI</tref>s. For example, an empty prefix could be used
   to get a similar effect to <code>@base</code>:</p>
 <pre class="example" data-transform="updateExample">
 <!--