Added scope section that describes other methods of supplying data from HTML
authorJeniT
Sun, 11 Dec 2011 21:00:08 +0000
changeset 46 5e403ad6e1ac
parent 45 95e49b1811d5
child 47 6f3a01be6a37
Added scope section that describes other methods of supplying data from HTML
html-data-guide/index.html
--- a/html-data-guide/index.html	Sat Dec 10 21:15:33 2011 +0000
+++ b/html-data-guide/index.html	Sun Dec 11 21:00:08 2011 +0000
@@ -118,6 +118,54 @@
       </p>
       
       <section>
+        <h3>Scope</h3>
+        <p>
+          There are many ways of publishing data on the web such that it is can be discovered from HTML pages or used by scripts and stylesheets that operate over your page.
+        </p>
+        <p>
+          First, publishers may link to alternative versions of a document, using different syntax, through a <code>link</code> element. The <code>@rel</code> attribute should take the value <code>alternate</code> and the <code>@type</code> attribute should provide the mime type of the alternative representation. For example:
+        </p>
+        <pre>&lt;link rel="alternate" type="text/calendar" value="calendar.ics" /&gt;</pre>
+        <p>
+          Second, publishers may embed data within the <code>head</code> of an HTML document, nested inside a <code>script</code> element with an appropriate <code>@type</code> attribute. This can be used for text-based formats, such as JSON or Turtle, and XML-based formats such as RDF/XML. For example:
+        </p>
+        <pre><strong>&lt;script type="text/turtle"&gt;</strong>
+  @prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .
+  @prefix gr: &lt;http://purl.org/goodrelations/v1#&gt; .
+  @prefix vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt; .
+  @prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
+
+  &lt;#company&gt; gr:hasPOS &lt;#store&gt; .
+
+  &lt;#store&gt; a gr:Location ;
+    gr:name "Hair Masters" ;
+    vcard:adr [
+      a vcard:Address ;
+      vcard:country-name "USA" ;
+      vcard:locality "Sebastpol" ;
+      vcard:postal-code "95472" ;
+      vcard:street-address "6980 Mckinley Ave" ;
+    ] ;
+    foaf:page &lt;&gt; ;
+    .
+<strong>&lt;/script&gt;</strong></pre>
+        <p>
+          Third, data can be embedded through <a href="http://dev.w3.org/html5/spec/global-attributes.html#custom-data-attribute">custom data attributes</a>. These must not be used by third parties, but can be useful when the only consumers of the data are scripts and stylesheets used by the page. For example:
+        </p>
+        <pre>&lt;div class="spaceship" <strong>data-ship-id="92432"
+     data-weapons="laser 2" data-shields="50%"
+     data-x="30" data-y="10" data-z="90"</strong>&gt;
+ &lt;button class="fire"
+         onclick="spaceships[this.parentNode.dataset.shipId].fire()"&gt;
+  Fire
+ &lt;/button&gt;
+&lt;/div&gt;</pre>
+        <p>
+          This document focuses on methods of data markup that reuse visible data within the page. Embedding data within an HTML page has the advantage of avoiding repetition, enables access through scripts and stylesheets, and is more easily discoverable by browsers and search engines which regularly consume HTML documents.
+        </p>
+      </section>
+      
+      <section>
         <h3>Terminology</h3>
         <p>
           Within this document, a <dfn>format</dfn> is a combination of a <a>syntax</a> and <a title="type">types</a> and <a title="property">properties</a> from one or more <a title="vocabulary">vocabularies</a>. Traditional microformats do not make the distinction between syntax and vocabulary, but RDFa, microdata and microformats-2 do make this distinction.
@@ -676,7 +724,7 @@
           It is good practice for consumers to ignore markup that uses <a>syntax</a> or <a title="vocabulary">vocabularies</a> that they do not understand. Properties and <a title="type">types</a> in unrecognised vocabularies should be ignored by consumers.
         </p>
         <p>
-          The presence of HTML data within a website does not imply that the data can be used without restriction. Publishers may license the information provided through HTML data, for example to restrict it to non-commercial use or to use only with attribution. It is good practice for a consumer to honour licenses and to indicate to publishers which <a title="format">formats</a> they recognise for expressing licensing information within HTML pages, and which licenses they recognise as indicating that the data within the page is consumable. Typical <a title="vocabulary">vocabularies</a> for expressing this information are schema.org, rel-license, Creative Commons or Dublin Core.
+          The presence of HTML data within a website does not imply that the data can be used without restriction. Publishers may license the information provided through HTML data, for example to restrict it to non-commercial use or to use only with attribution. Legally, consumers must honour licenses and it is good practice for consumers to indicate to publishers which <a title="format">formats</a> they recognise for expressing licensing information within HTML pages, and which licenses they recognise as indicating that the data within the page is consumable. Typical <a title="vocabulary">vocabularies</a> for expressing this information are schema.org, rel-license, Creative Commons or Dublin Core.
         </p>
         <p>
           Even when the use of data is unrestricted, it is good practice for consumers to record the source of the information that they use and, when republishing that data, provide metadata about the rights holder, source and license under which the information is available, using the same <a title="vocabulary">vocabularies</a> as those listed above.