UK Web Focus

Innovation and best practices for the Web

RDFa API Draft Published

Posted by Brian Kelly (UK Web Focus) on 28 September 2010

The W3C have recently announced that the RDFa API draft has been published. As described in the announcement “RDFa enables authors to publish structured information that is both human- and machine-readable. Concepts that have traditionally been difficult for machines to detect, like people, places, events, music, movies, and recipes, are now easily marked up in Web documents“.

The RDFa API draft document itself helpfully provides several examples which illustrate the potential benefits of use of RDFa:

Enhanced Browser Interfaces: Dave is writing a browser plugin that filters product offers in a web page and displays an icon to buy the product or save it to a public wishlist. The plugin searches for any mention of product names, thumbnails, and offered prices. The information is listed in the URL bar as an icon, and upon clicking the icon, displayed in a sidebar in the browser. He can then add each item to a list that is managed by the browser plugin and published on a wishlist website.

Data-based Web Page Modification: Dale has a site that contains a number of images, showcasing his photography. He has already used RDFa to add licensing information about the images to his pages, following the instructions provided by Creative Commons. Dale would like to display the correct Creative Commons icons for each image so that people will be able to quickly determine which licenses apply to each image.

Automatic Summaries: Mary is responsible for keeping the projects section of her company’s home page up-to-date. She wants to display info-boxes that summarize details about the members associated with each project. The information should appear when hovering the mouse over the link to each member’s homepage. Since each member’s homepage is annotated with RDFa, Mary writes a script that requests the page’s content and extracts necessary information via the RDFa API.

Data Visualisation: Richard has created a site that lists his favourite restaurants and their locations. He doesn’t want to generate code specific to the various mapping services on the Web. Instead of creating specific markup for Yahoo Maps, Google Maps, MapQuest, and Google Earth, he instead adds address information via RDFa to each restaurant entry. This enables him to build on top of the structured data in the page as well as letting visitors to the site use the same data to create innovative new applications based on the address information in the page.

Linked Data Mashups: Marie is a chemist, researching the effects of ethanol on the spatial orientation of animals. She writes about her research on her blog and often makes references to chemical compounds. She would like any reference to these compounds to automatically have a picture of the compound’s structure shown as a tooltip, and a link to the compound’s entry on the National Center for Biotechnology Information [NCBI] Web site. Similarly, she would like visitors to be able to visualize the chemical compound in the page using a new HTML5 canvas widget she has found on the web that combines data from different chemistry websites.

However the example I find most interesting is the following:

Importing Data: Amy has enriched her band’s web-site to include Google Rich Snippets event information. Google Rich Snippets are used to mark up information for the search engine to use when displaying enhanced search results. Amy also uses some ECMAScript code that she found on the web that automatically extracts the event information from a page and adds an entry into a personal calendar.

Brian finds Amy’s web-site through Google and opens the band’s page. He decides that he wants to go to the next concert. Brian is able to add the details to his calendar by clicking on the link that is automatically generated by the ECMAScript tool. The ECMAScript extracts the RDFa from the web page and places the event into Brian’s personal calendaring software – Google Calendar.

Although all of the use cases listed above provide sample RDFa markup the final example makes use of Google Rich Snippets for which there is a testing tool which illustrates the structure which is visible to Google. I have been using RDFa on my forthcoming events page for a while so using the Rich Snippets testing tool it is useful to see how the structure provided on that page is processed by Google.

The testing tool does point out that “that there is no guarantee that a Rich Snippet will be shown for this page on actual search results“. As described in the Rich Snippets FAQCurrently, review sites and social networking/people profile sites are eligible. We plan to expand Rich Snippets to other types of content in the future“.

So although there is no guarantee that use of RDFa embedded in HTML pages using Google Rich Snippets for, say, events will ensure that search results for an events hosted on your Web site will provide a structured display of the information like this:

the fact that Google’s Rich Snippets are explicitly mentioned in the RDFa API draft document does seem to suggest commitment from a leading player which has a vested interest in processing structured information in order to improve the searching process.

And of course the “ECMAScript code that [Amy] found on the web that automatically extracts the event information from a page and adds an entry into a personal calendar” suggests that such RDFa information can be processed today without the need for support from Google.  Now does anyone know where Amy found this ECMAScript code?

About these ads

3 Responses to “RDFa API Draft Published”

  1. For any discussion of RDFa I’d like to know what benefits derive from embedding it in the document structure. I prefer this format: http://esw.w3.org/N3inHTML which still packages RDF in the document but doesn’t make a mess of the document structure and is MUCH easier to see mistakes in. Also it allows you to identify the graphs and make statements about them (such as the copyright and authorship of the triples).

    In other news, I’m working on some tools which will let you do some funky ajaxy things with javascript and RDF (including RDFa). ie. be able to live embed data from a URL using some trivial javascript.

  2. Hi Chris
    Thanks for the comment.

    In a previous post on “New W3C Document Standards for XHTML and RDFa” I wrote that “The best advice may be not to rush off to embed data in your HTML resource if you don’t need to“. In part that suggestion was based on the lack of maturity of the standards and the limited availablity of mainstream tools for creating and consuming RDFa data. But in addition I was also aware that there may be alternative approaches to embedded structured information in HTML pages using RDFa, such as the approach your have described.

    Of course a similar criticism could be made regarding use of N3inHTML!

  3. [...] RDFa API Draft Published [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: