- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 29 Jan 2010 08:52:55 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/md In directory hutz:/tmp/cvs-serv1486 Modified Files: Overview.html Log Message: Microdata: Make the RDF output not generate duplicate blank nodes for un-named items referenced twice. Make it generate triples for blank nodes that are properties of nodes with types. (whatwg r4633) Index: Overview.html =================================================================== RCS file: /sources/public/html5/md/Overview.html,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Overview.html 28 Jan 2010 01:22:28 -0000 1.29 +++ Overview.html 29 Jan 2010 08:52:53 -0000 1.30 @@ -262,7 +262,7 @@ <h1>HTML5 Microdata</h1> <h2 class="no-num no-toc" id="generatedID"></h2> - <h2 class="no-num no-toc" id="editor-s-draft-28-january-2010">Editor's Draft 28 January 2010</h2> + <h2 class="no-num no-toc" id="editor-s-draft-29-january-2010">Editor's Draft 29 January 2010</h2> <dl><dt>Latest Published Version:</dt> <dd><a href="http://www.w3.org/TR/md/">http://www.w3.org/TR/md/</a></dd> <dt>Latest Editor's Draft:</dt> @@ -350,7 +350,7 @@ specification's progress along the W3C Recommendation track. - This specification is the 28 January 2010 Editor's Draft. + This specification is the 29 January 2010 Editor's Draft. </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is part of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">a larger specification</a> being produced by the <a href="http://www.whatwg.org/">WHATWG</a>. <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> @@ -4190,6 +4190,13 @@ <li> + <p>Let <var title="">memory</var> be a mapping of items to + subjects, initially empty.</p> + + </li> + + <li> + <p>For each element that is also a <a href="#top-level-microdata-items" title="top-level microdata items">top-level microdata item</a>, run the following steps:</p> @@ -4197,8 +4204,7 @@ <ol><li> <p><a href="#generate-the-triples-for-an-item" title="generate the triples for an item">Generate the - triples for the item</a>. Let <var title="">item</var> be the - subject returned.</p> + triples for the item</a>. Pass a reference to <var title="">memory</var> as the item/subject list. Let <var title="">result</var> be the subject returned.</p> </li> @@ -4208,19 +4214,27 @@ <dl class="triple"><dt>subject <dd> <span>the document's current address</span> <dt>predicate <dd> <code title="">http://www.w3.org/1999/xhtml/microdata#item</code> - <dt>object <dd> <var title="">item</var> + <dt>object <dd> <var title="">result</var> </dl></li> </ol></li> </ol><p>When the user agent is to <dfn id="generate-the-triples-for-an-item">generate the triples for an - item</dfn> <var title="">item</var>, it must follow the following + item</dfn> <var title="">item</var>, given a reference to an + item/subject list <var title="">memory</var>, and optionally given a + fallback type <var title="">fallback type</var> and property name + <var title="">fallback name</var>, it must follow the following steps:</p> - <ol><li><p>If <var title="">item</var> has a <a href="#global-identifier">global - identifier</a> and that <a href="#global-identifier">global identifier</a> is an - <span>absolute URL</span>, let <var title="">subject</var> be that - <a href="#global-identifier">global identifier</a>. Otherwise, let <var title="">subject</var> be a new blank node.</li> + <ol><li><p>If there is an entry for <var title="">item</var> in <var title="">memory</var>, then let <var title="">subject</var> be the + subject of that entry. Otherwise, if <var title="">item</var> has a + <a href="#global-identifier">global identifier</a> and that <a href="#global-identifier">global + identifier</a> is an <span>absolute URL</span>, let <var title="">subject</var> be that <a href="#global-identifier">global + identifier</a>. Otherwise, let <var title="">subject</var> be a + new blank node.</li> + + <li><p>Add a mapping from <var title="">item</var> to <var title="">subject</var> in <var title="">memory</var>, if there + isn't one already.</li> <li><p>If <var title="">item</var> has an <a href="#item-type">item type</a> and that <a href="#item-type">item type</a> is an <span>absolute URL</span>, @@ -4228,15 +4242,64 @@ type</a>. Otherwise, let <var title="">type</var> be the empty string.</li> + <!-- The special characters used in URLs beyond this point are + intended to make it so that a different type/name combination + couldn't generate the same string. ":" and "%20" are used because + they can't be put in /name/ when all this is used. --> + <li> - <p>If <var title="">type</var> is not the empty string, generate - the following triple:</p> + <p>If <var title="">type</var> is not the empty string, run the + following steps:</p> - <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> + <ol><li><p>Generate the following triple:</p> + + <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> + + <li><p>If <var title="">type</var> does not contain a U+0023 + NUMBER SIGN character (#), then append a U+0023 NUMBER SIGN + character (#) to <var title="">type</var>.</li> + + <li><p>If <var title="">type</var> does not have a U+003A COLON + character (:) after its U+0023 NUMBER SIGN character (#), append + a U+003A COLON character (:) to <var title="">type</var>.</li> + + </ol></li> + + <li> + + <p>If <var title="">type</var> is the empty string, but <var title="">fallback type</var> is not, run the following + substeps:</p> + + <ol><li><p>Let <var title="">type</var> have the value of <var title="">fallback type</var>.</li> + + <li><p>If <var title="">type</var> does not contain a U+0023 + NUMBER SIGN character (#), then append a U+0023 NUMBER SIGN + character (#) to <var title="">type</var>.</li> + + <!-- Special characters beyond this point have to be something + not in /name/ when this is used below, so either ":", %20, %0D, + or %0A. This is so that a different type/name combination + couldn't generate the same string. --> + + <li><p>If <var title="">type</var> does not have a U+003A COLON + character (:) after its U+0023 NUMBER SIGN character (#), append + a U+003A COLON character (:) to <var title="">type</var>.</li> + + <li><p>If the last character of <var title="">type</var> is not a + U+003A COLON character (:), append a U+0025 PERCENT SIGN + character (%), a U+0032 DIGIT TWO character (2), and a U+0030 + DIGIT ZERO character (0) to <var title="">type</var>.</li> + + <li><p>Append the value of <var title="">fallback name</var> to + <var title="">type</var>, with any characters in <var title="">fallback name</var> that are not valid in the + <ifragment> production of the IRI syntax being + %-escaped. <a href="#refsRFC3987">[RFC3987]</a></li> + + </ol></li> <li> @@ -4244,74 +4307,78 @@ more <a href="#property-names">property names</a> and is one of <a href="#the-properties-of-an-item" title="the properties of an item">the properties of the item</a> <var title="">item</var>, in the order those elements are given by the algorithm that returns <a href="#the-properties-of-an-item">the properties of an item</a>, run - the following substeps:</p> + the following substep:</p> - <ol><li><p>Let <var title="">value</var> be the <a href="#concept-property-value" title="concept-property-value">property value</a> of <var title="">element</var>.</li> + <ol><li> - <li><p>If <var title="">value</var> is an <a href="#concept-item" title="concept-item">item</a>, then <a href="#generate-the-triples-for-an-item" title="generate the - triples for an item">generate the triples</a> for <var title="">value</var>, and then replace <var title="">value</var> - with the subject returned from those steps.</li> + <p>For each name <var title="">name</var> in <var title="">element</var>'s <a href="#property-names">property names</a>, run the + following substeps:</p> - <!-- could support <time> here somehow, though we'd have to - reserialise it, check if the <time> was valid, check if it had a - date, a time, a timezone, etc. --> + <ol><li><p>If <var title="">type</var> is the empty string and <var title="">name</var> is not an <span>absolute URL</span>, then + abort these substeps.</li> - <li><p>Otherwise, if <var title="">element</var> is not one of - the <a href="#url-property-elements">URL property elements</a>, let <var title="">value</var> be a plain literal, with the language - information set from the <span>language</span> of the element, if - it is not unknown.</li> + <li><p>Let <var title="">value</var> be the <a href="#concept-property-value" title="concept-property-value">property value</a> of <var title="">element</var>.</li> - <li> + <li><p>If <var title="">value</var> is an <a href="#concept-item" title="concept-item">item</a>, then <a href="#generate-the-triples-for-an-item" title="generate + the triples for an item">generate the triples</a> for <var title="">value</var>. Pass a reference to <var title="">memory</var> as the item/subject list, and pass <var title="">type</var> as the fallback type and <var title="">name</var> as the fallback property name. Replace <var title="">value</var> by the subject returned from those + steps.</li> - <p>For each name <var title="">name</var> in <var title="">element</var>'s <a href="#property-names">property names</a>, run the - appropriate substeps from the following list:</p> + <!-- could support <time> here somehow, though we'd have to + reserialise it, check if the <time> was valid, check if it had a + date, a time, a timezone, etc. --> - <dl><dt>If <var title="">name</var> is an <span>absolute - URL</span></dt> + <li><p>Otherwise, if <var title="">element</var> is not one of + the <a href="#url-property-elements">URL property elements</a>, let <var title="">value</var> be a plain literal, with the language + information set from the <span>language</span> of the element, if + it is not unknown.</li> - <dd> + <li> - <p>Generate the following triple:</p> + <dl><dt>If <var title="">name</var> is an <span>absolute + URL</span></dt> - <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></dd> + <dd> - <dt>If <var title="">name</var> contains no U+003A COLON - character (:)</dt> + <p>Let <var title="">predicate</var> be <var title="">name</var>.</p> - <dd> + </dd> - <ol><li><p>If <var title="">type</var> is the empty string, then - abort these substeps.</li> + <dt>If <var title="">name</var> contains no U+003A COLON + characters (:)</dt> - <li><p>Let <var title="">predicate</var> have the same value - as <var title="">type</var>.</li> + <dd> - <li><p>If <var title="">predicate</var> does not contain a - U+0023 NUMBER SIGN character (#), then append a U+0023 NUMBER - SIGN character (#) to <var title="">predicate</var>.</li> + <ol><li><p>Let <var title="">s</var> be <var title="">type</var>.</li> - <li><p>Append a U+003A COLON character (:) to <var title="">predicate</var>.</li> <!-- has to be something - not in /name/, so ":", so that a different type/name - combination couldn't generate the same string --> + <li><p>If the last character of <var title="">s</var> is + not a U+003A COLON character (:), append a U+0025 PERCENT + SIGN character (%), a U+0032 DIGIT TWO character (2), and a + U+0030 DIGIT ZERO character (0) to <var title="">s</var>.</li> - <li><p>Append the value of <var title="">name</var> to <var title="">predicate</var>, with any characters in <var title="">name</var> that are not valid in the <ifragment> - production of the IRI syntax being %-escaped.</li> + <li><p>Append the value of <var title="">name</var> to <var title="">s</var>, with any characters in <var title="">name</var> that are not valid in the + <ifragment> production of the IRI syntax being + %-escaped. <a href="#refsRFC3987">[RFC3987]</a></li> - <li> + <li><p>Let <var title="">predicate</var> be the + concatenation of the string "<code title="">http://www.w3.org/1999/xhtml/microdata#</code>" + and <var title="">s</var>, with any characters in <var title="">s</var> that are not valid in the <ifragment> + production of the IRI syntax being %-escaped. <a href="#refsRFC3987">[RFC3987]</a></li> <!-- this ensures + you can't use a URL to get the same effect --> - <p>Generate the following triple:</p> + </ol></dd> - <dl class="triple"><dt>subject <dd> <var title="">subject</var> - <dt>predicate <dd> the concatenation of the string "<code title="">http://www.w3.org/1999/xhtml/microdata#</code>" and <var title="">predicate</var>, with any characters in <var title="">predicate</var> that are not valid in the <ifragment> production of the IRI syntax being %-escaped <a href="#refsRFC3987">[RFC3987]</a> - <dt>object <dd> <var title="">value</var> - </dl></li> + </dl></li> - </ol></dd> + <li> - </dl></li> + <p>Generate the following triple:</p> + + <dl class="triple"><dt>subject <dd> <var title="">subject</var> + <dt>predicate <dd> <var title="">predicate</var> + <dt>object <dd> <var title="">value</var> + </dl></li> + + </ol></li> </ol></li> @@ -4363,6 +4430,41 @@ <http://purl.oreilly.com/products/9780596802189.EBOOK> a frbr:Expression ; dc:type <http://purl.oreilly.com/product-types/EBOOK> .</pre> + <hr><p>The following snippet of HTML has microdata for two people with + the same address:</p> + + <pre><p> + Both + <span itemscope itemtype="http://microformats.org/profile/hcard" itemref="home"><span itemprop="fn">Princeton</span></span> + and + <span itemscope itemtype="http://microformats.org/profile/hcard" itemref="home"><span itemprop="fn">Trekkie</span></span> + live at + <span id="dome" itemprop="adr" itemscope><span itemprop="street-address">Avenue Q</span>.</span> +</p></pre> + + <p>...generates these triples expressed in Turtle (including a + triple that in this case is expressed twice, though that is not + meaningful in RDF):</p> + + <pre class="turtle">@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix dct: <http://purl.org/dc/terms/> . +@prefix hcard: <http://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fmicroformats.org%2Fprofile%2Fhcard%23%3A> . + +<> <http://www.w3.org/1999/xhtml/microdata#item> _:n0 ; + <http://www.w3.org/1999/xhtml/microdata#item> _:n1 . +_:n0 rdf:type <http://microformats.org/profile/hcard> ; + hcard:fn "Princeton" ; + hcard:adr _:n2 . +_:n1 rdf:type <http://microformats.org/profile/hcard> ; + hcard:fn "Trekkie" ; + hcard:adr _:n2 . +_:n2 hcard:adr%20street-address "Avenue Q" ; + hcard:adr%20street-address "Avenue Q" .</pre> + + + + + </div><h2 id="iana"><span class="secno">9 </span>IANA considerations</h2><!-- http://www.w3.org/2002/06/registering-mediatype.html --><h3 id="application-microdata-json"><span class="secno">9.1 </span><dfn><code>application/microdata+json</code></dfn></h3><p>This registration is for community review and will be submitted to the IESG for review, approval, and registration with IANA.</p><!--
Received on Friday, 29 January 2010 08:53:02 UTC