~ changed Quoted Literals from N-Turtle's introduction of ""-d literals.
--- a/rdf-turtle/index.html Wed Jun 27 08:32:07 2012 -0700
+++ b/rdf-turtle/index.html Wed Jun 27 20:06:24 2012 -0400
@@ -114,6 +114,7 @@
pre.example script {
display:block;
}
+ .separated { border-collapse:collapse; }
.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; }
@@ -266,7 +267,7 @@
</p>
<p>
- A prefixed name is a prefix label and a local part, separated by a colon ":".
+ A <em id="prefixed-name">prefixed name</em> is a prefix label and a local part, separated by a colon ":".
A prefixed name is turned into an IRI by concatenating the IRI associated with the prefix and the local part. The <code>@prefix</code> directive associates a prefix label with an IRI.
Subsequent <code>@prefix</code> directives may re-map the same prefix label. </p>
@@ -335,21 +336,30 @@
<h3>Quoted Literals</h3>
<p>
- Quoted Literals (Grammar production <a href="#grammar-production-RDFLiteral">RDFLiteral</a>) in Turtle have a lexical form followed by a language tag, a datatype IRI, or neither.
- The representation of the lexical form consists of a delimiting <code>"</code>, a sequence of characters matching the regular expression <code>[^\"\\\n\r]</code> or <a href="#numeric">numeric escape sequence</a> or <a href="#string">string escape sequence</a>, and a final delimiting <code>"</code>.
- The corresponding <a href="../rdf-concepts/index.html#dfn-lexical-form">RDF lexical form</a> is the characters between the <code>""</code>s, after processing any escape sequences.
+ Quoted 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, e.g. <code>"</code>, 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.
+ 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>.
- 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>. The datatype IRI in Turtle may be written using either an <a href="#sec-iri">absolute IRI, a relative IRI or prefixed name</a>. If there is no datatype IRI and no language tag, the datatype is <code>xsd:string</code>.
+ 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>. The datatype IRI in Turtle may be written using either an <a href="#sec-iri">absolute IRI</a>, a <a href="#sec-iri">relative IRI</a>, or <a href="#prefixed-name">prefixed name</a>. If there is no datatype IRI and no language tag, the datatype is <code>xsd:string</code>.
</p>
<p>
- Besides the <code>"</code> delimited literal there are three other representations of the lexical form:
+ The follow table correlates delimiters with the chacters which may be embedded between the delimiters, using <code><sub>LF</sub></code> and <code><sub>CR</sub></code> for LINE FEED (<code>\n</code>) and CARRIAGE RETURN (<code>\r</code>) respecively. <!-- ␊␍ -->
</p>
- <ul>
- <li>Literals delimited by <code>'</code>, which contain escape characters and characters matching the pattern <code>[^'\\\n\r]</code>.</li>
- <li>Literals delimited by <code>"""</code>, which permit up to two <code>"</code>s, as well as <code>\r</code> and <code>\n</code>.</li>
- <li>Literals delimited by <code>'''</code>, which permit up to two <code>'</code>s, as well as <code>\r</code> and <code>\n</code>.</li>
- </ul>
+ <table class="separated">
+ <thead>
+ <tr>
+ <th>Delimiter</th>
+ <th>Permitted character pattern</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr><td><code>'</code></td><td><code>[^'\<sub>LF</sub><sub>CR</sub>]</code></td></tr>
+ <tr><td><code>"</code></td><td><code>[^"\<sub>LF</sub><sub>CR</sub>]</code></td></tr>
+ <tr><td><code>'''</code></td><td><code>("'" | "''")? [^'\]</code></td></tr>
+ <tr><td><code>"""</code></td><td><code>('"' | '""')? [^"\]</code></td></tr>
+ </tbody>
+ </table>
<pre class="example"><script type="text/turtle">@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix show: <http://example.org/vocab/show/> .
@@ -359,14 +369,15 @@
show:218 show:localName "That Seventies Show"@en . # literal with a language tag
show:218 show:localName 'Cette Série des Années Soixante-dix'@fr . # literal delimited by single quote
show:218 show:localName "Cette Série des Années Septante"@fr-be . # literal with a region subtag
-show:218 show:blurb '''This is a
-multi-line, single-quoted literal.''' . # literal with embedded new line
+show:218 show:blurb '''This is a multi-line # literal with embedded new lines and quotes
+literal with many quotes (""""")
+and up to two sequential apostrophes ('').''' .
</script></pre>
</section>
<section id="abbrev">
<h3>Numbers</h3>
- <p>Numbers can be written with lexical form and datatype (Example: <code>"-5.0"^^xsd:decimal</code>) but Turtle has syntax for writing integer values, arbitrary precision decimal values, double precision floating point values.</p>
- <table>
+ <p>Numbers can be written like other literals with lexical form and datatype (e.g. <code>"-5.0"^^xsd:decimal</code>). Turtle has a shorthand syntax for writing integer values, arbitrary precision decimal values, and double precision floating point values.</p>
+ <table class="separated">
<thead>
<tr>
<th>Data Type</th>
@@ -794,7 +805,7 @@
</ul>
- <table id="term2escape" class="separated" style="border-collapse:collapse;">
+ <table id="term2escape" class="separated">
<caption>Context where each kind of escape sequence can be used</caption>
<thead>
<tr>