Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[e] (0) Fix some typos and add the first draft of an intro section fo…
…r microdata.

git-svn-id: http://svn.whatwg.org/webapps@3075 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 10, 2009
1 parent e8cfdb7 commit 555e522
Show file tree
Hide file tree
Showing 2 changed files with 280 additions and 22 deletions.
152 changes: 140 additions & 12 deletions index
Expand Up @@ -665,7 +665,10 @@
<li><a href=#matching-html-elements-using-selectors><span class=secno>4.13 </span>Matching HTML elements using selectors</a></ol></li>
<li><a href=#microdata><span class=secno>5 </span>Microdata</a>
<ol>
<li><a href=#introduction-2><span class=secno>5.1 </span>Introduction</a></li>
<li><a href=#introduction-2><span class=secno>5.1 </span>Introduction</a>
<ol>
<li><a href=#the-basic-syntax><span class=secno>5.1.1 </span>The basic syntax</a></li>
<li><a href=#defining-vocabularies><span class=secno>5.1.2 </span>Defining vocabularies</a></ol></li>
<li><a href=#encoding-microdata><span class=secno>5.2 </span>Encoding microdata</a>
<ol>
<li><a href=#the-microdata-model><span class=secno>5.2.1 </span>The microdata model</a></li>
Expand All @@ -674,7 +677,7 @@
<li><a href=#names:-the-property-attribute><span class=secno>5.2.4 </span>Names: the <code>property</code> attribute</a></li>
<li><a href=#values><span class=secno>5.2.5 </span>Values</a></ol></li>
<li><a href=#microdata-dom-api><span class=secno>5.3 </span>Microdata DOM API</a></li>
<li><a href=#converting-html-to-oher-formats><span class=secno>5.4 </span>Converting HTML to oher formats</a>
<li><a href=#converting-html-to-other-formats><span class=secno>5.4 </span>Converting HTML to other formats</a>
<ol>
<li><a href=#json><span class=secno>5.4.1 </span>JSON</a></li>
<li><a href=#rdf><span class=secno>5.4.2 </span>RDF</a></ol></ol></li>
Expand Down Expand Up @@ -40588,7 +40591,132 @@ explain that only direct children of the <menu> matter

<h3 id=introduction-2><span class=secno>5.1 </span>Introduction</h3>

<p class=XXX>...</p>
<h4 id=the-basic-syntax><span class=secno>5.1.1 </span>The basic syntax</h4>

<p><em>This section is non-normative.</em></p>

<p>Sometimes, it is desireable to annotate content with specific
machine-readable labels, e.g. to allow generic scripts to provide
services that are customised to the page, or to enable content from
a variety of cooperating authors to be processed by a single script
in a consistent manner.</p>

<p>For this purpose, authors can use the microdata features
described in this section.</p>

<p>At a high level, microdata consists of a group of name-value
pairs. The groups are called <a href=#concept-item title=concept-item>items</a>, and each name-value pair is a
property. Items and properties are represented by regular
elements.</p>

<div class=example>

<p>Here there are two items, each of which have the property "name":</p>

<pre>&lt;div item&gt;
&lt;p&gt;My name is &lt;span property="name"&gt;Elizabeth&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div item&gt;
&lt;p&gt;My name is &lt;span property="name"&gt;Daniel&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;</pre>

</div>

<p>Properties generally have values that are strings.</p>

<div class=example>

<p>Here the item has three properties:</p>

<pre>&lt;div item&gt;
&lt;p&gt;My name is &lt;span property="name"&gt;Neil&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;My band is called &lt;span property="band"&gt;Four Parts Water&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;I am &lt;span property="nationality"&gt;British&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;</pre>

</div>

<p>Properties can also have values that are URLs. This is achieved
using the <code title="">a</code> element and its <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute.</p>

<div class=example>

<p>In this example, the item has one property, "image", whose value is a URL:</p>

<pre>&lt;div item&gt;
&lt;img property="image" src="google-logo.png" alt="Google"&gt;
&lt;/div&gt;</pre>

</div>

<p>Properties can also have values that are dates, times, or dates
and times. This is achieved using the <code title="">time</code>
element and its <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code>
attribute.</p>

<div class=example>

<p>In this example, the item has one property, "birthday", whose
value is a date:</p>

<pre>&lt;div item&gt;
I was born on &lt;time property="birthday" datetime="2009-05-10"&gt;May 10th 2009&lt;/time&gt;.
&lt;/div&gt;</pre>

</div>

<p>Properties can also themselves be groups of name-value pairs, by
putting the <code title=attr-item><a href=#items:-the-item-attribute>item</a></code> attribute on the
element that declares the property.</p>

<div class=example>

<p>In this example, the outer item represents a person, and the
inner one represents a band:</p>

<pre>&lt;div item&gt;
&lt;p&gt;Name: &lt;span property="name"&gt;Amanda&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Band: &lt;span property="band" item&gt; &lt;span property="name"&gt;Jazz Band&lt;/span&gt; (&lt;span property="size"&gt;12&lt;/span&gt; players)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</pre>

<p>In this example, the outer item has two properties, "name" and
"band". The "name" is "Amanda",and the "band" is an item in its own
right, with two properties, "name" and "size". The "name" of the
band is "Jazz Band", and the "size" is "12".</p>

</div>


<h4 id=defining-vocabularies><span class=secno>5.1.2 </span>Defining vocabularies</h4>

<p><em>This section is non-normative.</em></p>

<p>Using microdata means using a vocabulary. For some purposes, an
ad-hoc vocabulary is adequate. For others, a vocabulary will need to
be designed. Where possible, authors are encouraged to re-use
existing vocabularies, as this makes content re-use easier.</p>

<p>When designing new vocabularies, identifiers can be created
either using <a href=#url title=URL>URLs</a> or <a href=#valid-reversed-dns-identifier title="valid
reversed DNS identifier">reversed DNS labels</a>. For URLs
conflicts with other vocabularies can be avoided by only using
identifiers that correspond to pages that the author has control
over. Similarly, for reversed DNS labels conflicts can be avoided by
using a domain name that the author has control over, or by using
suffixes that correspond to the path components of pages that the
author has control over.</p>

<div class=example>

<p>For instance, if Jon and Adam both write content at <code title="">example.com</code>, at <code title="">http://example.com/jon/...</code> and <code title="">http://example.com/adam/...</code> respectively, then they
could select identifiers of the form "com.example.jon.name" and
"com.example.adam.name" respectively.</p>

</div>





<h3 id=encoding-microdata><span class=secno>5.2 </span>Encoding microdata</h3>
Expand Down Expand Up @@ -40701,8 +40829,8 @@ explain that only direct children of the <menu> matter

<li>If its <a href=#concept-item-corresponding title=concept-item-corresponding>corresponding
item</a>'s <code title=attr-item><a href=#items:-the-item-attribute>item</a></code> attribute has no
tokens: a string containing neither a U+003A COLON character (:), a
U+002E FULL STOP character (.), nor a U+0020 SPACE character, or</li>
tokens: a string containing neither a U+003A COLON character (:)
nor a U+002E FULL STOP character (.), or</li>
<!--
<li>If its <span title="concept-item-corresponding">corresponding
item</span>'s <code title="attr-item">item</code> attribute
Expand Down Expand Up @@ -40873,7 +41001,7 @@ explain that only direct children of the <menu> matter



<h3 id=converting-html-to-oher-formats><span class=secno>5.4 </span>Converting HTML to oher formats</h3>
<h3 id=converting-html-to-other-formats><span class=secno>5.4 </span>Converting HTML to other formats</h3>


<h4 id=json><span class=secno>5.4.1 </span>JSON</h4>
Expand Down Expand Up @@ -40953,7 +41081,7 @@ explain that only direct children of the <menu> matter
<p>If <a href=#the-title-element-0>the <code>title</code> element</a> is not null,
then generate the following triple:</p>

<dl><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dl class=triple><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dt>predicate <dd> <code title="">http://purl.org/dc/terms/title</code>
<dt>object <dd> the <code><a href=#textcontent>textContent</a></code> of <a href=#the-title-element-0>the <code>title</code> element</a>
</dl></li>
Expand Down Expand Up @@ -40995,7 +41123,7 @@ explain that only direct children of the <menu> matter
COLON character (:) nor a U+002E FULL STOP character (.),
generate the following triple:</p>

<dl><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dl class=triple><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dt>predicate <dd> the concatenation of the string "<code title="">http://www.w3.org/1999/xhtml/vocab#</code>" and <var title="">token</var>
<dt>object <dd> the <a href=#absolute-url>absolute URL</a> that results from <a href=#resolve-a-url title="resolve a URL">resolving</a> the value of the element's <code title="">href</code> attribute relative to the element
</dl></li>
Expand All @@ -41011,7 +41139,7 @@ explain that only direct children of the <menu> matter
contains neither a U+003A COLON character (:) nor a U+002E FULL
STOP character (.), generate the following triple:</p>

<dl><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dl class=triple><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dt>predicate <dd> the concatenation of the string "<code title="">http://www.w3.org/1999/xhtml/vocab#</code>" and value of the element's <code title=attr-meta-name><a href=#attr-meta-name>name</a></code> attribute, <a href=#converted-to-lowercase>converted to lowercase</a>
<dt>object <dd> the value of the element's <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute
</dl></li>
Expand All @@ -41025,7 +41153,7 @@ explain that only direct children of the <menu> matter
successfully relative to the element, generate the following
triple:</p>

<dl><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dl class=triple><dt>subject <dd> <a href="#the-document's-current-address">the document's current address</a>
<dt>predicate <dd> <code title="">http://purl.org/dc/terms/source</code>
<dt>object <dd> the <a href=#absolute-url>absolute URL</a> that results from <a href=#resolve-a-url title="resolve a URL">resolving</a> the value of the element's <code title="">cite</code> attribute relative to the element
</dl></li>
Expand Down Expand Up @@ -41063,7 +41191,7 @@ explain that only direct children of the <menu> matter

<p>Generate the following triple:</p>

<dl><dt>subject <dd> <var title="">subject</var>
<dl class=triple><dt>subject <dd> <var title="">subject</var>
<dt>predicate <dd> <code title="">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</code>
<dt>object <dd> <var title="">type</var>
</dl></li>
Expand Down Expand Up @@ -41096,7 +41224,7 @@ explain that only direct children of the <menu> matter

<p>Generate the following triple:</p>

<dl><dt>subject <dd> <var title="">subject</var>
<dl class=triple><dt>subject <dd> <var title="">subject</var>
<dt>predicate <dd> <var title="">name</var>
<dt>object <dd> <var title="">value</var>
</dl></li>
Expand Down

0 comments on commit 555e522

Please sign in to comment.