<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fberriman &#187; microdata</title>
	<atom:link href="http://fberriman.com/tag/microdata/feed/" rel="self" type="application/rss+xml" />
	<link>http://fberriman.com</link>
	<description>a blog for frances</description>
	<lastBuildDate>Mon, 16 Aug 2010 09:11:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HTML5 Microdata &#8211; Over-cooked?</title>
		<link>http://fberriman.com/2009/05/24/html5-microdata-over-cooked/</link>
		<comments>http://fberriman.com/2009/05/24/html5-microdata-over-cooked/#comments</comments>
		<pubDate>Sun, 24 May 2009 12:15:44 +0000</pubDate>
		<dc:creator>Frances</dc:creator>
				<category><![CDATA[Microformats]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[microdata]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://fberriman.com/?p=86</guid>
		<description><![CDATA[What is Microdata? Microdata is HTML5&#8242;s answer to how we should go about embedding machine-readable data in our mark-up. At a high level, microdata consists of a group of name-value pairs. The groups are called items, and each name-value pair is a property. Items and properties are represented by regular elements. A simple example looks [...]

<h3>Possibly related posts:</h3><ol><li><a href='http://fberriman.com/2010/07/22/hgroups-and-sub-titles/' rel='bookmark' title='Permanent Link: hgroups and sub-titles'>hgroups and sub-titles</a></li>
<li><a href='http://fberriman.com/about/' rel='bookmark' title='Permanent Link: About me'>About me</a></li>
<li><a href='http://fberriman.com/2006/08/07/implementing-hatom-the-entries-code/' rel='bookmark' title='Permanent Link: Implementing hAtom: The entries code'>Implementing hAtom: The entries code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;padding-right: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ffberriman.com%252F2009%252F05%252F24%252Fhtml5-microdata-over-cooked%252F%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22HTML5%20Microdata%20-%20Over-cooked%3F%22%20%7D);"></div>
<h3>What is Microdata?</h3>
<p>Microdata is HTML5&#8242;s answer to how we should go about embedding machine-readable data in our mark-up.</p>
<blockquote><p><span id="more-86"></span></p>
<p>At a high level, microdata consists of a group of name-value pairs. The groups are called items, and each name-value pair is a property. Items and properties are represented by regular elements.</p>
</blockquote>
<p>A simple example looks something like this:</p>
<pre><code>
&lt;div item&gt;
 &lt;p>My name is &lt;span itemprop="name"&gt;Frances&lt;/span&gt;.&lt;/p&gt;
 &lt;p>My work for the &lt;span itemprop="company">BBC&lt;/span>.&lt;/p&gt;
 &lt;p>I am &lt;span itemprop="nationality"&gt;British&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;
</code>
</pre>
<p>Where the item has 3 properties with values (name:Frances, company:BBC, nationality:British).</p>
<p>You can then associate item properties with items that the property is not a direct descendant of, with the <code>subject</code> attribute.</p>
<p>Essentially, you have some new attributes at your disposal:</p>
<ul>
<li><code>item</code> &#8211; to specify a group.</li>
<li><code>itemprop</code> &#8211; to define the property of an element inside an item.</li>
<li><code>subject</code> &#8211; to associate a property with a non-parent item.</li>
</ul>
<p>You can also type items with a URL, reverse DNS labels or a pre-defined type (and each <code>itemprop</code> can accept multiple properties, as you&#8217;d expect with <code>class</code>):</p>
<blockquote>
<p>Here, the item is &#8220;org.example.animals.cat&#8221;:</p>
<pre>
<code>
&lt;section item="org.example.animal.cat"&gt;
 &lt;h1 itemprop="org.example.name"&gt;Hedral&lt;/h1&gt;
 &lt;p itemprop="org.example.desc"&gt;Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.&lt;/p&gt;
 &lt;img itemprop="org.example.img" src="hedral.jpeg" alt="" title="Hedral, age 18 months"&gt;
&lt;/section&gt;
</code>
</pre>
<p>In this example the &#8220;org.example.animals.cat&#8221; item has three properties, an &#8220;org.example.name&#8221; (&#8220;Hedral&#8221;), an &#8220;org.example.desc&#8221; (&#8220;Hedral is&#8230;&#8221;), and an &#8220;org.example.img&#8221; (&#8220;hedral.jpeg&#8221;).</p>
</blockquote>
<p>Quotes and examples (slightly personalised) come from the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html">HTML5 working draft</a>.</p>
<h3>My reservations</h3>
<p>My gut instinct with microdata is that it&#8217;s overcomplicating things.  We have RDFa already if you really want to get into the nitty-gritty of machine-readable data and, dare I say it, microformats and good semantic practice for creating shared vocabularies for plain-old semantic HTML.  I&#8217;m not sure HTML5 necessarily needs this sort of extra solution.  </p>
<p>The last example above, with the reverse DNS typing, just looks so&#8230; heavy.  Something about it just doesn&#8217;t feel right and it&#8217;s actual value to me remains unclear, or at least I can&#8217;t see the value of specifying the path on each element.  Couldn&#8217;t that be inferred from the structure, or <code>subject</code> used where ambiguities appear, and then as a last resort specify it on each element?</p>
<pre>
<code>
&lt;section item="org.example.animal.cat"&gt;
 &lt;h1 itemprop="name"&gt;Hedral&lt;/h1&gt;
 &lt;p itemprop="desc"&gt;Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.&lt;/p&gt;
 &lt;img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months"&gt;
&lt;/section&gt;
</code>
</pre>
<p>The <code>itemprop</code> attribute bothers me most.  I can&#8217;t help but think that all the examples shown in the draft would still work if <code>itemprop</code> was replaced with <code>class</code>.  The <code>class</code> attribute is already designed to take a semantically rich term for the element.  Worse still, assuming <code>class</code> is used appropriately, you&#8217;ll end up with unnecessary repetition across the attributes.</p>
<pre><code>
&lt;div item&gt;
 &lt;p>My name is &lt;span class="name" itemprop="name"&gt;Frances&lt;/span&gt;.&lt;/p&gt;
...
&lt;/div&gt;
</code>
</pre>
<p>The <code>subject</code> attribute examples aren&#8217;t great, which doesn&#8217;t help their case &#8211; they don&#8217;t seem that real world (although there are plenty of good reasons why you might need <code>subject</code> &#8211; just look at the microformat <a href="http://microformats.org/wiki/include">include-pattern</a> for example, and how that would be improved with it).  A few of the examples could be better represented and relationships then inferred from the element structure (and I wouldn&#8217;t mind, but HTML5 already offers a boat-load of new elements to take away much of the ambiguity that HTML4 had &#8211; but just sections and headers go a long way to tying information notionally together).  </p>
<p>The microdata proposal seems to be about making explicit what could otherwise already be inferred from the actual elements and values (although I&#8217;ll concede that it&#8217;s often inaccurate or very difficult).  Wanting to be exact isn&#8217;t a terrible idea (it works really well for the <code>for</code> attribute, for example) and I do like disambiguation.  I just don&#8217;t think the current proposal really solves the right problems as it stands.   </p>
<p>I do think that <code>subject</code> has the most legs of the new attributes, though, but surely it could be as simple as:</p>
<pre><code>
&lt;div id="about"&gt;
&lt;p&gt;I'm Frances and I like to complain about things on the internet.&lt;/p&gt;
&lt;/div&gt;
...
&lt;p subject="about"&gt;I own no cats. :(&lt;/p&gt;
</code></pre>
<p>Let the <code>subect</code> do what <code>for</code> has done for label, but across all elements, tying wayward bits of information to an ID (or maybe simply use <code>subject</code> alone to tie pieces of information together &#8211; but then this starts to feel like a <code>class</code> job again).</p>
<p>Or an example with <code>class</code> in place of <code>itemprop</code> and using a pre-defined vocabulary:</p>
<pre><code>
&lt;div id="vcard"&gt;
&lt;p&gt;I'm &lt;span class="fn"&gt;Frances&lt;/span&gt; and I like to complain about things on the internet.&lt;/p&gt;
&lt;/div&gt;
...
&lt;p subject="vcard"&gt;I still own no cats. :( I do work for the &lt;span class="company"&gt;BBC&lt;/span&gt; though. &lt;/p&gt;
</code></pre>
<p>My final concern, which actually could apply to HTML5 as a whole and is more of a general <em>are we ready for this yet?</em> thought, is that this is a lot for an author to consider.  You look at the web as it stands now, and most of it isn&#8217;t well written.  Elements are abused, misused or completely forgotten (and attributes fair worse).   </p>
<p>HTML5 offers a raft of new elements and attributes to aid clarity in information, accessibility and flexibility.  Do we really think that authors on the whole have a great track-record of implementing the specs well?  These new microdata attributes make what could already be a simple lesson (use <code>class</code> meaningfully) into a much steeper learning curve, watering down the overall benefit.</p>
<p>I&#8217;m not suggesting that that should be an excuse to not make HTML5 as rich as possible, but it should always be in mind that the web is about enabling <em>normal people</em> to share information &#8211; it&#8217;s not just an intellectual experiment for web developers.</p>
<p>Microdata is in the early draft stage &#8211; so I realise things will change.</p>
<h3>Disclaimer</h3>
<p>It&#8217;s well known that I&#8217;m a microformats busy-body, but this has nothing to do with my distaste for microdata as the spec stands.  Sure, the two things have similar aims, but microformats has always been a solution for the here-and-now.  HTML5 still &#8220;supports&#8221; microformats, and when HTML5 is ready, microformats will simplify (using the <code>time</code> element can&#8217;t happen soon enough) and continue to do what they have always done.  I <em>like</em> HTML5 and want it to succeed.  I am in no way condoning microformats <strong>over</strong> microdata or generally comparing the two.</p>



<h3>Possibly related posts:</h3><ol><li><a href='http://fberriman.com/2010/07/22/hgroups-and-sub-titles/' rel='bookmark' title='Permanent Link: hgroups and sub-titles'>hgroups and sub-titles</a></li>
<li><a href='http://fberriman.com/about/' rel='bookmark' title='Permanent Link: About me'>About me</a></li>
<li><a href='http://fberriman.com/2006/08/07/implementing-hatom-the-entries-code/' rel='bookmark' title='Permanent Link: Implementing hAtom: The entries code'>Implementing hAtom: The entries code</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://fberriman.com/2009/05/24/html5-microdata-over-cooked/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
