A Blog Not Limited

to web design, standards & semantics

Microformats Profile URIs Updated

Apr 21, 2010

Published in

Microformats

If you've read my Getting Semantic With Microformats blog series or my book, Microformats Made Simple, you should be familiar with profile URIs for microformats and hopefully you are using them.

Recently, the microformats community completed updates to the profile URIs for all microformats, including most drafts. So now is the time for you to update your references!

Um, What?

If you are scratching your head, wondering what the hell I'm talking about, here's a bit of background:

All microformats have an associated XMDP, which defines the metadata and classes that are specified in a given microformat. And each profile has a unique URI that is used for referencing it on web pages containing the microformats it defines.

For example, the profile URI for XFN is http://gmpg.org/xfn/11, while the profile URI for hCalendar is http://microformats.org/profile/hcalendar.

Referencing these profiles in pages that contain microformats is recommended, but not required. But you never know if this will change in the future, so I personally recommend including them by default.

Referencing Profiles in HTML 4

To reference a profile on a page using HTML 4, you simply add the profile attribute to your page's <head> element:

<head profile="http://gmpg.org/xfn/11">

And if you use more than one microformat on your page, the W3C allows multiple profile values, separated by a single space character. For example, if you have both XFN and hCalendar on your page, you would use:

<head profile="http://gmpg.org/xfn/11 http://microformats.org/profile/hcalendar">

Combined Profile

There is also a combined profile URI for all non-draft microformats: http://microformats.org/profile/specs.

So if you are using more than one non-draft microformat on your page, you can use this combined profile, rather than listing all of the individual profiles for each microformat:

<head profile="http://microformats.org/profile/specs">

For draft microformats, you can't use the combined profile; you need to specify the profile for that particular draft. If you are referencing both non-draft and draft microformats, you can use the combined profile URI along with the profiles for drafts:

<head profile="http://microformats.org/profile/specs http://microformats.org/profile/hatom http://microformats.org/profile/hresume">

The above example indicates I'm using the combined profile, as well as the profiles for the hAtom and hResume draft microformats.

Profiles in HTML5

The HTML5 specification has dropped the profile attribute for <head>, so if you are using HTML5, you need to declare your microformats profile URIs differently than I've described above.

In HTML5, you actually have two options. You can declare the URI as the href of a visible hyperlink (<a>) or a hidden link (<link>) that has rel="profile" assigned:

<p>This page is microformat friendly: <a rel="profile" href="http://microformats.org/profile/hcalendar">hCalendar</a>, <a rel="profile" http://gmpg.org/xfn/11">XFN</a>.<p>

<link rel="profile" href="http://microformats.org/profile/specs" />

Personally, for my HTML5 sites, I will be using this second example in my <head>. This will mean, though, that I may have multiple <link>s in my document <head>, especially if I'm using more than one microformat that is not included in the combined profile URI. Not really an issue for me, but worth mentioning.

For more detail, the Microformats Wiki explains HTML5 profiles further.

New URIs

Enough background, here's what you need:

Combined profile (hCard, hCalendar, rel-license, rel-tag, XOXO, XFN, VoteLinks)
http://microformats.org/profile/specs
adr (uses the hCard profile)
http://microformats.org/profile/hcard
geo (uses the hCard profile)
http://microformats.org/profile/hcard
hAtom
http://microformats.org/profile/hatom
hCalendar
http://microformats.org/profile/hcalendar
hCard
http://microformats.org/profile/hcard
hResume
http://microformats.org/profile/hresume
hReview
http://microformats.org/profile/hreview
rel-license
http://microformats.org/profile/rel-license
rel-nofollow
http://microformats.org/profile/rel-nofollow
rel-tag
http://microformats.org/profile/rel-tag
VoteLinks
http://microformats.org/profile/vote-links
XFN
http://gmpg.org/xfn/11
xFolk
http://microformats.org/profile/xfolk
XMDP
http://gmpg.org/xmdp/1
XOXO
http://microformats.org/profile/xoxo

There are also shortened URLs for these profiles you can use. See the Microformats Wiki for a list.

And that's all you need. Now go update!

HTML5 Cookbook

Interested in HTML5?
Get the Cookbook!

I was a contributing author for HTML5 Cookbook, available for sale on Amazon! Get yours now! (I hear chapters 1, 4 and 5 are particularly good.)

P.S. Don't forget my book Microformats Made Simple is still for sale!

Tags:

Share the Love

Ian Pitts's Gravatar

Ian Pitts opines:

04/21/2010

Very interesting and I hadn’t known that HTML5 dropped the profile attrib in the head element. Good thing I read your blog.

Any idea how long the old profile URLs will remain valid?

Emily's Gravatar

Emily responds:

04/22/2010

@Ian - I don’t know the “official” word on when the old URIs will be invalid. But a quick check of the old hCalendar profile (http://purl.org/uF/hCalendar/1.0/) shows it still resolves.

However, especially for microformats like hCalendar that now use the value class pattern, the old profiles may not reference the updated pattern.

Andrew's Gravatar

Andrew opines:

04/25/2010

Pleased I found this article. I’d just been adding an hcard to my HTML 5 site and didn’t realise using head/@profile would cause validation to fail.

Andrew's Gravatar

Andrew opines:

04/25/2010

And I forgot to mention, your article in .net magazine was the inspiration for me learning about microformats, even though I got to this post via Google!

Emily's Gravatar

Emily responds:

04/26/2010

@Andrew - So glad to hear you liked the article. I didn’t even realize it was out ... thanks for letting me know :)

LK's Gravatar

LK opines:

06/15/2011

Hey there, I used <code><link rel=“profile” href=“http://gmpg.org/xfn/11” /></code> and in the validator I get an error: “Bad value profile for attribute rel on element link: Keyword profile is not registered.” It also claims any use of rel must be found on the Microformats wiki, here http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions

Is there a reason rel=profile is not on the microfomats wiki?

Commenting is not available in this channel entry.

The Coolest Person I Know

Emily Lewis

Yeah, that would be me: .

I'm a freelance web designer of the standardista variety, which means I get excited about things like valid POSH, microformats and accessibility. I ply my trade from my one-person design studio in Albuquerque, New Mexico 87106 USA.

A Blog Not Limited is my personal blog where I pontificate about web design, web standards, semantics and whatever else strikes my fancy. Head on over to Emily Lewis Design if you'd like to see my work or, even better, hire me.

More

I Tweet, Therefore I Am

Follow @emilylewis on Twitter!