<?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>Marc Hibbins &#187; rdfa</title>
	<atom:link href="http://blog.marchibbins.com/category/rdfa/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.marchibbins.com</link>
	<description>Freelance Web developer, blogger</description>
	<lastBuildDate>Wed, 21 Sep 2011 11:42:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>You&#8217;ve Got a Friend in Me</title>
		<link>http://blog.marchibbins.com/2009/07/29/youve-got-a-friend-in-me/</link>
		<comments>http://blog.marchibbins.com/2009/07/29/youve-got-a-friend-in-me/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 09:53:57 +0000</pubDate>
		<dc:creator>Marc Hibbins</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[linkeddata]]></category>
		<category><![CDATA[openstandards]]></category>
		<category><![CDATA[rdfa]]></category>
		<category><![CDATA[semanticweb]]></category>

		<guid isPermaLink="false">http://blog.marchibbins.com/?p=735</guid>
		<description><![CDATA[Inspired by Mark Birbeck's talk on RDFa and the Semantic Web earlier this month I decided to take some of my own advice and add RDFa to my site. I've now created a FOAF profile here on my blog.]]></description>
			<content:encoded><![CDATA[<p>Inspired by <a title="» Thinking Out Loud Marc Hibbins" href="http://blog.marchibbins.com/2009/07/15/thinking-out-loud/" target="_blank">Mark Birbeck&#8217;s talk on RDFa and the Semantic Web</a> earlier this month I decided to take some of my own advice and add RDFa to my site. I&#8217;ve now created a FOAF profile here on my blog.</p>
<p>Reading through Mark&#8217;s <a title="Mark Birbeck's blog | webBackplane" href="http://webbackplane.com/mark-birbeck/blog" target="_blank">articles at webBackplane</a>, I noticed he has a very simple tutorial on <a title="Getting started with RDFa: Creating a basic FOAF profile | webBackplane" href="http://webbackplane.com/mark-birbeck/blog/2009/04/getting-started-with-rdfa" target="_blank">how to create a basic FOAF profile</a>. Being so straightforward, as RDFa is meant to be, and seeing how I wrote about FOAF in my dissertation almost three years ago now, as well as now having full control of my blog (now that it&#8217;s a WordPress.org installation rather than the free option) &#8211; I&#8217;ve no excuse.</p>
<p>In my last post I discussed RDF vocabularies, sets of agreed-upon and unambiguous terms that allow developers to structure otherwise &#8216;mundane&#8217; structureless content by inserting definitions and making references to which machines and applications can follow to infer meaning and <em>understand</em> topics of any kind. There I gave <a title="» Thinking Out Loud Marc Hibbins" href="http://blog.marchibbins.com/2009/07/15/thinking-out-loud/#An_example" target="_blank">an example</a> that pointed to a specification used to structure book reviews.</p>
<p>FOAF is the <a title="FOAF (software) - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/FOAF_(software)" target="_blank">Friend of a Friend</a> vocabulary, an RDF and <a title="Web Ontology Language - Wikipedia, the free encyclopedia" href="http://en.wikipedia.org/wiki/Web_Ontology_Language" target="_blank">OWL ontology</a>, used in the same way, but specificially to describe people, their activities, interests and their relationships to other people.</p>
<p>Created around mid-2000, it is now maintained by <a title="The Friend of a Friend (FOAF) project | FOAF project" href="http://www.foaf-project.org/" target="_blank">The FOAF Project</a>, which is considered to be one of the earliest &#8211; if not the first &#8211; Semantic Web application.</p>
<p>The idea is that given that anyone can put RDF(a) on their Web site, equally, anyone can describe themselves using FOAF. By doing this they are creating themselves a FOAF profile, thus have joined the linked network of people who have already done the same. These people can then begin to create links to each others FOAF profiles and start to create a social network of friends, without the need for a centralised database or website to do it for them.</p>
<p>Then here&#8217;s where RDFa steps in, which now allows developers to implement structured data straight into their HTML mark-up, wrapping existing or new content with an extended set of attributes, meaning they no longer have to host a separate RDF file and rely on either applications indexing that file or creating a link to it from another page to point to it.</p>
<h3><a name="Creating_a_FOAF_profile" class="anchor">Creating a FOAF profile</a></h3>
<p>I already have an <a title="» About Marc Hibbins" href="http://blog.marchibbins.com/about/" target="_blank">&#8216;About&#8217; page</a> on this blog &#8211; a bit of blurb about who I am and what I do. So it&#8217;s here that I&#8217;m implementing my FOAF information.</p>
<p>As said, there&#8217;s no need to link to a separate RDF file if you use RDFa, so really you can add the metadata anywhere, in your headers or footers for example, but that About page is the most relevant place for me and already contains the information and links I want to share anyway.</p>
<p>Firstly I wrap the text in a div tag that defines the FOAF namespace and declares that this div is a &#8216;Person object&#8217;, that the contents of this div describes a person. This is done by referring to the <strong>foaf:Person</strong> type of the FOAF vocabulary:</p>
<blockquote><p>&lt;div <strong>xmlns:foaf=&#8221;http://xmlns.com/foaf/0.1/&#8221; about=&#8221;#me&#8221;<br />
<span style="padding-left:30px;">typeof=&#8221;foaf:Person&#8221;</strong>&gt;</span><br />
<span style="padding-left:30px;">&lt;p&gt;Hello.&lt;/p&gt;</span><br />
<span style="padding-left:30px;">&lt;p&gt;My name is Marc Hibbins.&lt;/p&gt;</span><br />
<span style="padding-left:30px;">&#8230;</span><br />
&lt;/div&gt;</p></blockquote>
<p>I also use the <strong>about</strong> attribute with the value <strong>#me</strong> which is a useful convention to easily enable people to create links to me, more on this later.</p>
<p>The FOAF Person object contains a lot of properties to describe you personally, what kinds of activities you are involved in and terms that create connections to sites or documents relating to you.</p>
<p>Now that my object is created I can start annotating the text with some of these terms, for example my name:</p>
<blockquote><p>&lt;div <strong>xmlns:foaf=&#8221;http://xmlns.com/foaf/0.1/&#8221; about=&#8221;#me&#8221;<br />
<span style="padding-left:30px;">typeof=&#8221;foaf:Person&#8221;</strong>&gt;</span><br />
<span style="padding-left:30px;">&lt;p&gt;Hello.&lt;/p&gt;</span><br />
<span style="padding-left:30px;">&lt;p&gt;My name is <strong>&lt;span property=&#8221;foaf:name&#8221;&gt;</strong>Marc Hibbins<strong>&lt;/span&gt;</strong>.&lt;/p&gt;</span><br />
<span style="padding-left:30px;">&#8230;</span><br />
&lt;/div&gt;</p></blockquote>
<p>And then some links, FOAF has terms for to define your blog and homepage URLs:</p>
<blockquote><p>&lt;a <strong>rel=&#8221;foaf:weblog&#8221;</strong> href=&#8221;http://blog.marchibbins.com/&#8221;&gt;My blog&lt;/a&gt;<br />
&lt;a <strong>rel=&#8221;foaf:homepage&#8221;</strong> href=&#8221;http://www.marchibbins.com&#8221;&gt;My site&lt;/a&gt;</p></blockquote>
<p>It&#8217;s also common to have an image, so likewise if I had I would attach the <strong>foaf:img</strong> term. The full A-Z index of terms can be found on the specification: <a title="FOAF Vocabulary Specification" href="http://xmlns.com/foaf/spec/" target="_blank">http://xmlns.com/foaf/spec/</a>.</p>
<p>FOAF allows you to connect to other online accounts that you own. Mark&#8217;s tutorial has the following example to attach his Twitter account to his person object:</p>
<blockquote><p>&lt;span <strong>rel=&#8221;foaf:holdsAccount&#8221;</strong>&gt;<br />
<span style="padding-left:30px;">&lt;span <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">&lt;a <strong>rel=&#8221;foaf:accountServiceHomepage&#8221;</strong></span><br />
<span style="padding-left:80px;">href=&#8221;http://twitter.com/&#8221;&gt;Twitter&lt;/a&gt;</span><br />
<span style="padding-left:60px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221;</strong> &gt;markbirbeck&lt;/span&gt;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span><br />
&lt;/span&gt;</p></blockquote>
<p>The <strong>foaf:holdsAccount</strong> definition creates a relationship between the <strong>typeof=&#8221;foaf:Person&#8221;</strong> object and the <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</strong> object that follows (the above mark-up would be contained within said Person object). Note the <strong>foaf:holdsAccount span</strong> allows for multiple <strong>foaf:OnlineAccount</strong> objects inside. The <strong>foaf:accountServiceHomepage</strong> term defines the service homepage, Twitter&#8217;s home page in this case and the <strong>foaf:accountName</strong> property declares Mark&#8217;s username.</p>
<p>As you&#8217;ll notice (as he does, too) although its machine-readable it isn&#8217;t particularly human-readable. Well it <em>is</em>, but it&#8217;s not all that nice. So instead he uses this formatting:</p>
<blockquote><p><strong>His inane comments are available on his</strong><br />
&lt;span rel=&#8221;foaf:holdsAccount&#8221;&gt;<br />
<span style="padding-left:30px;">&lt;span typeof=&#8221;foaf:OnlineAccount&#8221;&gt;</span><br />
<span style="padding-left:60px;">&lt;a rel=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:80px;">href=&#8221;http://twitter.com/&#8221;&gt;<strong>Twitter</strong>&lt;/a&gt;</span><br />
<span style="padding-left:60px;"><strong> account. His ID is &#8216;</strong></span><br />
<span style="padding-left:60px;">&lt;span property=&#8221;foaf:accountName&#8221;&gt;markbirbeck&lt;/span&gt;</span><br />
<span style="padding-left:60px;"><strong> &#8216;.</strong></span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span><br />
&lt;/span&gt;</p></blockquote>
<p>This is better for human reading, though I still think a little convoluted. All I want is a single link, just like I already have. As I&#8217;ve said, RDFa should have no effect on my content &#8211; its workings should be hidden to the reader.</p>
<p>So in my mark-up, rather than the <strong>rel</strong> attribute on <strong>a</strong> tags and using in-line values (values found immediately between the <strong>a</strong> tags), I use the <strong>property</strong> and <strong>content</strong> attributes on <strong>spans</strong>:</p>
<blockquote><p>&lt;span rel=&#8221;foaf:holdsAccount&#8221;&gt;<br />
<span style="padding-left:30px;">&lt;span typeof=&#8221;foaf:OnlineAccount&#8221; <strong></span><br />
<span style="padding-left:70px;">property=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:70px;">content=&#8221;http://delicious.com/&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221; content=&#8221;marchibbins&#8221;</strong>&gt;</span><br />
<span style="padding-left:90px;">&lt;a href=&#8221;http://delicious.com/marchibbins&#8221;&gt;View my Delicious</span><br />
<span style="padding-left:110px;">bookmarks&lt;/a&gt; – most things are about the Semantic Web&#8230;</span><br />
<span style="padding-left:60px;">&lt;/span&gt;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span><br />
&lt;/span&gt;</p></blockquote>
<p>This allows me to keep my existing prose and is still machine-accessible.</p>
<p>I mentioned being able to connect to other people&#8217;s FOAF profiles, this is done by attaching the <strong>foaf:knows</strong> term to a link to someone&#8217;s similar such page:</p>
<blockquote><p>&lt;a <strong>rel=&#8221;foaf:knows&#8221;</strong> href=&#8221;http://www.w3.org/People/Ivan/<strong>#me</strong>&#8220;&gt;Ivan Herman&lt;/a&gt;</p></blockquote>
<p>Note here that Ivan Herman has employed the <strong>#me</strong> mechanism in his FOAF URI to connect directly to his profile information, rather than to the whole page which contains that information.</p>
<p>I&#8217;ve decided not to connect to friends or colleagues here in this way, again it wasn&#8217;t in my original content and also I use a similar technology instead, called XFN, in the footer of my blog pages. <a title="XFN: Introduction and Examples" href="http://gmpg.org/xfn/intro" target="_blank">XFN</a> deserves a blog post to itself (that hopefully I&#8217;ll get time for), have a look a the source and you&#8217;ll see similar <strong>rel</strong> attributes there for now.</p>
<h3><a name="My_FOAF_profile" class="anchor">My FOAF profile</a></h3>
<p>So here it is, abridged but with all the RDFa shown:</p>
<blockquote><p>&lt;div <strong>xmlns:foaf=&#8221;http://xmlns.com/foaf/0.1/&#8221; about=&#8221;#me&#8221;</span><br />
<span style="padding-left:15px;">typeof=&#8221;foaf:Person&#8221;</strong>&gt;</span></p>
<p><span style="padding-left:15px;">&lt;p&gt;Hello.&lt;/p&gt;</span><br />
<span style="padding-left:15px;">&lt;p&gt;My name is &lt;span <strong>property=&#8221;foaf:name&#8221;</strong>&gt;Marc Hibbins&lt;/span&gt;.&lt;/p&gt;</span><br />
<span style="padding-left:15px;">&lt;p&gt;I&#8217;m an interactive and digital media developer, I build Web applications and</span><br />
<span style="padding-left:40px;">RIAs primarily with tools like Flash, Flex and AIR.&lt;/p&gt;</span></p>
<p><span style="padding-left:15px;">&lt;p&gt;</span><br />
<span style="padding-left:30px;">&lt;span <strong>rel=&#8221;foaf:holdsAccount&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">&lt;span <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</span><br />
<span style="padding-left:100px;">property=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:100px;">content=&#8221;http://delicious.com/&#8221;</strong>&gt;</span><br />
<span style="padding-left:90px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221;</span><br />
<span style="padding-left:130px;">content=&#8221;marchibbins&#8221;</strong>&gt;</span><br />
<span style="padding-left:120px;">&lt;a href=&#8221;http://delicious.com/marchibbins&#8221;&gt;View my Delicious</span><br />
<span style="padding-left:140px;">bookmarks&lt;/a&gt; &#8211; most things are about the Semantic Web,</span><br />
<span style="padding-left:140px;">gathered as dissertation research&#8230;</span><br />
<span style="padding-left:90px;">&lt;/span&gt;</span><br />
<span style="padding-left:60px;">&lt;/span&gt;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span><br />
<span style="padding-left:15px;">&lt;/p&gt;</span></p>
<p><span style="padding-left:15px;">&lt;p&gt;</span><br />
<span style="padding-left:30px;">&lt;span <strong>rel=&#8221;foaf:holdsAccount&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">&lt;span <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</span><br />
<span style="padding-left:100px;">property=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:100px;">content=&#8221;http://friendfeed.com/&#8221;</strong>&gt;</span><br />
<span style="padding-left:90px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221; content=&#8221;hibbins&#8221;</strong>&gt;</span><br />
<span style="padding-left:120px;">I use &lt;a href=&#8221;http://friendfeed.com/hibbins&#8221;&gt;FriendFeed&lt;/a&gt;</span><br />
<span style="padding-left:90px;">&lt;/span&gt;</span><br />
<span style="padding-left:60px;">&lt;/span&gt;,</span></p>
<p><span style="padding-left:60px;">&lt;span <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</span><br />
<span style="padding-left:100px;">property=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:100px;">content=&#8221;http://twitter.com/&#8221;</strong>&gt;</span><br />
<span style="padding-left:90px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221;</span><br />
<span style="padding-left:130px;">content=&#8221;marchibbins&#8221;</strong>&gt;</span><br />
<span style="padding-left:120px;">&lt;a href=&#8221;http://twitter.com/marchibbins&#8221;&gt;Twitter&lt;/a&gt;</span><br />
<span style="padding-left:90px;">&lt;/span&gt;</span><br />
<span style="padding-left:60px;">&lt;/span&gt; and</span></p>
<p><span style="padding-left:60px;">&lt;span <strong>typeof=&#8221;foaf:OnlineAccount&#8221;</span><br />
<span style="padding-left:100px;">property=&#8221;foaf:accountServiceHomepage&#8221;</span><br />
<span style="padding-left:100px;">content=&#8221;http://last.fm/&#8221;</strong>&gt;</span><br />
<span style="padding-left:90px;">&lt;span <strong>property=&#8221;foaf:accountName&#8221;</span><br />
<span style="padding-left:130px;">content=&#8221;marchibbins&#8221;</strong>&gt;</span><br />
<span style="padding-left:120px;">&lt;a href=&#8221;http://www.last.fm/user/marchibbins&#8221;&gt;Last.fm&lt;/a&gt;</span><br />
<span style="padding-left:90px;">&lt;/span&gt;</span><br />
<span style="padding-left:60px;">&lt;/span&gt; etc etc..</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span><br />
<span style="padding-left:15px;">&lt;/p&gt;</span></p>
<p><span style="padding-left:15px;">&lt;p&gt;</span><br />
<span style="padding-left:30px;">&lt;a <strong>rel=&#8221;foaf:homepage&#8221;</strong></span><br />
<span style="padding-left:50px;">href=&#8221;http://www.marchibbins.com&#8221;&gt;www.marchibbins.com&lt;/a&gt;</span><br />
<span style="padding-left:15px;">&lt;/p&gt;</span><br />
&lt;/div&gt;</p></blockquote>
<p>Notice that I&#8217;m actually using two <strong>foaf:holdsAccount</strong> blocks &#8211; you can, of course, contain all <strong>foaf:OnlineAccount</strong> objects within a single relation, but it seems that WordPress won&#8217;t allow me to do so. When I hit return to start a new paragraph it automatically closes the wrapping <strong>span</strong> and <strong>p</strong> and starts a new paragraph &#8211; so I&#8217;ve had to use two. Otherwise the <strong>p</strong> tags would be inside the <strong>span</strong> (rather than the other way round) but again, the MCE doesn&#8217;t show <strong>p</strong> tags in order for me to edit them in that way.</p>
<p>Similarly, WordPress will wipe clean all your <strong>span</strong> tags if you switch from HTML to Visual mode &#8211; so watch out for that. It also doesn&#8217;t output nice, clean indented HTML in the final page, which is a shame.</p>
<p><a title="» About Marc Hibbins" href="http://blog.marchibbins.com/about/" target="_blank">Find the full version here</a>.</p>
<h3><a name="Validating_RDFa" class="anchor">Validating RDFa</a></h3>
<p>How do you know that any of your metadata is correct &#8211; that it is machine-readable?</p>
<p>I took Mark Birbeck&#8217;s recommendation and used the <a title="Install the Ubiquity RDFa checker" href="http://ubiquity-rdfa.googlecode.com/svn/trunk/install-checker.html" target="_blank">Ubiquity parser bookmarklet</a> to validate my RDFa. Simply publish your mark-up and hit the button and you&#8217;ll see what an RDFa parser sees.</p>
<p>Hopefully it is in fact all correct. I wasn&#8217;t too sure if multiple <strong>foaf:holdsAccount</strong> blocks would be acceptable, but the Ubiquity parser shows the same results nethertheless &#8211; likewise with my use of <strong>property</strong> and <strong>content spans</strong> over <strong>rel</strong> attributes. That said, if anyone has opinions otherwise &#8211; let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marchibbins.com/2009/07/29/youve-got-a-friend-in-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinking Out Loud</title>
		<link>http://blog.marchibbins.com/2009/07/15/thinking-out-loud/</link>
		<comments>http://blog.marchibbins.com/2009/07/15/thinking-out-loud/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 10:01:49 +0000</pubDate>
		<dc:creator>Marc Hibbins</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[linkeddata]]></category>
		<category><![CDATA[openstandards]]></category>
		<category><![CDATA[rdfa]]></category>
		<category><![CDATA[ydn]]></category>

		<guid isPermaLink="false">http://blog.marchibbins.com/?p=686</guid>
		<description><![CDATA[On Monday I attended Mark BirbecK's seminar The Possibilities of RDFa and the Semantic Web, an 'in-the-brain' session on RDFa and structured data discussing some of the exciting possibilities created by authors implementing structured data via RDFa into Web pages.]]></description>
			<content:encoded><![CDATA[<p>On Monday I attended <a title="Mark Birbeck | webBackplane" href="http://webbackplane.com/mark-birbeck" target="_blank">Mark Birbeck</a>&#8216;s seminar <a title="Skills Matter : In The Brain of Mark Birbeck: RDFa and the Semantic Web" href="http://skillsmatter.com/podcast/ajax-ria/rdfa-and-the-semantic-web" target="_blank">The Possibilities of RDFa and the Semantic Web</a>, an &#8216;in-the-brain&#8217; session on RDFa and structured data discussing some of the exciting possibilities created by authors implementing structured data via RDFa into Web pages.</p>
<p>We looked at some existing implementations, how to enhance very simple Web pages to be machine-&#8217;readable&#8217; and looked at RDFa as part of the bigger picture &#8211; in correspondence to RDF, Microformats and other technologies, and the Semantic Web.</p>
<p>RDFa (Resource Description Framework in attributes) is a set of extensions to XHTML, a set of attributes intended to be implemented by Web page publishers to introduce extra &#8216;structure&#8217; to the information in documents. These attributes are added at author-time and are completely invisible to the end-user. RDFa is essentially metadata, additional machine-readable indicators that describe the information they annotate without intruding on existing mark-up.</p>
<p>The <a title="RDFa Primer" href="http://www.w3.org/TR/xhtml-rdfa-primer/" target="_blank">W3C&#8217;s RDFa Primer</a> is a good introduction for those unfamiliar with the technology and it conveys the current problem of the separation between the information on the Web readable by humans and that &#8216;readable&#8217; by machine &#8211; the data Web.</p>
<p>Today&#8217;s Web is built predominantly for human consumption. Even as machine-readable data begins to appear on the Web it is typically distributed in a separate file, with a separate format, and very limited correspondence between the human and machine versions. As a result, Web browsers can provide only minimal assistance to humans in parsing and processing data: browsers only see presentation information.</p>
<p>On a typical Web page, an XHTML author might specify a headline, then a smaller sub-headline, a block of italicised text, a few paragraphs of average-size text, and, finally, a few single-word links. Web browsers will follow these presentation instructions faithfully. However, only the human <em>mind </em>understands that the headline is, in fact, the blog post title, the sub-headline indicates the author, the italicised text is the article&#8217;s publication date, and the single-word links are categorisation labels.</p>
<p><img class="aligncenter size-full wp-image-690" title="Presentation vs Semantics" src="http://blog.marchibbins.com/wp-content/uploads/2009/07/rdfa.png" alt="Presentation vs Semantics" width="489" height="310" /></p>
<p>The gap between what programs and humans understand is large. But when Web data meant for humans is augmented with machine-readable hints meant for the computer programs that look for them, these programs become significantly more helpful because they can begin to understand the data&#8217;s structure and meaning.</p>
<p>RDFa is getting a lot of attention lately, not least with developments of HTML5 and the consideration of its implementation with the specification. As of October 2008, <a title="RDFa in XHTML: Syntax and Processing" href="http://www.w3.org/TR/rdfa-syntax/" target="_blank">RDFa in XHTML is a W3C Recommendation</a>, but it was Mark Birkbeck who was first to propose RDFa in <a title="XHTML and RDF" href="http://www.w3.org/MarkUp/2004/02/xhtml-rdf.html" target="_blank">a note to the W3C in February 2004</a> &#8211; so I was looking forward to this.</p>
<h3><a name="Publishing_information_and_publishing_data" class="anchor">Publishing information and publishing data</a></h3>
<p>Mark started with a modern use-case for RDFa, showing us how we can and why we should put structured data in our sites.</p>
<p>He pointed out that online publishing has never been easier. There are a huge number of blogging services offering free, easy to set-up and maintain platforms that are long established and now with sites like Twitter offering the ability to update via SMS or from a mobile device, the Web is enabling a level of ubiquitous publishing that we&#8217;re now completely familiar with.</p>
<p>This is us publishing information, human-readable content. But he says that publishing <em>data</em>, however, still remains hard.</p>
<p>By data, he refers to information &#8216;without prose&#8217; &#8211; think listings on eBay or Yelp, where numbers and stats are what matter over articles of text. He suggests that places like eBay and Yelp are the only places where publishing data is easy. But by using these sites, especially those where the majority of content is user-generated, raises questions as to who actually owns the data.</p>
<p>As a result, people have begun to make their own sites, for maintain their own data. That sounds easy enough, but the problem is that the most accessible means to make websites nowadays is to use the blogging platforms that I mentioned earlier &#8211; those that aren&#8217;t really meant for publishing data, they&#8217;re meant for publishing information.</p>
<p>Mark showed some examples where this is happening, WordPress and Blogger type sites set up by individuals for reviewing films, or books, or restaurants etc &#8211; where each blog &#8216;post&#8217; was an entry for an individual film or book, and details like scores and ratings (the valuable data) is lumped together in the article body &#8211; because that&#8217;s all it <em>can</em> really do &#8211; it&#8217;s meant for prose.</p>
<p>Of course, that&#8217;s fine, for their own sake. They have their content on the Web, on a domain they control. But often this content is of real value, its useful for more than just the author and other people should be see it.</p>
<p>Often though without being on sites such as eBay or Yelp, users will infrequently find them. This is because the norm for finding content is by way of a search engine, i.e. using a <em>machine </em>to find <em>human</em> information. True, some independent sites do rank highly in search engines, but for any newly launched site it is near impossible.</p>
<p>So enter RDFa. By using RDFa, authors can package their existing content in additional mark-up so machines can discriminate between what parts of a long body of text refers specifically to valuable discreet details. Authors can target and isolate individual pieces of text and associate these with a predefined vocabulary of terms specifically for the relevant context of the subject data.</p>
<h3><a name="An_example" class="anchor">An example</a></h3>
<p>The following is Mark&#8217;s example blog post, some typical mark-up for a book review:</p>
<blockquote><p>&lt;div&gt;<br />
<span style="padding-left:30px;">&lt;span&gt;</span><br />
<span style="padding-left:60px;">Title: &lt;span&gt;Chanda&#8217;s Secrets&lt;/span&gt;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span></p>
<p><span style="padding-left:30px;">Stars: &lt;span&gt;*****&lt;/span&gt;</span></p>
<p><span style="padding-left:30px;">&lt;span&gt;</span><br />
<span style="padding-left:60px;">I reviewed Stratton&#8217;s newest teen novel, Leslie&#8217;s Journal in October.</span><br />
<span style="padding-left:60px;">I&#8217;d heard about Chanda&#8217;s Secrets and wanted to give it a try&#8230;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span></p>
<p>&lt;/div&gt;</p></blockquote>
<p>This is very simple mark-up, perfectly understandable for human consumption, but offers machines agents zero indication as to what the content refers to.</p>
<p>RDF is Resource <em>Description </em>Framework, it&#8217;s purpose is to describe. To do so, it references vocabularies of terms &#8211; definitions that provide agreed-upon tags for developers to use that indicate unambiguous details. Machine applications finding this data can then interpret these as they choose, matching the unique identifying terms to the same vocabulary in <em>their</em> process as reference to exactly what was intended, to infer meaning.</p>
<p>There is a vocabulary for book reviews, for example. The following code takes the mark-up above and adds RDFa, enriching the data for the machines &#8216;viewpoint&#8217;, while having no impact on its presentation &#8211; the human viewpoint:</p>
<blockquote><p>&lt;div <strong>xmlns:v=&#8221;http://rdf.data-vocabulary.org/#&#8221; typeof=&#8221;v:Review&#8221;</strong>&gt;<br />
<span style="padding-left:30px;">&lt;span <strong>rel=&#8221;v:itemreviewed&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">Title: &lt;span <strong>property=&#8221;v:name&#8221;</strong>&gt;Chanda&#8217;s Secrets&lt;/span&gt;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span></p>
<p><span style="padding-left:30px;">Stars: &lt;span <strong>property=&#8221;v:rating&#8221; content=&#8221;5&#8243;</strong>&gt;*****&lt;/span&gt;</span></p>
<p><span style="padding-left:30px;">&lt;span <strong>property=&#8221;v:summary&#8221;</strong>&gt;</span><br />
<span style="padding-left:60px;">I reviewed Stratton&#8217;s newest teen novel, Leslie&#8217;s Journal in October.</span><br />
<span style="padding-left:60px;">I&#8217;d heard about Chanda&#8217;s Secrets and wanted to give it a try&#8230;</span><br />
<span style="padding-left:30px;">&lt;/span&gt;</span></p>
<p>&lt;/div&gt;</p></blockquote>
<p>A little run through of the code &#8211; the first line adds a reference to the RDFa vocabulary to use, defining a XML namespace, <strong>v</strong>, and declares that everything within this <strong>div</strong> is a review (type <strong>v:Review</strong>). We add <strong>v:itemreviewed</strong> to the title and specify its <strong>v:name</strong> explicitly. This review class has a rating property, so in the same way we add the <strong>v:rating</strong> property to the five stars. Here you can see another example of a lack of machine/human understanding &#8211; we can see five asterisks (they aren&#8217;t even five stars) and work out what they refer to &#8211; but a machine has no idea. So we &#8216;overwrite&#8217; the inline text with the <strong>content</strong> attribute, declaring outright that our rating has a value of <strong>5</strong>. The summary is tagged in the same way then.</p>
<p>Now it&#8217;s not like this means the post would jump straight to the top of Google&#8217;s search results. RDFa isn&#8217;t about solving that problem, but it helps. It allows machines to infer meaning and act accordingly, <em>if </em>the application is capable of doing so.</p>
<p>For example, any search engine could probably find this post as by matching the search term &#8216;Chanda&#8217;s Secrets&#8217; in a standard lookup query. But recently <a title="RDFa » Blog Archive » Google announces support for RDFa" href="http://rdfa.info/2009/05/12/google-announces-support-for-rdfa/" target="_blank">Google added RDFa support</a> and <a title="RDFa » Blog Archive » Yahoo! into Semantic Web" href="http://rdfa.info/2008/03/14/yahoo-into-semantic-web/" target="_blank">Yahoo! have been doing it for over a year</a>, and both sites now have specific applications for parsing RDFa on top of their normal workings.</p>
<p>Google&#8217;s is called Rich Snippets, which returns this kind of result:</p>
<p><img class="aligncenter size-full wp-image-691" title="A Google 'Rich Snippet'" src="http://blog.marchibbins.com/wp-content/uploads/2009/07/google_snippet.jpg" alt="A Google 'Rich Snippet'" width="500" height="107" /></p>
<p>It&#8217;s an enhanced search result that can feature context-relevant details alongside the link, in this case a star-rating and price range indicator. It&#8217;s with this kind of application you can begin to see how adding structured data can make powerful improvements to your site.</p>
<p>Writing a review and having everything lumped together in the body of an article is fine for humans reading the content, they can make sense of the words, numbers and pictures themselves, but a machine can&#8217;t. By annotating your review &#8211; indicating, for example, a restaurant rating or the price of your food &#8211; you make your data machine-processable, so also able to be aggregated with others. This is called data distribution. In this way, you also still &#8216;own&#8217; your content because it originates from your site, but it is as computable as those larger sites and databases.</p>
<h3><a name="More_possibilities" class="anchor">More possibilities</a></h3>
<p>As well as being used as a means to structure data in a desired format, RDFa can also be used to standardise data, again for interoperability and processing.</p>
<p>Mark presented some job aggregation sites that demonstrate this. Each site was made with a different technology (ASP .NET, PHP, static pages &#8211; whatever) and each displayed data in a different way, not only in their presentation but also by using different terminology &#8211; a job &#8216;title&#8217; or &#8216;name&#8217; or &#8216;position&#8217;, for example. RDFa indicators standardise these ambiguities, so third-party sites, such as aggregators, can intelligently collate the data with an understanding of the differences.</p>
<p>He also spoke about joining the linked data cloud, showing sites that could use the unique identifiers of a vocabulary with reference to their own content for an opportunity to enrich their pages. He had a nifty example that populated a book review page by using the relevant class and retrieving the book&#8217;s cover from a external source that had tagged their data in the same way. That match ensured the discovered data would be relevant.</p>
<p>Finally he talked about vertical search. Where RDFa, at least at it&#8217;s most rudimentary, can be used to work with ambiguous words, synonyms and such. A search for a chemical symbol, in traditional lookup search, would not take into account it&#8217;s chemical name or any other term that refers correctly to it, albeit by a different word. With an application that converts said terms to an agreed upon identifier, for example it&#8217;s chemical formula, users could retrieve all references, by whatever name, tagged also with that identifier.</p>
<h3><a name="Q&amp;A" class="anchor">Q&amp;A</a></h3>
<p>The Q&amp;A to close the seminar was also really useful. Here Mark talked about Microformats, in comparison to RDFa, something I was waiting for. He pointed out that Microformats each require their own parser, need references to a separate vocabulary for each microformat used and commented on the standard being centrally maintained by a handful of people. RDF is decentralised, there is no governing body &#8211; that anyone can create a vocabulary (though of course that might not always be the best answer), and really made Microformats seem clunky and second-best to RDFa &#8211; an opinion I hadn&#8217;t held before.</p>
<p>Mark also pointed out that RDFa is arguably more extensible in that can relate to references not on the actual page of implementation. For example on a page where a license is being specified, with RDFa and by using the <strong>about</strong> tag, users can refer to objects linking <em>from </em>their page &#8211; such as listing different licenses for a set of external images or videos, rather than only being able to describe the license for the page itself, the page that these images link from.</p>
<p>Eventually there was some more Semantic Web talk, discussing technologies such as RDF, OWL and ontologies &#8211; but not as much as I&#8217;d hoped.</p>
<p>In fact, a lot of the content of the talk can be found in Mark&#8217;s excellent articles written for A List Apart, his <a title="A List Apart: Articles: Introduction to RDFa" href="http://www.alistapart.com/articles/introduction-to-rdfa/" target="_blank">Introduction to RDFa</a> and <a title="A List Apart: Articles: Introduction to RDFa II" href="http://www.alistapart.com/articles/introduction-to-rdfa-ii/" target="_blank">Introduction to RDFa, Part II</a>.</p>
<p>I <em>highly</em> recommend reading these, he explores the different methods of annotating your pages, how to apply attributes to various kinds of elements, discusses vocabularies, rules and how to express relations &#8211; a great introduction.</p>
<p>Overall, a great talk. He&#8217;s also now uploaded his slides, with a video recording of the session pending.</p>
<p>Here they are:</p>
<p><span style="text-align:center; display: block;"><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rdfa-and-semweb-090714052727-phpapp02&amp;stripped_title=the-possibilities-of-rdfa-and-the-semantic-web" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rdfa-and-semweb-090714052727-phpapp02&amp;stripped_title=the-possibilities-of-rdfa-and-the-semantic-web" allowscriptaccess="always" allowfullscreen="true"></embed></object></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marchibbins.com/2009/07/15/thinking-out-loud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

