Update to allow blank nodes in graphname, allow missing trailing .
authorGavin Carothers <gavin@carothers.name>
Sat, 15 Jun 2013 13:04:11 -0700
changeset 849 b52836db7bff
parent 848 fc7e3ec6ac43
child 850 7cbc8835794b
Update to allow blank nodes in graphname, allow missing trailing .
trig/index.html
trig/trig-bnf.html
trig/trig.bnf
--- a/trig/index.html	Sat Jun 15 12:31:25 2013 -0700
+++ b/trig/index.html	Sat Jun 15 13:04:11 2013 -0700
@@ -111,7 +111,7 @@
 			that allows an RDF dataset to be completely written in a compact and
 			natural text form, with abbreviations for common usage patterns and
 			datatypes. TriG is an extension of the 
-			Turtle [[!TURTLE-TR]] format.
+			Turtle [[!turtle]] format.
 			</p>
 		</section>
 
@@ -119,7 +119,7 @@
 <p>TriG is intended the meet the charter requirement of the 
 <a href="http://www.w3.org/2011/rdf-wg/">RDF Working Group</a> to
 define an RDF syntax for multiple graphs. TriG is an extension of the 
-Turtle syntax for RDF [[!TURTLE-TR]. The current document is based on
+Turtle syntax for RDF [[!turtle]. The current document is based on
 the original proposal by Chris Bizer and Richard Cyganiak.</p> 
                 </section>
 
@@ -128,7 +128,7 @@
 			<p>This document defines TriG a concrete syntax for RDF as defined in the
 			RDF Concepts and Abstract Syntax
 			([[!RDF11-CONCEPTS]]). TriG is an extension of 
-			Turtle ([[!TURTLE-TR]]), extended 
+			Turtle ([[!turtle]]), extended 
 			to support representing a complete RDF Dataset.
 		</section>
 
@@ -432,7 +432,7 @@
 			<section id="grammar-ebnf">
 				<h3>Grammar</h3>
             <p>The <abbr title="Extended Backus–Naur Form">EBNF</abbr> used here is defined in XML 1.0
-            [[!EBNF-NOTATION]]. Production labels consisting of a number and a final 'g' are unique to TriG. All Production labels consisting of only a number reference the production with that number in the Turtle grammar [[TURTLE-TR]]. Production labels consisting of a number and a final 's', e.g. [<a href="http://www.w3.org/TR/sparql11-query/#rRDFLiteral"><span class="prodNo">60s</span></a>], reference the production with that number in the <a href="http://www.w3.org/TR/sparql11-query/#sparqlGrammar">SPARQL Query Language for RDF grammar</a> [[RDF-SPARQL-QUERY]].
+            [[!EBNF-NOTATION]]. Production labels consisting of a number and a final 'g' are unique to TriG. All Production labels consisting of only a number reference the production with that number in the Turtle grammar [[turtle]]. Production labels consisting of a number and a final 's', e.g. [<a href="http://www.w3.org/TR/sparql11-query/#rRDFLiteral"><span class="prodNo">60s</span></a>], reference the production with that number in the <a href="http://www.w3.org/TR/sparql11-query/#sparqlGrammar">SPARQL Query Language for RDF grammar</a> [[RDF-SPARQL-QUERY]].
             </p>
             	<div data-include="trig-bnf.html"></div>
        
--- a/trig/trig-bnf.html	Sat Jun 15 12:31:25 2013 -0700
+++ b/trig/trig-bnf.html	Sat Jun 15 13:04:11 2013 -0700
@@ -12,17 +12,23 @@
     <td>::=</td>
     <td><a href='#grammar-production-directive'>directive</a> <code>| </code> <a href='#grammar-production-graph'>graph</a></td>
 </tr>
-            <tr id="grammar-production-graph" data-grammar-original="[3g] graph ::= graphIri? &quot;{&quot; (triples &quot;.&quot;)* &quot;}&quot;" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;graphIri&#x27;)), (&quot;&#x27;&quot;, &#x27;{&#x27;), (&#x27;*&#x27;, (&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;triples&#x27;), (&quot;&#x27;&quot;, &#x27;.&#x27;)])), (&quot;&#x27;&quot;, &#x27;}&#x27;)])" >
+            <tr id="grammar-production-graph" data-grammar-original="[3g] graph ::= graphName? &quot;{&quot; triplesBlock? &quot;}&quot;" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;graphName&#x27;)), (&quot;&#x27;&quot;, &#x27;{&#x27;), (&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;triplesBlock&#x27;)), (&quot;&#x27;&quot;, &#x27;}&#x27;)])" >
     <td>[3g]</td>
     <td><code>graph</code></td>
     <td>::=</td>
-    <td><a href='#grammar-production-graphIri'>graphIri</a>? '<code class='grammar-literal'>{</code>' (<a href='#grammar-production-triples'>triples</a> '<code class='grammar-literal'>.</code>')<code class='grammar-star'>*</code> '<code class='grammar-literal'>}</code>'</td>
+    <td><a href='#grammar-production-graphName'>graphName</a>? '<code class='grammar-literal'>{</code>' <a href='#grammar-production-triplesBlock'>triplesBlock</a>? '<code class='grammar-literal'>}</code>'</td>
 </tr>
-            <tr id="grammar-production-graphIri" data-grammar-original="[4g] graphIri ::= iri" data-grammar-expression="(&#x27;id&#x27;, &#x27;iri&#x27;)" >
+            <tr id="grammar-production-graphName" data-grammar-original="[4g] graphName ::= iri| BlankNode" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;iri&#x27;), (&#x27;id&#x27;, &#x27;BlankNode&#x27;)])" >
     <td>[4g]</td>
-    <td><code>graphIri</code></td>
+    <td><code>graphName</code></td>
     <td>::=</td>
-    <td><a href='#grammar-production-iri'>iri</a></td>
+    <td><a href='#grammar-production-iri'>iri</a> <code>| </code> <a href='#grammar-production-BlankNode'>BlankNode</a></td>
+</tr>
+            <tr id="grammar-production-triplesBlock" data-grammar-original="[5g] triplesBlock ::= triples (&#x27;.&#x27; triplesBlock?)?" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;triples&#x27;), (&#x27;?&#x27;, (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;.&#x27;), (&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;triplesBlock&#x27;))]))])" >
+    <td>[5g]</td>
+    <td><code>triplesBlock</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-triples'>triples</a> ('<code class='grammar-literal'>.</code>' <a href='#grammar-production-triplesBlock'>triplesBlock</a>?)?</td>
 </tr>
             <tr id="grammar-production-directive" data-grammar-original="[3] directive ::= prefixID| base | sparqlPrefix | sparqlBase" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;prefixID&#x27;), (&#x27;id&#x27;, &#x27;base&#x27;), (&#x27;id&#x27;, &#x27;sparqlPrefix&#x27;), (&#x27;id&#x27;, &#x27;sparqlBase&#x27;)])" >
     <td>[3]</td>
@@ -162,7 +168,7 @@
     <td>::=</td>
     <td><a href='#grammar-production-BLANK_NODE_LABEL'>BLANK_NODE_LABEL</a> <code>| </code> <a href='#grammar-production-ANON'>ANON</a></td>
 </tr>
-<tr><td colspan="4"><h4 id="terminals">Productions for terminals</h4></td></tr>
+<tr><td colspan="5"><h4 id="terminals">Productions for terminals</h4></td></tr>
             <tr id="grammar-production-IRIREF" data-grammar-original="[19] IRIREF ::=  &#x27;&lt;&#x27; ([^#x00-#x20&lt;&gt;&quot;{}|^`\] | UCHAR)* &#x27;&gt;&#x27;" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;&lt;&#x27;), (&#x27;*&#x27;, (&#x27;|&#x27;, [(&#x27;[&#x27;, &#x27;^#x00-#x20&lt;&gt;&quot;{}|^`\\&#x27;), (&#x27;id&#x27;, &#x27;UCHAR&#x27;)])), (&quot;&#x27;&quot;, &#x27;&gt;&#x27;)])" class='grammar-token'>
     <td>[19]</td>
     <td><code>IRIREF</code></td>
--- a/trig/trig.bnf	Sat Jun 15 12:31:25 2013 -0700
+++ b/trig/trig.bnf	Sat Jun 15 13:04:11 2013 -0700
@@ -3,9 +3,12 @@
 [2g] graph_statement ::= directive 
  | graph
 
-[3g] graph ::= graphIri? "{" (triples ".")* "}"
+[3g] graph ::= graphName? "{" triplesBlock? "}"
 
-[4g] graphIri ::= iri
+[4g] graphName ::= iri 
+| BlankNode 
+
+[5g] triplesBlock ::= triples ('.' triplesBlock?)?
 
 [3] directive ::= prefixID 
  | base | sparqlPrefix | sparqlBase