Starting N-Quads spec
authorGavin Carothers <gavin@carothers.name>
Sat, 09 Mar 2013 17:15:43 -0800
changeset 644 9d3d552c7e5f
parent 643 992611da363e
child 645 09d795631a53
child 658 f37d5b0130c8
Starting N-Quads spec
nquads/index.html
nquads/nquads-bnf.html
nquads/nquads.bnf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nquads/index.html	Sat Mar 09 17:15:43 2013 -0800
@@ -0,0 +1,277 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>N-Quads</title>
+    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
+  <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' class='remove'></script>
+  <script src='../ReSpec.js/js/respec.js' class='remove'></script>
+    <script class='remove'>
+      var respecConfig = {
+          // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
+          specStatus:           "ED",
+          
+          // the specification's short name, as in http://www.w3.org/TR/short-name/
+          shortName:            "n-quads",
+
+          // if your specification has a subtitle that goes below the main
+          // formal title, define it here
+          subtitle   :  "A line-based syntax for an RDF datasets",
+
+          // if you wish the publication date to be other than today, set this
+          // publishDate:  "2009-08-06",
+
+          // if the specification's copyright date is a range of years, specify
+          // the start date here:
+          copyrightStart: "2008",
+
+          // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
+          // and its maturity status
+          // previousPublishDate:  "1977-03-15",
+          // previousMaturity:  "WD",
+
+          // if there a publicly available Editor's Draft, this is the link
+          edDraftURI:           "http://dvcs.w3.org/hg/rdf/raw-file/default/nquads/index.html",
+
+          // if this is a LCWD, uncomment and set the end of its review period
+          // lcEnd: "2009-08-05",
+
+          // if you want to have extra CSS, append them to this list
+          // it is recommended that the respec.css stylesheet be kept
+          extraCSS:             ["http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],
+
+          // editors, add as many as you like
+          // only "name" is required
+          editors:  [
+              { name: "Gavin Carothers", url: "http://gavin.carothers.name/",
+    company: "Lex Machina, Inc", companyURL: "https://lexmachina.com/" },
+          ],
+
+          // authors, add as many as you like. 
+          // This is optional, uncomment if you have authors as well as editors.
+          // only "name" is required. Same format as editors.
+
+          // name of the WG
+          wg:           "RDF Working Group",
+          
+          // URI of the public WG page
+          wgURI:        "http://www.w3.org/2011/rdf-wg/",
+          
+          // name (with the @w3c.org) of the public mailing to which comments are due
+          wgPublicList: "public-rdf-comments",
+          
+          // URI of the patent status for this WG, for Rec-track documents
+          // !!!! IMPORTANT !!!!
+          // This is important for Rec-track documents, do not copy a patent URI from a random
+          // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
+          // Team Contact.
+          wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/46168/status",
+          doRDFa: true,
+      };
+    </script>
+      <style type="text/css">
+    /* Style Turtle script blocks to be visable */
+    pre.example script {
+        display:block;
+    }
+    .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>
+    <section id='abstract'>
+    N-Quads is a line-based, plain text format for encoding an RDF graph.
+</section>
+
+      <section id="sec-intro">
+        <h2>Introduction</h2>
+        <p>This document defines an easy to parse line-based language named N-Quads.</p>
+    <p>N-quads statments are a sequence of RDF terms representing the subject, predicate, object and graph label of an RDF Triple and the graph it is part of in a dataset. These may be seperated by white space (spaces <code>#x20</code> or tabs <code>#x9</code>). This sequence is terminated by a '<code>.</code>' and a new line (optional at the end of a document).
+    </p>
+
+      <pre class="example"><script type="application/n-quads"><http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> <http://example.org/graph3> . # comments here
+# or on a line by themselves
+_:subject1 <http://an.example/predicate1> "object1" <http://example.org/graph1> .
+_:subject2 <http://an.example/predicate2> "object2" <http://example.org/graph5> .
+</script></pre>
+
+      </section>
+
+      <section>
+        <h2>N-Quads Language</h2>
+        <section id="simple-triples">
+          <h3>Simple Statements</h3>
+          <p>The simplest statement is a sequence of (subject, predicate, object) terms forming an RDF triple and an optional IRI labeling what graph in a dataset the triple belongs to, all are separated by whitespace and terminated by '<code>.</code>' after each statement.</p>
+          <pre class="example"><script type="application/n-quads"><http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> <http://example.org/graphs/spiderman> .</script>
+          </pre>
+          <p>The graph label IRI can be ommited, in which case the triples are considered part of the default graph of the RDF dataset.<p>
+        </section>
+              <section id="sec-iri">
+        <h3>IRIs</h3>
+
+        <p>
+            <a href="../rdf-concepts/index.html#dfn-iri">IRIs</a> may be written only as absolute IRIs. 
+            IRIs are enclosed in '&lt;' and '&gt;' and may contain <a href="#numeric">numeric escape sequences</a> (described below). For example <code>&lt;http://example.org/#green-goblin&gt;</code>.
+        </p>
+      </section>
+        <section id="sec-literals">
+              <h3>RDF Literals</h3>
+
+        <p><a href="../rdf-concepts/index.html#dfn-literal">Literals</a> are used to identify values such as strings, numbers, dates.</p>
+
+
+        <p>
+          Literals (Grammar production <a href="#grammar-production-RDFLiteral">RDFLiteral</a>) have a lexical form followed by a language tag, a datatype IRI, or neither.
+          The representation of the lexical form consists of an initial delimiter <code>"</code> (<span class="codepoint">U+0022</span>), a sequence of permitted characters or <a href="#numeric">numeric escape sequence</a> or <a href="#string">string escape sequence</a>, and a final delimiter. Literals may not contain the characters <code>"</code>, <code title="LINE FEED"><sub>LF</sub></code>, or <code title="CARRIAGE RETURN"><sub>CR</sub></code>. In addition '<code>\</code>' (<span class="codepoint">U+005C</span>) may not appear in any quoted literal except as part of an escape sequence.
+          The corresponding <a href="../rdf-concepts/index.html#dfn-lexical-form">RDF lexical form</a> is the characters between the delimiters, after processing any escape sequences.
+          If present, the <a href="../rdf-concepts/index.html#dfn-language-tagged-string">language tag</a> is preceded by a '<code>@</code>' (<span class="codepoint">U+0040</span>).
+          If there is no language tag, there may be a <a href="../rdf-concepts/index.html#dfn-datatype-URI">datatype IRI</a>, preceeded by '<code>^^</code>' (<span class="codepoint">U+005E</span> <span class="codepoint">U+005E</span>). If there is no datatype IRI and no language tag, the datatype is <code>xsd:string</code>.
+        </p>
+        <p class="issue">
+          Include examples with a few escapes for new lines, etc
+        </p>
+        </section>
+      <section id="BNodes">
+        <h3>RDF Blank Nodes</h3>
+        <p>
+          <a href="../rdf-concepts/index.html#dfn-blank-node">RDF blank nodes</a> in N-Quads are expressed as <code>_:</code> followed by a blank node label which is a series of name characters.
+          The characters in the label are built upon <a href="#grammar-production-PN_CHARS_BASE">PN_CHARS_BASE</a>, liberalized as follows:
+        </p>
+        <ul>
+          <li>The characters <code>_</code> and digits may appear anywhere in a blank node label.</li>
+          <li>The character <code>.</code> may appear anywhere except the first or last character.</li>
+          <li>The characters <code>-</code>, <code>U+00B7</code>, <code>U+0300</code> to <code>U+036F</code> and <code>U+203F</code> to <code>U+2040</code> are permitted anywhere except the first character.</li>
+        </ul>
+        <p>
+          A fresh RDF blank node is allocated for each unique blank node label in a document.
+          Repeated use of the same blank node label identifies the same RDF blank node.
+        </p>
+        <pre class="example"><script type="application/n-quads">_:alice <http://xmlns.com/foaf/0.1/knows> _:bob <http://example.org/graphs/john> .
+_:bob <http://xmlns.com/foaf/0.1/knows> _:alice <http://example.org/graphs/james> .</script></pre>
+  </section>
+
+    </section>
+
+      </section>
+      <section id="conformance">
+          <p>This specification defines conformance criteria for:</p>
+              <ul>
+                <li>N-Quad documents
+                <li>N-Quad parsers
+              </ul>
+      <p>A conforming <strong>N-Quad document</strong> is a Unicode string that conforms to the grammar and additional constraints defined in <a href="#sec-grammar" class="sectionRef"></a>, starting with the <a href="#grammar-production-nquadsDoc"><code>nquadsDoc</code> production</a>. A N-Quad document serializes an RDF dataset.</p>
+
+      <p>A conforming <strong>N-Quad parser</strong> is a system capable of reading N-Quad documents on behalf of an application. It makes the serialized RDF graph, as defined in <a href="#sec-parsing" class="sectionRef"></a>, available to the application, usually through some form of API.</p>
+
+      <p>The IRI that identifies the N-Quad language is: <code>http://www.w3.org/ns/formats/N-Quad</code></p>          
+
+        <section id="sec-mediatype">
+      <h2>Media Type and Content Encoding</h2>
+          
+      <p>The media type of N-Quads is <code>application/n-quads</code>.
+      The content encoding of N-Quads is always UTF-8. 
+      See <a href="#sec-mediaReg">N-Quads Media Type</a> for the media type 
+      registration form.
+      </p>
+        </section>
+        </section>
+
+        <section id="sec-grammar">
+          <h3>Grammar</h3>
+          <p>A N-Quads document is a Unicode[[!UNICODE]] character string encoded in UTF-8.
+          Unicode codepoints only in the range U+0 to U+10FFFF inclusive are allowed.</p>
+          <p>The <abbr title="Extended Backus–Naur Form">EBNF</abbr> used here is defined in XML 1.0
+            [[!EBNF-NOTATION]].</p>
+          <p><a href="#sec-escapes">Escape sequence rules</a> are the same as Turtle. However, as only the <code>STRING_LITERAL2</code> production is allowed new lines in literals MUST be escaped.</p>
+          <div data-include="nquads-bnf.html">
+          </div>
+        </section>
+        <section id="sec-parsing">
+          <h3>Parsing</h3>
+          <p class="issue">It may be simple, but should still be defined.</p>
+        </section>
+
+      <section id="sec-mediaReg" class="appendix">
+        <h2>N-Quads Internet Media Type, File Extension and Macintosh File Type </h2>
+        <dl>
+          <dt>Contact:</dt>
+          <dd>Eric Prud'hommeaux</dd>
+          <dt>See also:</dt>
+
+          <dd><a href="http://www.w3.org/2002/06/registering-mediatype">How to Register a Media Type for a W3C Specification</a></dd>
+          <dd><a href="http://www.w3.org/2001/tag/2002/0129-mime">Internet Media Type registration, consistency of use</a><br />TAG Finding 3 June 2002 (Revised 4 September 2002)</dd>
+        </dl>
+        <p>The Internet Media Type / MIME Type for N-Quads is &quot;application/n-quads&quot;.</p>
+        <p>It is recommended that N-Quads files have the extension &quot;.nq&quot; (all lowercase) on all platforms.</p>
+
+        <p>It is recommended that N-Quads files stored on Macintosh HFS file systems be given a file type of &quot;TEXT&quot;.</p>
+        <p>This information that follows will be submitted to the IESG for review, approval, and registration with IANA.</p>
+        <dl>
+          <dt>Type name:</dt>
+          <dd>application</dd>
+
+          <dt>Subtype name:</dt>
+          <dd>n-quads</dd>
+          <dt>Required parameters:</dt>
+          <dd>None</dd>
+          <dt>Optional parameters:</dt>
+          <dd>None</dd>
+
+          <dt>Encoding considerations:</dt>
+          <dd>The syntax of N-Quads is expressed over code points in Unicode [[!UNICODE]]. The encoding is always UTF-8 [[!UTF-8]].</dd>
+          <dd>Unicode code points may also be expressed using an \uXXXX (U+0 to U+FFFF) or \UXXXXXXXX syntax (for U+10000 onwards) where X is a hexadecimal digit [0-9A-F]</dd>
+          <dt>Security considerations:</dt>
+          <dd>N-Quads is a general-purpose assertion language; applications may evaluate given data to infer more assertions or to dereference IRIs, invoking the security considerations of the scheme for that IRI. Note in particular, the privacy issues in [[!RFC3023]] section 10 for HTTP IRIs. Data obtained from an inaccurate or malicious data source may lead to inaccurate or misleading conclusions, as well as the dereferencing of unintended IRIs. Care must be taken to align the trust in consulted resources with the sensitivity of the intended use of the data; inferences of potential medical treatments would likely require different trust than inferences for trip planning.</dd>
+
+          <dd>N-Quads is used to express arbitrary application data; security considerations will vary by domain of use. Security tools and protocols applicable to text (e.g. PGP encryption, MD5 sum validation, password-protected compression) may also be used on N-Quads documents. Security/privacy protocols must be imposed which reflect the sensitivity of the embedded information.</dd>
+          <dd>N-Quads can express data which is presented to the user, for example, RDF Schema labels. Application rendering strings retrieved from untrusted N-Quads documents must ensure that malignant strings may not be used to mislead the reader. The security considerations in the media type registration for XML ([[!RFC3023]] section 10) provide additional guidance around the expression of arbitrary data and markup.</dd>
+          <dd>N-Quads uses IRIs as term identifiers. Applications interpreting data expressed in N-Quads should address the security issues of
+      <a class="norm" href="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource Identifiers (IRIs)</a> [[!RFC3987]] Section 8, as well as
+      <a class="norm" href="http://www.ietf.org/rfc/rfc3986.txt">Uniform Resource Identifier (URI): Generic Syntax</a> [[!RFC3986]] Section 7.</dd>
+
+          <dd>Multiple IRIs may have the same appearance. Characters in different scripts may 
+    look similar (a Cyrillic &quot;&#1086;&quot; may appear similar to a Latin &quot;o&quot;). A character followed 
+    by combining characters may have the same visual representation as another character 
+    (LATIN SMALL LETTER E followed by COMBINING ACUTE ACCENT has the same visual representation 
+    as LATIN SMALL LETTER E WITH ACUTE).
+    <!-- (<code>foo:resum&#40751;code> and <code>f&#1086;&#1086;:resume&#769;</code>)-->
+    Any person or application that is writing or interpreting data in Turtle must take care to use the IRI that matches the intended semantics, and avoid IRIs that make look similar.
+    Further information about matching of similar characters can be found 
+    in <a class="inform" href="http://www.unicode.org/reports/tr36/">Unicode Security 
+    Considerations</a> [[UNISEC]] and
+    <a class="norm" href="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource 
+    Identifiers (IRIs)</a> [[RFC3987]] Section 8.
+      </dd>
+
+          <dt>Interoperability considerations:</dt>
+          <dd>There are no known interoperability issues.</dd>
+          <dt>Published specification:</dt>
+          <dd>This specification.</dd>
+          <dt>Applications which use this media type:</dt>
+
+          <dd>No widely deployed applications are known to use this media type. It may be used by some web services and clients consuming their data.</dd>
+          <dt>Additional information:</dt>
+          <dt>Magic number(s):</dt>
+          <dd>None.</dd>
+          <dt>File extension(s):</dt>
+          <dd>".nt"</dd>
+
+          <dt>Macintosh file type code(s):</dt>
+          <dd>&quot;TEXT&quot;</dd>
+          <dt>Person &amp; email address to contact for further information:</dt>
+
+          <dd>Eric Prud'hommeaux &lt;eric@w3.org&gt;</dd>
+          <dt>Intended usage:</dt>
+          <dd>COMMON</dd>
+          <dt>Restrictions on usage:</dt>
+          <dd>None</dd>
+          <dt>Author/Change controller:</dt>
+
+          <dd>The N-Quads specification is the product of the RDF WG. The W3C reserves change control over this specifications.</dd>
+        </dl>
+      </section>
+
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nquads/nquads-bnf.html	Sat Mar 09 17:15:43 2013 -0800
@@ -0,0 +1,118 @@
+<table  class="grammar">
+    <tbody class="grammar-productions">
+            <tr id="grammar-production-nquadsDoc" data-grammar-original="[1]  nquadsDoc          ::= statement? (EOL triple)* EOL?" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;statement&#x27;)), (&#x27;*&#x27;, (&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;EOL&#x27;), (&#x27;id&#x27;, &#x27;triple&#x27;)])), (&#x27;?&#x27;, (&#x27;id&#x27;, &#x27;EOL&#x27;))])" >
+    <td>[1]</td>
+    <td><code>nquadsDoc</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-statement'>statement</a>? (<a href='#grammar-production-EOL'>EOL</a> <a href='#grammar-production-triple'>triple</a>)<code class='grammar-star'>*</code> <a href='#grammar-production-EOL'>EOL</a>?</td>
+</tr>
+            <tr id="grammar-production-statement" data-grammar-original="[2]  statement          ::= WS* subject WS+ predicate WS+ object WS+ graphLabel WS* &#x27;.&#x27; WS*" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;*&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;)), (&#x27;id&#x27;, &#x27;subject&#x27;), (&#x27;+&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;)), (&#x27;id&#x27;, &#x27;predicate&#x27;), (&#x27;+&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;)), (&#x27;id&#x27;, &#x27;object&#x27;), (&#x27;+&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;)), (&#x27;id&#x27;, &#x27;graphLabel&#x27;), (&#x27;*&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;)), (&quot;&#x27;&quot;, &#x27;.&#x27;), (&#x27;*&#x27;, (&#x27;id&#x27;, &#x27;WS&#x27;))])" >
+    <td>[2]</td>
+    <td><code>statement</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-WS'>WS</a><code class='grammar-star'>*</code> <a href='#grammar-production-subject'>subject</a> <a href='#grammar-production-WS'>WS</a><code class='grammar-plus'>+</code> <a href='#grammar-production-predicate'>predicate</a> <a href='#grammar-production-WS'>WS</a><code class='grammar-plus'>+</code> <a href='#grammar-production-object'>object</a> <a href='#grammar-production-WS'>WS</a><code class='grammar-plus'>+</code> <a href='#grammar-production-graphLabel'>graphLabel</a> <a href='#grammar-production-WS'>WS</a><code class='grammar-star'>*</code> '<code class='grammar-literal'>.</code>' <a href='#grammar-production-WS'>WS</a><code class='grammar-star'>*</code></td>
+</tr>
+            <tr id="grammar-production-subject" data-grammar-original="[3]  subject            ::= IRIREF | BLANK_NODE_LABEL" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;IRIREF&#x27;), (&#x27;id&#x27;, &#x27;BLANK_NODE_LABEL&#x27;)])" >
+    <td>[3]</td>
+    <td><code>subject</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-IRIREF'>IRIREF</a> <code>| </code> <a href='#grammar-production-BLANK_NODE_LABEL'>BLANK_NODE_LABEL</a></td>
+</tr>
+            <tr id="grammar-production-predicate" data-grammar-original="[4]  predicate          ::= IRIREF" data-grammar-expression="(&#x27;id&#x27;, &#x27;IRIREF&#x27;)" >
+    <td>[4]</td>
+    <td><code>predicate</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-IRIREF'>IRIREF</a></td>
+</tr>
+            <tr id="grammar-production-object" data-grammar-original="[5]  object             ::= IRIREF | BLANK_NODE_LABEL | literal" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;IRIREF&#x27;), (&#x27;id&#x27;, &#x27;BLANK_NODE_LABEL&#x27;), (&#x27;id&#x27;, &#x27;literal&#x27;)])" >
+    <td>[5]</td>
+    <td><code>object</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-IRIREF'>IRIREF</a> <code>| </code> <a href='#grammar-production-BLANK_NODE_LABEL'>BLANK_NODE_LABEL</a> <code>| </code> <a href='#grammar-production-literal'>literal</a></td>
+</tr>
+            <tr id="grammar-production-graphLabel" data-grammar-original="[6]  graphLabel         ::= IRIREF" data-grammar-expression="(&#x27;id&#x27;, &#x27;IRIREF&#x27;)" >
+    <td>[6]</td>
+    <td><code>graphLabel</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-IRIREF'>IRIREF</a></td>
+</tr>
+            <tr id="grammar-production-literal" data-grammar-original="[7]  literal            ::= STRING_LITERAL_QUOTE (&#x27;^^&#x27; IRIREF | (&#x27;@&#x27; LANG) )?" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;STRING_LITERAL_QUOTE&#x27;), (&#x27;?&#x27;, (&#x27;|&#x27;, [(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;^^&#x27;), (&#x27;id&#x27;, &#x27;IRIREF&#x27;)]), (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;@&#x27;), (&#x27;id&#x27;, &#x27;LANG&#x27;)])]))])" >
+    <td>[7]</td>
+    <td><code>literal</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-STRING_LITERAL_QUOTE'>STRING_LITERAL_QUOTE</a> ('<code class='grammar-literal'>^^</code>' <a href='#grammar-production-IRIREF'>IRIREF</a> <code>| </code> '<code class='grammar-literal'>@</code>' <a href='#grammar-production-LANG'>LANG</a>)?</td>
+</tr>
+<tr><td colspan="5"><h4 id="terminals">Productions for terminals</h4></td></tr>
+            <tr id="grammar-production-LANG" data-grammar-original="[8]  LANG               ::= [a-zA-Z]+ ( &quot;-&quot; [a-zA-Z0-9]+ )*" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z&#x27;)), (&#x27;*&#x27;, (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;-&#x27;), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z0-9&#x27;))]))])" class='grammar-token'>
+    <td>[8]</td>
+    <td><code>LANG</code></td>
+    <td>::=</td>
+    <td>[<code class='grammar-chars'>a-zA-Z</code>]<code class='grammar-plus'>+</code> ('<code class='grammar-literal'>-</code>' [<code class='grammar-chars'>a-zA-Z0-9</code>]<code class='grammar-plus'>+</code>)<code class='grammar-star'>*</code></td>
+</tr>
+            <tr id="grammar-production-EOL" data-grammar-original="[9]  EOL                ::= [#xD#xA]+" data-grammar-expression="(&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;#xD#xA&#x27;))" class='grammar-token'>
+    <td>[9]</td>
+    <td><code>EOL</code></td>
+    <td>::=</td>
+    <td>[<code class='grammar-chars'>#xD#xA</code>]<code class='grammar-plus'>+</code></td>
+</tr>
+            <tr id="grammar-production-WS" data-grammar-original="[10]  WS                 ::= [#x20#x9]" data-grammar-expression="(&#x27;[&#x27;, &#x27;#x20#x9&#x27;)" class='grammar-token'>
+    <td>[10]</td>
+    <td><code>WS</code></td>
+    <td>::=</td>
+    <td>[<code class='grammar-chars'>#x20#x9</code>]</td>
+</tr>
+            <tr id="grammar-production-IRIREF" data-grammar-original="[11] 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>[11]</td>
+    <td><code>IRIREF</code></td>
+    <td>::=</td>
+    <td>'<code class='grammar-literal'>&lt;</code>' ([<code class='grammar-chars'>^#x00-#x20&lt;&gt;\&quot;{}|^`\</code>] <code>| </code> <a href='#grammar-production-UCHAR'>UCHAR</a>)<code class='grammar-star'>*</code> '<code class='grammar-literal'>&gt;</code>'</td>
+</tr>
+            <tr id="grammar-production-STRING_LITERAL_QUOTE" data-grammar-original="[12] STRING_LITERAL_QUOTE ::= &#x27;&quot;&#x27; ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* &#x27;&quot;&#x27;" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;&quot;&#x27;), (&#x27;*&#x27;, (&#x27;|&#x27;, [(&#x27;[&#x27;, &#x27;^#x22#x5C#xA#xD&#x27;), (&#x27;id&#x27;, &#x27;ECHAR&#x27;), (&#x27;id&#x27;, &#x27;UCHAR&#x27;)])), (&quot;&#x27;&quot;, &#x27;&quot;&#x27;)])" class='grammar-token'>
+    <td>[12]</td>
+    <td><code>STRING_LITERAL_QUOTE</code></td>
+    <td>::=</td>
+    <td>'<code class='grammar-literal'>&quot;</code>' ([<code class='grammar-chars'>^#x22#x5C#xA#xD</code>] <code>| </code> <a href='#grammar-production-ECHAR'>ECHAR</a> <code>| </code> <a href='#grammar-production-UCHAR'>UCHAR</a>)<code class='grammar-star'>*</code> '<code class='grammar-literal'>&quot;</code>'</td>
+</tr>
+            <tr id="grammar-production-BLANK_NODE_LABEL" data-grammar-original="[141s] BLANK_NODE_LABEL ::= &#x27;_:&#x27; ( PN_CHARS_U | [0-9] ) ((PN_CHARS|&#x27;.&#x27;)* PN_CHARS)?" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;_:&#x27;), (&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;PN_CHARS_U&#x27;), (&#x27;[&#x27;, &#x27;0-9&#x27;)]), (&#x27;?&#x27;, (&#x27;,&#x27;, [(&#x27;*&#x27;, (&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;PN_CHARS&#x27;), (&quot;&#x27;&quot;, &#x27;.&#x27;)])), (&#x27;id&#x27;, &#x27;PN_CHARS&#x27;)]))])" class='grammar-token'>
+    <td>[141s]</td>
+    <td><code>BLANK_NODE_LABEL</code></td>
+    <td>::=</td>
+    <td>'<code class='grammar-literal'>_:</code>' (<a href='#grammar-production-PN_CHARS_U'>PN_CHARS_U</a> <code>| </code> [<code class='grammar-chars'>0-9</code>]) ((<a href='#grammar-production-PN_CHARS'>PN_CHARS</a> <code>| </code> '<code class='grammar-literal'>.</code>')<code class='grammar-star'>*</code> <a href='#grammar-production-PN_CHARS'>PN_CHARS</a>)?</td>
+</tr>
+            <tr id="grammar-production-UCHAR" data-grammar-original="[13] UCHAR ::= ( &quot;\u&quot; HEX HEX HEX HEX )| ( &quot;\U&quot; HEX HEX HEX HEX HEX HEX HEX HEX )" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;\\u&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;)]), (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;\\U&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;), (&#x27;id&#x27;, &#x27;HEX&#x27;)])])" class='grammar-token'>
+    <td>[13]</td>
+    <td><code>UCHAR</code></td>
+    <td>::=</td>
+    <td>'<code class='grammar-literal'>\u</code>' <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <code>| </code> '<code class='grammar-literal'>\U</code>' <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a> <a href='#grammar-production-HEX'>HEX</a></td>
+</tr>
+            <tr id="grammar-production-ECHAR" data-grammar-original="[153s] ECHAR ::= &quot;\&quot; [tbnrf&quot;&#x27;]" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;\\&#x27;), (&#x27;[&#x27;, &#x27;tbnrf&quot;\&#x27;&#x27;)])" class='grammar-token'>
+    <td>[153s]</td>
+    <td><code>ECHAR</code></td>
+    <td>::=</td>
+    <td>'<code class='grammar-literal'>\</code>' [<code class='grammar-chars'>tbnrf&quot;&#x27;</code>]</td>
+</tr>
+            <tr id="grammar-production-PN_CHARS_BASE" data-grammar-original="[157s] PN_CHARS_BASE    ::= [A-Z]| [a-z]| [#x00C0-#x00D6]| [#x00D8-#x00F6]| [#x00F8-#x02FF]| [#x0370-#x037D]| [#x037F-#x1FFF]| [#x200C-#x200D]| [#x2070-#x218F]| [#x2C00-#x2FEF]| [#x3001-#xD7FF]| [#xF900-#xFDCF]| [#xFDF0-#xFFFD]| [#x10000-#xEFFFF]" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;[&#x27;, &#x27;A-Z&#x27;), (&#x27;[&#x27;, &#x27;a-z&#x27;), (&#x27;[&#x27;, &#x27;#x00C0-#x00D6&#x27;), (&#x27;[&#x27;, &#x27;#x00D8-#x00F6&#x27;), (&#x27;[&#x27;, &#x27;#x00F8-#x02FF&#x27;), (&#x27;[&#x27;, &#x27;#x0370-#x037D&#x27;), (&#x27;[&#x27;, &#x27;#x037F-#x1FFF&#x27;), (&#x27;[&#x27;, &#x27;#x200C-#x200D&#x27;), (&#x27;[&#x27;, &#x27;#x2070-#x218F&#x27;), (&#x27;[&#x27;, &#x27;#x2C00-#x2FEF&#x27;), (&#x27;[&#x27;, &#x27;#x3001-#xD7FF&#x27;), (&#x27;[&#x27;, &#x27;#xF900-#xFDCF&#x27;), (&#x27;[&#x27;, &#x27;#xFDF0-#xFFFD&#x27;), (&#x27;[&#x27;, &#x27;#x10000-#xEFFFF&#x27;)])" class='grammar-token'>
+    <td>[157s]</td>
+    <td><code>PN_CHARS_BASE</code></td>
+    <td>::=</td>
+    <td>[<code class='grammar-chars'>A-Z</code>] <code>| </code> [<code class='grammar-chars'>a-z</code>] <code>| </code> [<code class='grammar-chars'>#x00C0-#x00D6</code>] <code>| </code> [<code class='grammar-chars'>#x00D8-#x00F6</code>] <code>| </code> [<code class='grammar-chars'>#x00F8-#x02FF</code>] <code>| </code> [<code class='grammar-chars'>#x0370-#x037D</code>] <code>| </code> [<code class='grammar-chars'>#x037F-#x1FFF</code>] <code>| </code> [<code class='grammar-chars'>#x200C-#x200D</code>] <code>| </code> [<code class='grammar-chars'>#x2070-#x218F</code>] <code>| </code> [<code class='grammar-chars'>#x2C00-#x2FEF</code>] <code>| </code> [<code class='grammar-chars'>#x3001-#xD7FF</code>] <code>| </code> [<code class='grammar-chars'>#xF900-#xFDCF</code>] <code>| </code> [<code class='grammar-chars'>#xFDF0-#xFFFD</code>] <code>| </code> [<code class='grammar-chars'>#x10000-#xEFFFF</code>]</td>
+</tr>
+            <tr id="grammar-production-PN_CHARS_U" data-grammar-original="[158s] PN_CHARS_U       ::=  PN_CHARS_BASE| &#x27;_&#x27;| &#x27;:&#x27;" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;PN_CHARS_BASE&#x27;), (&quot;&#x27;&quot;, &#x27;_&#x27;), (&quot;&#x27;&quot;, &#x27;:&#x27;)])" class='grammar-token'>
+    <td>[158s]</td>
+    <td><code>PN_CHARS_U</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-PN_CHARS_BASE'>PN_CHARS_BASE</a> <code>| </code> '<code class='grammar-literal'>_</code>' <code>| </code> '<code class='grammar-literal'>:</code>'</td>
+</tr>
+            <tr id="grammar-production-PN_CHARS" data-grammar-original="[160s] PN_CHARS         ::= PN_CHARS_U| &quot;-&quot;| [0-9]| #x00B7| [#x0300-#x036F]| [#x203F-#x2040]" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;PN_CHARS_U&#x27;), (&quot;&#x27;&quot;, &#x27;-&#x27;), (&#x27;[&#x27;, &#x27;0-9&#x27;), (&#x27;#&#x27;, &#x27;#x00B7&#x27;), (&#x27;[&#x27;, &#x27;#x0300-#x036F&#x27;), (&#x27;[&#x27;, &#x27;#x203F-#x2040&#x27;)])" class='grammar-token'>
+    <td>[160s]</td>
+    <td><code>PN_CHARS</code></td>
+    <td>::=</td>
+    <td><a href='#grammar-production-PN_CHARS_U'>PN_CHARS_U</a> <code>| </code> '<code class='grammar-literal'>-</code>' <code>| </code> [<code class='grammar-chars'>0-9</code>] <code>| </code> <code class='grammar-char-escape'>#x00B7</code> <code>| </code> [<code class='grammar-chars'>#x0300-#x036F</code>] <code>| </code> [<code class='grammar-chars'>#x203F-#x2040</code>]</td>
+</tr>
+            <tr id="grammar-production-HEX" data-grammar-original="[162s] HEX              ::= [0-9] | [A-F] | [a-f]" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;[&#x27;, &#x27;0-9&#x27;), (&#x27;[&#x27;, &#x27;A-F&#x27;), (&#x27;[&#x27;, &#x27;a-f&#x27;)])" class='grammar-token'>
+    <td>[162s]</td>
+    <td><code>HEX</code></td>
+    <td>::=</td>
+    <td>[<code class='grammar-chars'>0-9</code>] <code>| </code> [<code class='grammar-chars'>A-F</code>] <code>| </code> [<code class='grammar-chars'>a-f</code>]</td>
+</tr>
+</table>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nquads/nquads.bnf	Sat Mar 09 17:15:43 2013 -0800
@@ -0,0 +1,46 @@
+[1]  nquadsDoc          ::= statement? (EOL triple)* EOL?
+[2]  statement          ::= WS* subject WS+ predicate WS+ object WS+ graphLabel WS* '.' WS*
+[3]  subject            ::= IRIREF | BLANK_NODE_LABEL
+[4]  predicate          ::= IRIREF 
+[5]  object             ::= IRIREF | BLANK_NODE_LABEL | literal
+[6]  graphLabel         ::= IRIREF
+[7]  literal            ::= STRING_LITERAL_QUOTE ('^^' IRIREF | ('@' LANG) )?
+
+@terminals
+
+[8]  LANG               ::= [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )*
+
+[9]  EOL                ::= [#xD#xA]+
+[10]  WS                 ::= [#x20#x9]
+
+[11] IRIREF ::=  '<' ([^#x00-#x20<>\"{}|^`\] | UCHAR)* '>'
+[12] STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"' 
+
+[141s] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
+[13] UCHAR ::= ( "\u" HEX HEX HEX HEX ) 
+ | ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX ) 
+[153s] ECHAR ::= "\" [tbnrf"'] 
+[157s] PN_CHARS_BASE    ::= [A-Z] 
+                        | [a-z] 
+                        | [#x00C0-#x00D6] 
+                        | [#x00D8-#x00F6] 
+                        | [#x00F8-#x02FF] 
+                        | [#x0370-#x037D] 
+                        | [#x037F-#x1FFF] 
+                        | [#x200C-#x200D] 
+                        | [#x2070-#x218F] 
+                        | [#x2C00-#x2FEF] 
+                        | [#x3001-#xD7FF] 
+                        | [#xF900-#xFDCF] 
+                        | [#xFDF0-#xFFFD] 
+                        | [#x10000-#xEFFFF] 
+[158s] PN_CHARS_U       ::=  PN_CHARS_BASE 
+                        | '_' 
+                        | ':'
+[160s] PN_CHARS         ::= PN_CHARS_U 
+                        | "-" 
+                        | [0-9] 
+                        | #x00B7 
+                        | [#x0300-#x036F] 
+                        | [#x203F-#x2040] 
+[162s] HEX              ::= [0-9] | [A-F] | [a-f]
\ No newline at end of file