added grammar for n-quads
authorSandro Hawke <sandro@hawke.org>
Thu, 10 May 2012 14:22:03 -0400
changeset 340 65d609e667ab
parent 339 fd6570919e3e
child 341 3c69f5e33303
added grammar for n-quads
rdf-spaces/index.html
--- a/rdf-spaces/index.html	Thu May 10 08:08:32 2012 -0400
+++ b/rdf-spaces/index.html	Thu May 10 14:22:03 2012 -0400
@@ -46,7 +46,7 @@
 
           // if you want to have extra CSS, append them to this list
           // it is recommended that the respec.css stylesheet be kept
-          extraCSS:             ["http://dvcs.w3.org/hg/rdf/raw-file/default/ReSpec.js/css/respec.css", "http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-spaces/local.css"],
+          extraCSS:             ["http://dvcs.w3.org/hg/rdf/raw-file/default/ReSpec.js/css/respec.css"],
 
           // editors, add as many as you like
           // only "name" is required
@@ -95,6 +95,34 @@
 
 // @@@ A number of references have been patched into the local berjon.biblio and need to be added to the global biblio in CVS:
     </script>
+
+    
+    <style type="text/css">
+
+     .alert {
+         padding: 1em; 
+         margin: 0em; 
+         margin-bottom: 2em; 
+
+         border:2px solid blue; 
+
+         box-shadow: 10px 10px 5px #888;
+         -moz-box-shadow: 10px 10px 5px #888;
+         -webkit-box-shadow: 10px 10px 5px #888;
+
+         -moz-border-radius: 5px;
+         -webkit-border-radius: 5px;
+         -khtml-border-radius: 5px;
+         border-radius: 5px;
+     }
+
+    .separated thead tr th { border:1px solid black; padding: .2em; }
+    .separated tbody tr td { border:1px solid black; text-align: center; }
+    .separated tbody tr td.r { text-align: right; padding: .5em; }
+    .grammar td { font-family: monospace;}
+    .grammar-literal { color: gray;}
+    </style> 
+	
   </head>
 
   <body>
@@ -482,18 +510,54 @@
     except that a fourth term, identifying an RDF space, may
     optionally 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
+    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" class="grammar">
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-sandro-nquads-nquadsDoc" name="prod-sandro-nquads-nquadsDoc"></a>[<span class="prodNo">1q</span>]&nbsp;&nbsp;&nbsp;</td>
+<td><code class="production prod">nquadsDoc</code></td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</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>
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-sandro-nquads-statement" name="prod-sandro-nquads-statement"></a>[<span class="prodNo">2q</span>]&nbsp;&nbsp;&nbsp;</td>
+<td><code class="production prod">statement</code></td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</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>
+
+<tbody class="prod">
+<tr valign="baseline">
+<td><a id="prod-sandro-nquads-space" name="prod-sandro-nquads-space"></a>[<span class="prodNo">3q</span>]&nbsp;&nbsp;&nbsp;</td>
+<td><code class="production prod">space</code></td>
+<td>&nbsp;&nbsp;&nbsp;::=&nbsp;&nbsp;&nbsp;</td>
+<td><code class="content"><span class="prod"><a class="grammarRef" href="#prod-sandro-nquads-IRIREF">IRIREF</a></span></code></td>
+</tr>
+</tbody>
+
+</table>
+</div>
+
+    <p>The following example shows a <a>quadset</a> consisting of two
+    triples and two <a>quads</a>.  The quads both use the same triple,
+    but express the fact that it is in two spaces, "space1" and
+    "space2".</p>
+
     <pre class="example">&lt;http://example.org/subject> &lt;http://example.org/predicate> &lt;http://example.org/object1>.
 &lt;http://example.org/subject> &lt;http://example.org/predicate> &lt;http://example.org/object2>.
 &lt;http://example.org/subject> &lt;http://example.org/predicate> &lt;http://example.org/object1> &lt;http://example.org/space1> .
 &lt;http://example.org/subject> &lt;http://example.org/predicate> &lt;http://example.org/object1> &lt;http://example.org/space2>.</pre>
 
-    <p>This example shows a <a>quadset</a> consisting of two triples
-    and two <a>quads</a>.  The quads both use the same triple, but
-    express the fact that is is in two spaces, "space1" and
-    "space2".</p>
-
-    <p>@@@ grammar, etc, based of Turtle spec</p>
-
   </section>
 
 
@@ -1059,7 +1123,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</li>
+    <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-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>