Remove @base and @iri. This resolves issue #26.
--- a/spec/latest/json-ld-api/index.html Wed Dec 14 16:01:01 2011 -0800
+++ b/spec/latest/json-ld-api/index.html Wed Dec 14 16:34:04 2011 -0800
@@ -676,7 +676,6 @@
in all algorithms described in this section:</p>
<dl>
- <dt><code>@base</code></dt><dd>Used to set the base <tref>IRI</tref> for all object IRIs affected by the <tref>active context</tref>.</dd>
<dt><code>@coerce</code></dt><dd>Used to specify type coercion rules.</dd>
<dt><code>@context</code></dt><dd>Used to set the <tref>local context</tref>.</dd>
<dt><code>@datatype</code></dt><dd>Used to specify the datatype for a literal.</dd>
@@ -684,7 +683,6 @@
<dt><code>@language</code></dt><dd>Used to specify the language for a literal.</dd>
<dt><code>@literal</code></dt><dd>Used to specify a literal value.</dd>
<dt><code>@type</code></dt><dd>Used to set the type of the active subject.</dd>
- <dt><code>@vocab</code></dt><dd>Used to set the base <tref>IRI</tref> for all property IRIs affected by the <tref>active context</tref>.</dd>
<dt><code>:</code></dt><dd>The separator for JSON keys and values that use the <tref>prefix</tref> mechanism.</dd>
</dl>
</section>
@@ -798,15 +796,6 @@
</li>
<li>If <em>value</em> is a <tref>JSON object</tref>, perform the following steps:
<ol class="algorithm">
- <li>If <em>value</em> has a <code>@base</code> key, it MUST have a value of a simple
- <tref>string</tref> with the lexical form of an absolute IRI. Add the base mapping to the <tref>local
- context</tref>.
- <p class="issue">Turtle allows @base to be relative. If we did this, we
- would have to add <a href="#iri-expansion">IRI Expansion</a>.</p></li>
- <li>If <em>value</em> has a <code>@vocab</code> key, it MUST have a value of a simple
- <tref>string</tref> with the lexical form of an absolute IRI. Add the vocabulary mapping to the
- <tref>local context</tref> after performing <a href="#iri-expansion">IRI Expansion</a> on
- the associated value.</li>
<li>If <em>value</em> has a <code>@coerce</code> key, it MUST have a value of a
<tref>JSON object</tref>. Add the <code>@coerce</code> mapping to the <tref>local context</tref>
performing <a href="#iri-expansion">IRI Expansion</a> on the associated value(s).</li>
@@ -853,15 +842,11 @@
<h3>Initial Context</h3>
<p>The <tref>initial context</tref> is initialized as follows:</p>
<ul>
- <li><code>@base</code> is set using <cite><a href="http://www.ietf.org/rfc/rfc2396.txt">section 5.1 Establishing a
- Base URI</a></cite> of [[RFC3986]]. Processors MAY provide a means
- of setting the base IRI programatically.</li>
<li><code>@coerce</code> is set with a single mapping from <code>@id</code> to <code>@type</code>.</li>
</ul>
<pre class="example" data-transform="updateExample">
<!--
{
- "@base": ****document-location****,
"@coerce": {
"@id": "@type"
}
@@ -874,8 +859,7 @@
<h2>IRI Expansion</h2>
<p>Keys and some values are evaluated to produce an IRI. This section defines an algorithm for
transforming a value representing an IRI into an actual IRI.</p>
- <p>IRIs may be represented as an absolute IRI, a <tref>term</tref>, a <tref>prefix</tref>:suffix construct, or as a value relative to <code>@base</code>
- or <code>@vocab</code>.</p>
+ <p>IRIs may be represented as an absolute IRI, a <tref>term</tref> or a <tref>prefix</tref>:suffix construct.</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>
@@ -883,15 +867,14 @@
<li>If the <tref>active context</tref> contains a <tref>term</tref> mapping for <em>prefix</em>, generate an IRI
by prepending the mapped prefix to the (possibly empty) suffix using textual concatenation. Note that an empty
suffix and no suffix (meaning the value contains no ':' string at all) are treated equivalently.</li>
- <li>If the IRI being processed is represented as a <em>term</em> (or has an empty <em>prefix</em>) and is for a
- property (i.e., a key's value in a <tref>JSON object</tref>, or a value in a <code>@coerce</code> mapping) and
- the active context has a <code>@vocab</code> mapping, join the mapped value to the suffix using textual concatenation.</li>
- <li>If the IRI being processed is represented as a <em>term</em> (or has an empty <em>prefix</em>) and is for
- a subject or object (i.e., not a property) and the active context has a <code>@base</code> mapping,
- join the mapped value to the suffix using the method described in [[!RFC3986]].</li>
<li>Otherwise, use the value directly as an IRI.</li>
</ol>
</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
+ can be re-examined in the future based on community input.
+ </p>
</section>
<section>
@@ -902,14 +885,6 @@
<p>The algorithm for generating a compacted IRI is:
<ol class="algorithm">
- <li>If the IRI is for a property, and <code>@vocab</code> is not
- null and matches the beginning of the IRI, the resulting compacted
- IRI is the unmatched portion of the original IRI.
- <li>Otherwise, if the IRI is for a subject or object, and
- <code>@base</code> is not null and matches the beginning of the IRI, the
- resulting compacted IRI is the shortest subset of the original IRI such that
- joining against <code>@base</code> using the method described in [[!RFC3986]]
- results in the original IRI.</li>
<li>Otherwise, search every key-value pair in the <tref>active context</tref> for
a <tref>term</tref> that is a complete match
against the IRI. If a complete match is found, the resulting compacted
--- a/spec/latest/json-ld-syntax/index.html Wed Dec 14 16:01:01 2011 -0800
+++ b/spec/latest/json-ld-syntax/index.html Wed Dec 14 16:34:04 2011 -0800
@@ -412,7 +412,6 @@
in all algorithms described in this section:</p>
<dl>
- <dt><code>@base</code></dt><dd>Used to set the base <tref>IRI</tref> for all object IRIs affected by the <tref>active context</tref>.</dd>
<dt><code>@coerce</code></dt><dd>Used to specify type coercion rules.</dd>
<dt><code>@context</code></dt><dd>Used to set the <tref>local context</tref>.</dd>
<dt><code>@datatype</code></dt><dd>Used to specify the datatype for a literal.</dd>
@@ -420,7 +419,6 @@
<dt><code>@language</code></dt><dd>Used to specify the language for a literal.</dd>
<dt><code>@literal</code></dt><dd>Used to specify a literal value.</dd>
<dt><code>@type</code></dt><dd>Used to set the type of the active subject.</dd>
- <dt><code>@vocab</code></dt><dd>Used to set the base <tref>IRI</tref> for all property IRIs affected by the <tref>active context</tref>.</dd>
<dt><code>:</code></dt><dd>The separator for JSON keys and values that use the <tref>prefix</tref> mechanism.</dd>
</dl>
</section>
@@ -785,7 +783,7 @@
effect for that key that identify it as a <code>@id</code>.</li>
</ol>
-<p>IRIs may be represented as an absolute IRI, a <tref>term</tref>, a <tref>prefix</tref>:suffix construct, or as a value relative to <code>@base</code> or <code>@vocab</code>. Relative IRIs are resolved against <code>@vocab</code> if they are in a key position, or the value of <code>@type</code> key, otherwise they are resolved against <code>@base</code>.</p>
+<p>IRIs may be represented as an absolute IRI, a <tref>term</tref>, or a <tref>prefix</tref>:suffix construct.</p>
<p class="note">
As there it is possible to confuse <tref>term</tref>s or <tref>prefix</tref>es with relative IRIs, as
@@ -1350,67 +1348,6 @@
</section>
<section>
-<h3>Base IRI</h3>
-<p>JSON-LD allows <tref>IRI</tref>s to be specified in a relative form. For <tref>subject</tref> and <tref>object</tref>
- IRIs, relative IRIs are resolved against the document base using
- <cite><a href="http://www.ietf.org/rfc/rfc2396.txt">section 5.1 Establishing a
- Base URI</a></cite> of [[RFC3986]]. This value may be explicitly
- set with a <tref>context</tref> using the <code>@base</code> keyword.</p>
-
-<p>For example, if a JSON-LD document was retrieved from <code>http://manu.sporny.org/</code>,
- relative IRIs would resolve against that IRI:</p>
-
-<pre class="example" data-transform="updateExample">
-<!--
-{
- ****"@id": "about/"****,
- "http://xmlns.com/foaf/0.1/name": "Manu Sporny",
- "http://xmlns.com/foaf/0.1/homepage: ""
-}
--->
-</pre>
-
-<p>This document uses an empty <code>@id</code>, which resolves to the document base. However, if
- the document is moved to a different location, the subject IRI would change. To prevent this, a <tref>context</tref>
- may have a <code>@base</code> mapping, to set an absolute base for the document in spite of where
- it actually is retrieved from. It MUST have a value of a simple
- <tref>string</tref> with the lexical form of an absolute <tref>IRI</tref>.</p>
-
-<pre class="example" data-transform="updateExample">
-<!--
-{
- ****"@context": { "@base": "http://manu.sporny.org/" }****,
- "@id": "about/",
- "http://xmlns.com/foaf/0.1/name": "Manu Sporny",
- "http://xmlns.com/foaf/0.1/homepage: ""
-}
--->
-</pre>
-</section>
-
-<section>
-<h3>Default Vocabulary</h3>
-<p>It is often common that all types and properties come from the same vocabulary. JSON-LD provides
- a way to set a base IRI to be used for all properties and types that aren't based on terms,
- prefixes or absolute IRIs. Much like the <code>@base</code> keyword, the <code>@vocab</code> keyword
- can be used to set a base <tref>IRI</tref> to use for all types and properties that don't otherwise resolve to
- an absolute <tref>IRI</tref>. The <code>@vocab</code> mapping MUST have a value of a simple string with the
- lexical form of an absolute IRI.</p>
-
-<pre class="example" data-transform="updateExample">
-<!--
-{
- ****"@context": { "@vocab": "http://xmlns.com/foaf/1.0/" },****
- ****"@type": "Person"****,
- "name": "Manu Sporny",
- "homepage": "http://manu.sporny.org/",
- "avatar": "http://twitter.com/account/profile_image/manusporny"
-}
--->
-</pre>
-</section>
-
-<section>
<h3>Default Language</h3>
<p>JSON-LD allows a default value to use as the language for <tref>plain literal</tref>s.
@@ -1536,10 +1473,7 @@
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).
+ prefix is an underscore (<code>_</code>), the IRI remains unchanged.
</p>
<p>
The ability to use <tref>prefix</tref>es reduces the need for developers
@@ -1878,17 +1812,16 @@
<p>The following are examples of representing <tref>RDF</tref> as expressed in [[TURTLE]] into JSON-LD.</p>
<section>
-<h4>Prefix and Base definitions</h4>
-<p>The JSON-LD context has direct equivalents for Turtle <code>@base</code> and <code>@prefix</code> expressions:</p>
+<h4>Prefix definitions</h4>
+<p>The JSON-LD context has direct equivalents for the Turtle <code>@prefix</code> declaration:</p>
<pre class="example" data-transform="updateExample">
<!--
-@base <http://manu.sporny.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-<#me> a foaf:Person;
+<http://manu.sporny.org/#me> a foaf:Person;
foaf:name "Manu Sporny";
- foaf:homepage <> .
+ foaf:homepage <http://manu.sporny.org/> .
-->
</pre>
@@ -1896,16 +1829,35 @@
<!--
{
"@context": {
- "@base": "http://manu.sporny.org/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
- "@id": "#me",
+ "@id": "http://manu.sporny.org/#me",
"@type": "foaf:Person",
"foaf:name": "Manu Sporny",
- "foaf:homepage": { "@id": "" }
+ "foaf:homepage": { "@id": "http://manu.sporny.org/" }
}
-->
</pre>
+
+<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
+ to get a similar effect to <code>@base</code>:</p>
+<pre class="example" data-transform="updateExample">
+<!--
+{
+ "@context": {
+ ****"": "http://manu.sporny.org/",****
+ "foaf": "http://xmlns.com/foaf/0.1/"
+ },
+ "@id": ****":#me"****,
+ "@type": "foaf:Person",
+ "foaf:name": "Manu Sporny",
+ "foaf:homepage": { "@id": ****":" ****}
+}
+-->
+</pre>
+</div>
</section>
<section>
@@ -1929,10 +1881,10 @@
<!--
{
"@context": {
- "@base": "http://manu.sporny.org/",
+ "": "http://manu.sporny.org/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
- "@id": "#me",
+ "@id": ":#me",
"@type": "foaf:Person",
"foaf:name": "Manu Sporny",
"foaf:knows": {
@@ -1960,7 +1912,6 @@
<!--
{
"@context": {
- "@base": "http://manu.sporny.org/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
"@id": "http://example.org/people#joebob",