Facebook, HTML Standard and RDFa [Update]

Facebook recently introduced Open Graph Protocol to "meta-tag" webcontent, creating some confusion about existing web standards.

Here is an examples taken from opengraphprotocol.org:

<html xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
...
</head>
...
</html>

The HTML meta element does not allow a property attribute. When you integrate Facebooks OpenGraph data into your website, following the guide, be advised your website will no longer be HTML conform:

<meta property="og:title" content="The Rock" />

You can easily verify this by running the opengraphprotocol.org html code itself through W3C's validation service.

[Update]

Facebook's approach is inspired by RDFa, but they seem to ignore the fact, that without the corresponding RDFa doctype, opengraph enabled sites will be invalid (X)HTML (thanks to kahless for mentioning).

So add your RDFa doctype, and your page is HTML compliant. I'm still working on an example to combine this with HTML5 and the og: namespace. If someone get's this done, contact me.

May 12, 2010

back