<?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>Webmonkey &#187; RDFa</title>
    <atom:link href="http://www.webmonkey.com/tag/rdfa/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.webmonkey.com</link>
    <description>The Web Developer&#039;s Resource</description>
    <lastBuildDate>Fri, 05 Apr 2013 20:20:46 +0000</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=3.4.2</generator>
    
    <item>
        <title>Microdata: HTML5&#8242;s Best-Kept Secret</title>
        <link>http://www.webmonkey.com/2010/09/microdata-html5s-best-kept-secret/</link>
        <comments>http://www.webmonkey.com/2010/09/microdata-html5s-best-kept-secret/#comments</comments>
        <pubDate>Fri, 10 Sep 2010 17:46:24 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=48655</guid>
        		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Basics]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[Microdata]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[RDFa]]></category>
		<category><![CDATA[tutorial]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2010/09/moleskine.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2010/09/moleskine.jpg" alt="Microdata: HTML5&#8242;s Best-Kept Secret" /></div>Given the amount of industry noise about native video and scripted animations, you&#8217;d be forgiven if you had never heard of the new microdata specification included in HTML5. Similar to outside efforts like Microformats, HTML5&#8242;s microdata offers a way of extend HTML by adding custom vocabularies to your pages. The easiest way to understand it [...]]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled --><a href="http://www.webmonkey.com/wp-content/uploads/2010/09/moleskine.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2010/09/moleskine.jpg" alt="" title="moleskine" width="200" /></a>
<p>Given the amount of industry noise about native video and scripted animations, you&#8217;d be forgiven if you had never heard of the new microdata specification included in HTML5.</p>
<p>Similar to outside efforts like Microformats, HTML5&#8242;s microdata offers a way of extend HTML by adding custom vocabularies to your pages.</p>
<p>The easiest way to understand it is to consider a common use case. Let&#8217;s say you want list details about a business on your page &#8212; the name, address, telephone number and so on. To do that you&#8217;ll need to use some vocabulary in addition to HTML, since there is no <code>&lt;business></code> tag.</p>
<p>Using microdata, you can create your own custom name/value pairs to define a vocabulary that describes a business listing.</p>
<p>When a search engine spider comes along, it will know that not only is your data a business listing, but it can discover the address, the phone number, or even the precise geo-coordinates if you want to include them.</p>
<p>Given that HTML5 is still a draft at this point, why bother?</p>
<p>Actually, despite its lack of publicity and HTML5&#8242;s still-incomplete status, microdata is already being used by Google, which has started adding information gleaned from microdata markup to its search result snippets.</p>
<p><span id="more-48655"></span></p>
<p>Microdata is useful today, but what about <a href="http://www.webmonkey.com/2007/12/microformats_are_awesome__now_put_them_to_work_for_your_site/">Microformats</a> or more complex tools like RDFa? The answer is that all three will work (and Google, in most cases, understands all of them). </p>
<p>In the end, the differences between the three are primarily in the syntax, and each has its advantages and disadvantages. But given that the Microdata specification will very likely become an official recommended web standard as part of HTML5, it seems the most future-proof of the three options.</p>
<p>So how do we add Microdata to a web page? Consider the following basic HTML markup, which might be used to describe my local coffee shop:</p>
<p><pre class="brush: js">
&lt;div>
    &lt;h1>Hendershot's Coffee Bar&lt;/h1>
    &lt;p>1560 Oglethorpe Ave, Athens, GA&lt;/p>
&lt;/div>
</pre>
<p>This markup gets the basic information on the page and humans can read it, but search engine spiders aren&#8217;t going to get much out of it. While it&#8217;s true that even Google says you should design for humans first and robots second, we can improve this code without making it any less human readable.</p>
<h3>Microdata</h3>
<p>To rewrite this business listing using HTML5&#8242;s microdata syntax, we would do something like this:</p>
<p><pre class="brush: js">
&lt;div itemscope itemtype="http://data-vocabulary.org/Organization"> 
    &lt;h1 itemprop="name">Hendershot's Coffee Bar&lt;/h1>
    &lt;p itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
      &lt;span itemprop="street-address">1560 Oglethorpe Ave&lt;/span>, 
      &lt;span itemprop="locality">Athens&lt;/span>, 
      &lt;span itemprop="region">GA&lt;/span>.
    &lt;/p>
&lt;/div>
</pre>
<p>The Microdata markup adds a couple attributes you may not have seen before, <code>itemscope</code>, <code>itemtype</code> and <code>itemprop</code>. The first is essentially just a top level marker, it tells the search engine spider that you&#8217;re about to define something in the following nested tags. The <code>itemtype</code> attribute tells the spider what you&#8217;re defining &#8212; in this case, an organization.</p>
<p>The rest of the markup should look pretty familiar if you&#8217;ve used Microformats. The main change is the <code>itemprop</code> attribute (short for item property) to define what each element is. Because our address is all one paragraph, we&#8217;ve added some span tags to define each element of the address separately &#8212; street address, locality and so on. If we wanted, we could add other properties like a phone number (<code>itemprop="tel"</code>), a URL (<code>itemprop="url"</code>) or even geodata (<code>itemprop="geo"</code>).</p>
<p>So where did we get these <code>itemprop</code> vocabularies from? Well, as the URL in the <code>itemtype</code> attribute indicates, they come from <a href="http://www.data-vocabulary.org/">data-vocabulary.org</a>. Of course you can make up your own itemprop syntax, but if you want search engine spiders to understand your microdata, you&#8217;re going to have to document what you&#8217;re doing. Since the definitions at data-vocabulary.org cover a number of common use cases &#8212; events, organizations, people, products, recipes, reviews &#8212; it makes a good starting point.</p>
<h3>Microformats and RDFa</h3>
<p>So how does Microdata fit with <a href="http://microformats.org/">Microformats</a> and <a href="http://www.w3.org/TR/xhtml-rdfa-primer/">RDFa</a>? Well, the <a href="http://www.whatwg.org/">WHAT-WG</a>, which helps to develop the HTML5 spec, decided the flame wars provoked by the debate over whether to use Microformats or RDFa lacked sufficient vehemence, so they added a third definition of their own.</p>
<p>Actually, the reasoning seems to have been something like this: Microformats are a really good idea, but essentially a hack. Because Microformats rely only on the <code>class</code> and <code>rel</code> attributes, writing parsers to read them is complicated.</p>
<p>At the same time, RDFa was designed to work with the now-defunct XHTML 2.0 spec. Although RDFa is being ported to work with HTML5, it can be overly complex for many use cases. RDFa is a bit like asking what time it is and having someone tell you how to build a watch. Yes, RDFa can do the same things HTML5 microdata and Microformats do (and more), but if the history of the web teaches us a lesson, it&#8217;s that simpler solutions almost always win.</p>
<h3>Further Reading</h3>
<p>Before you dive into microdata, be sure to check out all the options. Google has a nice <a href="http://www.google.com/support/webmasters/bin/topic.py?topic=21997">overview on adding microdata to your page</a>, and offers examples using all three markup syntaxes. Mark Pilgrim&#8217;s Dive Into HTML5 also devotes <a href="http://diveintohtml5.org/extensibility.html">a chapter to microdata</a> with more detail on how microdata parsers read your markup.</p>
<p>Also, keep in mind that it isn&#8217;t just search engines that stand to benefit from microdata on your pages. The HTML5 spec also defines a set of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#microdata-dom-api">DOM APIs for web browsers to read and manipulate microdata</a> on your pages. At the moment, no browser supports the API, but most probably will eventually.</p>
<p>The more information you can give the web, the more it can do with that information. Eventually, search engines could use microdata to find your friends on the web (like <a href="http://hueniverse.com/xrd/">XRD</a> and <a href="http://code.google.com/p/webfinger/">WebFinger</a>) and browsers could use it to connect you with those friends no matter what flavor-of-the-month social site they might be using.</p>
<p><strong>See Also:</strong><br/></p>
<ul>
<li><a href="http://www.webmonkey.com/2010/09/using-microformats-in-html5/">Using Microformats in HTML5</a></li>
<li><a href="http://www.webmonkey.com/2010/05/where-on-the-web-is-html5/">Where on the Web Is HTML5?</a></li>
<li><a href="http://www.webmonkey.com/2010/02/Add_Semantic_Value_to_Your_Pages_With_HTML_5/">Add Semantic Value to Your Pages With HTML 5</a></li>
<li><a href="http://www.webmonkey.com/2007/12/microformats_are_awesome__now_put_them_to_work_for_your_site/">Microformats are Awesome, Now Put Them to Work for Your Site</a></li>
</ul>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2010/09/microdata-html5s-best-kept-secret/feed/</wfw:commentRss>
        <slash:comments>16</slash:comments>

        
    </item>
    </channel>
</rss>