Major editoral work, include enough to define N-Triples language
authorGavin Carothers <gavin@carothers.name>
Sat, 09 Mar 2013 14:27:25 -0800
changeset 640 71cdb31b7ee4
parent 639 d0925d86f2cd
child 641 c9e76425c1f3
Major editoral work, include enough to define N-Triples language
rdf-turtle/n-triples.html
--- a/rdf-turtle/n-triples.html	Sat Mar 09 14:01:59 2013 -0800
+++ b/rdf-turtle/n-triples.html	Sat Mar 09 14:27:25 2013 -0800
@@ -112,7 +112,63 @@
         N-Triples triples are also Turtle <a href="#simple-triples">simple triples</a>, but Turtle includes other <a href="#terms">representations of RDF Terms</a> and <a href="#predicate-lists">abbreviations of RDF Triples</a>. When parsed by a Turtle parser, data in the N-Triples format will produce exactly the same triples as a parser for the restricted N-triples language.
       </p>
       <p>The RDF graph represented by an N-Triples document contains exactly each triple matching <a href="#prod-ntriples-triple">N-Triples <code>triple</code> production</a>.
-      </section> 
+      </section>
+
+      <section>
+        <h2>N-Triples Language</h2>
+        <section id="simple-triples">
+          <h3>Simple Triples</h3>
+          <p>The simplest triple statement is a sequence of (subject, predicate, object) terms, separated by whitespace and terminated by '<code>.</code>' after each triple.</p>
+          <pre class="example"><script type="application/n-triples"><http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> .</script>
+          </pre>
+        </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-Triples 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-triples">_:alice <http://xmlns.com/foaf/0.1/knows> _:bob .
+_:bob <http://xmlns.com/foaf/0.1/knows> _:alice .</script></pre>
+  </section>
+
+    </section>
+
+      </section>
 
         <section id="n-triple-changes" class="informative">
           <h3>Changes from RDF Test Cases format</h3>
@@ -134,10 +190,12 @@
                 <li>N-Triple parsers
                 <li>N-Triple seralizers
               </ul>
-      <p>A conforming <strong>N-Triple 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-turtleDoc"><code>turtleDoc</code> production</a>. A N-Triple document serializes an RDF graph.</p>
+      <p>A conforming <strong>N-Triple 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-ntriplesDoc"><code>ntriplesDoc</code> production</a>. A N-Triple document serializes an RDF graph.</p>
 
       <p>A conforming <strong>N-Triple parser</strong> is a system capable of reading N-Triple 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 class="issue">N-Triple seralizers are not defined here, will likely include optional behavior to conform to RDF Test Cases syntax as well.</p>
+
       <p>The IRI that identifies the N-Triple language is: <code>http://www.w3.org/ns/formats/N-Triple</code></p>          
 
         <section id="n-triples-mediatype">
@@ -167,6 +225,10 @@
           <div data-include="n-prime-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-diff-turtle" class="appendix informative">
           <h3>Summary of diffrences in N-Triples and Turtle</h3>
@@ -310,7 +372,7 @@
         <h2>N-Triples Internet Media Type, File Extension and Macintosh File Type </h2>
         <dl>
           <dt>Contact:</dt>
-          <dd>????</dd>
+          <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>