Renamed section "Vocabulary Prefixes" to "Prefixes" to reflect the fact that prefixes might be used for other use cases as well and added more details about prefix:suffix expansion. Closes #37.
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 07 Nov 2011 13:10:51 +0800
changeset 262 abb798ef8a55
parent 261 574b314a1f2c
child 263 ecca6311be8b
Renamed section "Vocabulary Prefixes" to "Prefixes" to reflect the fact that prefixes might be used for other use cases as well and added more details about prefix:suffix expansion. Closes #37.
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Mon Nov 07 11:50:52 2011 +0800
+++ b/spec/latest/json-ld-syntax/index.html	Mon Nov 07 13:10:51 2011 +0800
@@ -878,7 +878,7 @@
 -->
 </pre>
 
-<p><tref>Prefix</tref>es are expanded when if the form of the value is <code>prefix:suffix</code>, and the
+<p><tref>Prefix</tref>es are expanded when the form of the value is <code>prefix:suffix</code>, and the
   prefix matches a <tref>term</tref> defined within the <tref>active context</tref>:</p>
 
 <pre class="example" data-transform="updateExample">
@@ -893,7 +893,7 @@
 </pre>
 
 <p><code>foaf:name</code> above will automatically expand out to the IRI
-<code>http://xmlns.com/foaf/0.1/name</code>.</p>
+<code>http://xmlns.com/foaf/0.1/name</code>. See <a href="#prefixes">Prefixes</a> for more details.</p>
 
 <p>An <tref>IRI</tref> is generated when a value is associated with a key using
 the <code>@iri</code> keyword:</p>
@@ -1407,7 +1407,7 @@
 -->
 </pre>
 <section>
-  <h2>Vocabulary Prefixes</h2>
+  <h2>Prefixes</h2>
   <p>
     Vocabulary terms in <tref>Linked Data</tref> documents may draw from a number of
     different Web vocabularies. At times, declaring every single term that
@@ -1423,8 +1423,8 @@
     <tref>IRI</tref> to a <tref>Web Vocabulary</tref>.
     Generally, these prefixes are used by concatenating the <em>prefix</em> and
     a <em>suffix</em> separated by a colon (<code>:</code>).
-    The <tref>prefix</tref> is a <tref>term</tref> taken from the <tref>active context</tref>,
-    a short string that identifies a particular Web vocabulary.
+    The <tref>prefix</tref> is a <tref>term</tref> taken from the <tref>active context</tref>
+    and is a short string identifying a particular <tref>IRI</tref> in a JSON-LD document.
     For example, the prefix <code>foaf</code> may be used as a short
     hand for the Friend-of-a-Friend Web Vocabulary, which is identified using
     the IRI <code>http://xmlns.com/foaf/0.1/</code>. A developer may append any of
@@ -1435,6 +1435,17 @@
     and type out the entire IRI, the developer can instead use the prefix in
     their JSON-LD markup.
   </p>
+  <p>To generate an <tref>IRI</tref> out of a <code>prefix:suffix</code> construct,
+    the value is first split into a <em>prefix</em> and <em>suffix</em> at the first
+    occurrence of a colon (<code>:</code>). If the <tref>active context</tref> contains a term
+    mapping for <em>prefix</em>, an IRI is generated by prepending the mapped
+    <em>prefix</em> to the (possibly empty) <em>suffix</em> using textual concatenation.
+    If no prefix mapping is defined, the value is used directly as an IRI. If the
+    prefix is an underscore (<code>_</code>), the IRI remains unchanged. If the
+    IRI being processed has an empty prefix, the <em>suffix</em> is processed like a
+    relative IRI (see <a href="#base-iri">Base IRI</a> and
+    <a href="#default-vocabulary">Default Vocabulary</a> for details).
+  </p>
   <p>
     The ability to use <tref>prefix</tref>es reduces the need for developers
     to declare every vocabulary term that they intend to use in