All examples should be valid Turtle
authorGavin Carothers <gavin@carothers.name>
Tue, 24 Apr 2012 11:25:33 -0700
changeset 253 1dbb75eadc1d
parent 252 7074e1c448e0
child 254 19c4cb31911c
child 257 7d796fb0f976
All examples should be valid Turtle
rdf-turtle/index.html
--- a/rdf-turtle/index.html	Tue Apr 24 11:18:48 2012 -0700
+++ b/rdf-turtle/index.html	Tue Apr 24 11:25:33 2012 -0700
@@ -332,7 +332,9 @@
 				  Turtle datatype IRIs may be represented by <a href="#iri-summary">any valid IRI form</a>.
 				</p>
 
-				<pre class="example"><script type="text/plain">
+				<pre class="example"><script type="text/turtle">@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
[email protected] show: <http://example.org/show#> .
+
 show:218 rdfs:label "That Seventies Show"^^xsd:string .            # literal with XML Schema string datatype
 show:218 rdfs:label "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> . # same as above
 show:218 rdfs:label "That Seventies Show" .                                            # same again
@@ -471,7 +473,8 @@
 				  A fresh RDF blank node is allocated for each unique blank node label in a Turtle or N-Triples document.
 				  Repeated use of the same blank node label identifies the same RDF blank node.
 				</p>
-				<pre class="example"><script type="text/plain">
+				<pre class="example"><script type="text/turtle">@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
 _:alice foaf:knows _:bob .
 _:bob foaf:knows _:alice .
 </script></pre>
@@ -486,7 +489,8 @@
 				    The generation of these triples is described below in <a href="#groups">Predicate Object Lists in Turtle</a>.
 				    Blank nodes are also allocated for <a href="#collections">Collections in Turtle</a> (below).
 				  </p>
-				  <pre class="example"><script type="text/plain">
+				  <pre class="example"><script type="text/turtle">@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
 # Someone knows someone else, who has the name "Bob".
 [] foaf:knows [ foaf:name "Bob" ] .
 </script></pre>
@@ -562,7 +566,8 @@
 				  </p>
 				  <div style="float:left;">
 				    <p class="idlAttrName" style="padding-left:2em;">Abbreviated Turtle:</p>
-				<pre class="example"><script type="text/plain">
+				<pre class="example"><script type="text/turtle">@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
 [ foaf:name "Alice" ] foaf:knows [
     foaf:name "Bob" ;
     foaf:knows [
@@ -572,7 +577,7 @@
 			      </div>
 				  <div style="float:left;">
 				    <p class="idlAttrName" style="padding-left:2em;">Corresponding N-Triples:</p>
-				<pre class="example"><script type="text/plain">
+				<pre class="example"><script type="text/turtle">
 _:a <http://xmlns.com/foaf/0.1/name> "Alice" .
 _:a <http://xmlns.com/foaf/0.1/knows> _:b .
 _:b <http://xmlns.com/foaf/0.1/name> "Bob" .
@@ -994,7 +999,8 @@
 
           <p>is syntactic sugar for (noting that the blank nodes <code>b0</code>, <code>b1</code> and <code>b2</code> do not occur anywhere else in the RDF graph):</p>
 
-<pre class="example untested"><script type="text/turtle">    _:b0  rdf:first  1 ;
+<pre class="example untested"><script type="text/turtle">@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+    _:b0  rdf:first  1 ;
           rdf:rest   _:b1 .
     _:b1  rdf:first  2.0 ;
           rdf:rest   _:b2 .
@@ -1006,7 +1012,8 @@
 
           <pre class="example untested">(1 [:p :q] ( 2 ) ) .</pre>
 
-          <p>is syntactic sugar for:</p><pre class="example untested"><script type="text/turtle">    _:b0  rdf:first  1 ;
+          <p>is syntactic sugar for:</p><pre class="example untested"><script type="text/turtle">@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+    _:b0  rdf:first  1 ;
           rdf:rest   _:b1 .
     _:b1  rdf:first  _:b2 .
     _:b2  :p         :q .