First draft of Turtle in HTML
authorGavin Carothers <gavin@carothers.name>
Fri, 23 Sep 2011 12:53:20 -0700
changeset 148 cc3adb1cb142
parent 147 fb80fc0fea66
child 149 52bc8495cc49
First draft of Turtle in HTML
rdf-turtle/index.html
--- a/rdf-turtle/index.html	Thu Sep 08 12:00:21 2011 -0400
+++ b/rdf-turtle/index.html	Fri Sep 23 12:53:20 2011 -0700
@@ -104,7 +104,6 @@
     function esc(doc, content) {
       return doc._esc(content);
     }
-    
     </script>
     <style type="text/css">
     /* Style Turtle script blocks to be visable */
@@ -856,6 +855,43 @@
           registration form.
           </p>
         </section>
+        
+      <section id="in-html" class="informative">
+        <h2>Turtle in HTML</h2>
+        <p>HTML ([[!HTML5]]) <code>script</code> <a href="http://dev.w3.org/html5/spec/Overview.html#scripting-1">tags</a> 
+        can be used to embed data blocks in pages. Turtle can be easily embedded in HTML this way.</p>
+        <pre class="example">
+&lt;script type="text/turtle">
+@prefix dc: &lt;http://purl.org/dc/terms/> .
+@prefix frbr: &lt;http://purl.org/vocab/frbr/core#> .
+
+&lt;http://books.example.com/works/45U8QJGZSQKDH8N> a frbr:Work ;
+     dc:creator "Wil Wheaton"@en ;
+     dc:title "Just a Geek"@en ;
+     frbr:realization &lt;http://books.example.com/products/9780596007683.BOOK>,
+         &lt;http://books.example.com/products/9780596802189.EBOOK> .
+
+&lt;http://books.example.com/products/9780596007683.BOOK> a frbr:Expression ;
+     dc:type &lt;http://books.example.com/product-types/BOOK> .
+
+&lt;http://books.example.com/products/9780596802189.EBOOK> a frbr:Expression ;
+     dc:type &lt;http://books.example.com/product-types/EBOOK> .
+&lt;/script>
+        </pre>
+        <p>Turtle content should be placed in <code>script</code> with the 
+        <code>type</code> attribute set to <code>text/turtle</code>. <code>&lt;</code> and <code>&gt;</code> symbols
+        do not need to be escaped inside of script tags. The character encoding of the embedded Turtle
+        MUST match the HTML documents encoding.</p>
+        <p>There are some special steps that need to be taken when publishing Turtle in XHTML rather then HTML (text/html).</p>
+        <section id="in-html-parsing">
+          <h3>Parsing Turtle in HTML</h3>
+          <p>There are no syntactic or grammar diffrences between parsing Turtle that has been embedded 
+          and normal Turtle documents. Each <code>script</code> data block is considered to be it's own 
+          Turtle document. <code>@prefix</code>, <code>@base</code> declarations MUST NOT effect other
+          data blocks. All data blocks in a HTML document share the same document base URI as the HTML 
+          document.</p>
+        </section>
+      </section>
 
       <section id="sec-compared">
         <h2>Turtle compared</h2>