Add example using relative IRI to section 5.2 IRIs
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 12 Mar 2013 19:11:50 +0100
changeset 1427 5f284949249f
parent 1426 6e334ea37fe8
child 1428 2aff1ca02a09
Add example using relative IRI to section 5.2 IRIs

This addresses #224.
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Tue Mar 12 18:54:20 2013 +0100
+++ b/spec/latest/json-ld-syntax/index.html	Tue Mar 12 19:11:50 2013 +0100
@@ -523,7 +523,7 @@
       possible to apply a custom context using the JSON-LD API [[JSON-LD-API]].</p>
 
     <p>In <tref title="JSON-LD document">JSON-LD documents</tref>
-      <tref title="context">contexts</tref< may also be specified in-line.
+      <tref title="context">contexts</tref> may also be specified in-line.
       This has the advantage that documents can be processed even in the
       absence of a connection to the Web.</p>
 
@@ -567,8 +567,41 @@
     relative to the <tdef>base IRI</tdef> associated with the document, which
     is typically the directory path containing the document.</p>
 
-  <p><tref title="absolute iri">IRIs</tref> can be expressed directly in the key
-    position like so:</p>
+  <p>A <tref>string</tref> is interpreted as an <tref>IRI</tref> when it is the
+    value of an <code>@id</code> member:</p>
+
+  <pre class="example" data-transform="updateExample"
+       title="Values of @id are interpreted as IRI">
+  <!--
+  {
+  ...
+    "homepage": { "****@id****": "http://example.com/" }
+  ...
+  }
+  -->
+  </pre>
+
+  <p>Values that are interpreted as <tref title="IRI">IRIs</tref>, can also be
+    expressed as <tref title="relative IRI">relative IRIs</tref>. For example,
+    assuming that the following document is located at
+    <code>http://example.com/about/</code>, the <tref>relative IRI</tref>
+    <code>../</code> would expand to <code>http://example.com/</code> (for more
+    information on where  <tref title="relative IRI">relative IRIs</tref> can be
+    used, please refer to appendix <a href="#json-ld-grammar"></a>).
+
+  <pre class="example" data-transform="updateExample"
+       title="IRIs can be relative">
+  <!--
+  {
+  ...
+    "homepage": { "****@id****": "../" }
+  ...
+  }
+  -->
+  </pre>
+
+  <p><tref title="absolute iri">Absolute IRIs</tref> can be expressed directly
+    in the key position like so:</p>
 
   <pre class="example" data-transform="updateExample"
        title="IRI as a key">
@@ -606,20 +639,6 @@
   <p>JSON keys that do not expand to an <tref>IRI</tref>, such as <code>status</code>
     in the example above, are not Linked Data and thus ignored when processed.</p>
 
-  <p>A <tref>string</tref> is interpreted as an <tref>IRI</tref> when it is the
-    value of an <code>@id</code> member:</p>
-
-  <pre class="example" data-transform="updateExample"
-       title="Expanded IRI definition">
-  <!--
-  {
-  ...
-    "homepage": { "****@id****": "http://manu.sporny.org" }
-  ...
-  }
-  -->
-  </pre>
-
   <p>If type <tref>coercion</tref> rules are specified in the <code>@context</code> for
     a particular <tref>term</tref> or property IRI, an IRI is generated:</p>