--- a/rdf-spaces/index.html Thu May 10 21:48:14 2012 +0100
+++ b/rdf-spaces/index.html Thu May 10 21:48:38 2012 +0100
@@ -33,7 +33,7 @@
// previousMaturity: "REC",
// if there a publicly available Editor's Draft, this is the link
-//@@@
+//
edDraftURI: "http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-spaces/index.html",
// if this is a LCWD, uncomment and set the end of its review period
@@ -93,7 +93,7 @@
doRDFa: true,
};
-// @@@ A number of references have been patched into the local berjon.biblio and need to be added to the global biblio in CVS:
+// A number of references have been patched into the local berjon.biblio and need to be added to the global biblio in CVS:
</script>
@@ -490,6 +490,12 @@
<p>Datasets and quadsets can thus be used interchangeably, with
the more appropriate one being use in any particular context.</p>
+ <p class="note">This is not quite true, in that a dataset can
+ contain the empty graph, which has no exact correspondence to
+ anything in a quadset. In practice, in SPARQL, implementations
+ are free to use quadset semantics. @@@ How can we formalize that
+ here?</p>
+
</section>
</section>
@@ -498,7 +504,7 @@
<h2>Dataset Languages</h2>
<p>This section contains specifications of languages for serializing
- datasets. N-Quads documents and TriG documents have identical
+ datasets. N-Quads documents and Trig documents have identical
semantics, since they each are just serializations of the datasets
and therefore follow <a href="#semantics"
class="sectionRef"></a>.</p>
@@ -510,7 +516,7 @@
except that a fourth term, identifying an RDF space, may
optionally be included on each line, after the "object" term.</p>
- <p>Formally, the N-Quads grammar is <a href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#">the N-Triples
+ <p>Formally, the N-Quads grammar is <a href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#n-triple-grammar">the N-Triples
Grammar</a> modified by removing productions [1] and [2], and
adding the following productions:</p>
@@ -523,7 +529,7 @@
<td><a id="prod-sandro-nquads-nquadsDoc" name="prod-sandro-nquads-nquadsDoc"></a>[<span class="prodNo">1q</span>] </td>
<td><code class="production prod">nquadsDoc</code></td>
<td> ::= </td>
-<td><code class="content">(<span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-statement">statement</a></span>)? (<span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-EOL">EOL</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-statement">statement</a></span>)* (<span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-EOL">EOL</a></span>)?</code></td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-statement">statement</a></span>? (<span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-EOL">EOL</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-statement">statement</a></span>)* <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-EOL">EOL</a></span>?</code></td>
</tr>
</tbody>
@@ -532,7 +538,7 @@
<td><a id="prod-sandro-nquads-statement" name="prod-sandro-nquads-statement"></a>[<span class="prodNo">2q</span>] </td>
<td><code class="production prod">statement</code></td>
<td> ::= </td>
-<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-subject">subject</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-predicate">predicate</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-object">object</a></span> (<span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-space">space</a></span>)? "."</code></td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-subject">subject</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-predicate">predicate</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-object">object</a></span> <span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-space">space</a></span>? "."</code></td>
</tr>
</tbody>
@@ -553,7 +559,7 @@
<code class="production prod" id="prod-sandro-nquads-predicate">predicate</code>
<code class="production prod" id="prod-sandro-nquads-object">object</code>, and
<code class="production prod" id="prod-sandro-nquads-IRIREF">IRIREF</code> are defined in the <a
-href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#">the
+href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#n-triple-grammar">the
N-Triples Grammar</a></p>
</div>
@@ -572,20 +578,137 @@
<section>
- <h3>TriG</h3>
+ <h3>Trig</h3>
- <p>The syntax of TriG is the same as the syntax of Turtle except
- that (name, graph) pairs can be specified by giving an option
- GRAPH keyword, a "name" term, and a nested Turtle graph expression
+ <p>The syntax of Trig is the same as the syntax of Turtle except
+ that (name, graph) pairs can be specified by giving an optional
+ <tt>GRAPH</tt> keyword, a "name" term, and a nested Turtle graph expression
in curly braces.</p>
- <pre class="example">@prefix :eg <http://example.org/>.
-eg:subject eg:predicate eg:object1.
-eg:subject eg:predicate eg:object2.
-eg:space1 { eg:subject eg:predicate eg:object1. }
-eg:space2 { eg:subject eg:predicate eg:object1. }</pre>
- <p>This example shows the same dataset as the N-Quads example.</p>
+ <p>Formally, the Trig grammar is <a
+ href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#sec-grammar-grammar">the
+ Turtle Grammar</a> modified by removing productions [1] and [2],
+ and adding the following productions:</p>
+
+ <div style="margin: 1em; margin-top: 0; padding: 1em; border: 1px solid gray;">
+ <table border="0">
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-trig-trigDoc" name="prod-trig-trigDoc"></a>[<span class="prodNo">1g</span>] </td>
+<td><code class="production prod">trigDoc</code></td>
+<td> ::= </td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-trig-statement">statement</a></span>*</code></td>
+</tr>
+</tbody>
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-trig-statement" name="prod-trig-statement"></a>[<span class="prodNo">2g</span>] </td>
+<td><code class="production prod">statement</code></td>
+<td> ::= </td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-trig-directive">directive</a></span> "." | <span class="prod"><a class="grammarRef" href="#prod-trig-triples">triples</a></span> "." | <span class="prod"><a class="grammarRef" href="#prod-trig-naming">naming</a></span> | <span class="prod"><a class="grammarRef" href="#prod-trig-wrappedDefault">wrappedDefault</a></span></code></td>
+</tr>
+</tbody>
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-trig-naming" name="prod-trig-naming"></a>[<span class="prodNo">3g</span>] </td>
+<td><code class="production prod">naming</code></td>
+<td> ::= </td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-trig-GRAPH">GRAPH</a></span>? <span class="prod"><a class="grammarRef" href="#prod-trig-IRI_REF">IRI_REF</a></span> "{" <span class="prod"><a class="grammarRef" href="#prod-trig-triples">triples</a></span> "."? "}"</code></td>
+</tr>
+</tbody>
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-trig-wrappedDefault" name="prod-trig-wrappedDefault"></a>[<span class="prodNo">4g</span>] </td>
+<td><code class="production prod">wrappedDefault</code></td>
+<td> ::= </td>
+<td><code class="content">"{" <span class="prod"><a class="grammarRef" href="#prod-trig-triples">triples</a></span> "."? "}"</code></td>
+</tr>
+</tbody>
+
+<tbody class="term">
+<tr valign="baseline">
+<td><a id="term-trig-GRAPH" name="term-trig-GRAPH"></a>[<span class="prodNo">5g</span>] </td>
+<td><code class="production term">GRAPH</code></td>
+<td> ::= </td>
+<td><code class="content">"GRAPH"</code></td>
+</tr>
+</tbody>
+ </table>
+
+
+<p>The grammar symbols
+
+<code class="production prod" id="prod-trig-directive">directive</code>,
+<code class="production prod" id="prod-trig-triples">triples</code> and
+<code class="production prod" id="prod-trig-IRI_REF">IRI_REF</code>
+
+are defined in <a
+href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#sec-grammar-grammar">the
+Turtle Grammar</a>
+</p>
+
+
+ </div>
+
+
+ <p>Parsing a Trig document is like parsing a Turtle document
+ except:</p>
+ <ol>
+
+ <li>The result is a <a>dataset</a>, not an RDF Graph</li>
+
+ <li>The triples generated during parsing of the <code
+ class="prod production">naming</code> production go into a
+ <a>named graph</a>, with the name being the <code class="prod
+ production">IRI_REF</code>.</li>
+
+ <li>The triples generated during other parsing go into the
+ default graph.</li>
+
+ </ol>
+
+ <p>Note that the grammar forbids directives between curly braces
+ and empty curly-brace expressions. Also, note that blank node
+ processing is not affected by curly braces, so conceptually blank
+ node identifiers are scoped to the entire document.</p>
+
+ <p>There is no requirement that <a>named graph</a> names be unique
+ in a document, or that triples in the default graph be
+ continguous. For example, these two Trig document parse to exactly
+ the same Dataset:</p>
+
+ <pre class="example"># Trig Example 1
+ @prefix : <http://example.org/>.
+ :a :b 1.
+ :s1 { :a :b 10 }
+ :s2 { :a :b 20 }
+ :s1 { :a :b 11 }
+ :s2 { :a :b 21 }
+ :a :b 2.
+</pre>
+
+ <pre class="example"># Trig Example 2
+ @prefix : <http://example.org/>.
+ :a :b 1,2.
+ :s1 { :a :b 10,11. }
+ :s2 { :a :b 20,21. }
+</pre>
+
+ <p>The same dataset could be expressed in N-Quads as:</p>
+
+ <pre style="overflow-x:scroll; width:800px;" class="example"># N-Quads for TriG Example 1 and 2
+<http://example/org/a> <http://example/org/b> "1"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example/org/a> <http://example/org/b> "2"^^<http://www.w3.org/2001/XMLSchema#integer>.
+<http://example/org/a> <http://example/org/b> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example/org/s1>.
+<http://example/org/a> <http://example/org/b> "11"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example/org/s1>.
+<http://example/org/a> <http://example/org/b> "20"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example/org/s2>.
+<http://example/org/a> <http://example/org/b> "21"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example/org/s2>.
+</pre>
<p class="issue">Are braces around default-graph triples required,
optional, or disallowed? Assuming "optional" for now.
@@ -603,8 +726,6 @@
<p class="issue">Can blank node labels be used as space names?
Assuming not, for now.</p>
- <p>@@@ grammar, etc, based of Turtle spec</p>
-
</section>
</section>
@@ -639,12 +760,10 @@
<section> <!-- I don't like what respec does with id=conformance -->
<h2>Conformance</h2>
- <p>Something like: If a space has a URL, and you get a 200 response
- dereferencing that URL, the the response MUST be a serialization of
- the triples on that space, give or take synchronization (caching)
- issues. </p>
-
- <p>What else?</p>
+ <p>@@@ what to say here? Maybe including something like: If a space
+ has a URL, and you get a 200 response dereferencing that URL, the
+ the response MUST be a serialization of the triples on that space,
+ give or take synchronization (caching) issues. </p>
</section>
@@ -1133,7 +1252,7 @@
<section class="appendix informative" id="changes">
<h2>Changes</h2>
<ul>
- <li>2012-05-10: Wrote a short intro. Started writing the Use Cases section for real. Added grammar for N-Quads.</li>
+ <li>2012-05-10: Wrote a short intro. Started writing the Use Cases section for real. Added grammar for N-Quads and Trig.</li>
<li>2012-05-09: Renamed "layers" as "spaces"; some word-smithing in Concepts and the Abstract; removed "Turtle in HTML" as a dataset syntax; added some text about trig and nquads; added a note about change-over-time; added an appendix with a reflection vocabulary</li>
<li>2012-05-02: Removed obsolete text from the introduction, removed the section on datasets borrowed from RDF Concepts, and added many entries to Concepts (and renamed it from Terminology).</li>
<li>2012-05-01: Starting with a little text from RDF Concepts, a few ideas, and the text from <a href="http://www.w3.org/2011/rdf-wg/wiki/Layers">Layers</a></li>
@@ -1142,6 +1261,6 @@
- </body>
+</body>
</html>