I'd appreciate if anyone can comment on the support the HTML+RDFa 1.1 draft currently enjoys.

I need to implement support for the Open Graph protocol to an existing HTML5 web application and wish to do so without introducing XHTML.

So, as far as I managed to figure out, this should be completely valid:

<html lang="en">
<head xmlns:og="http://opengraphprotocol.org/schema/">
    <title>The Rock (1996)</title>
    <meta property="og:title" content="The Rock"/>
    <meta property="og:type" content="movie"/>

If I implemented RDFa in a non-XML document, would Facebook, Google and other services be able to parse the data correctly? I can't find the links right now, but there are some resources on the web that have suggested monkeypatching your Web applications to serve RDFa pages as XML to requests originating from Facebook, Google, etc., just to be on the safe side. Do you consider that to be a necessity at this moment?

asked 16 Nov '10, 13:18

Filip%20Dupanovi%C4%87's gravatar image

Filip Dupanović
accept rate: 0%

edited 16 Nov '10, 22:34

tobyink's gravatar image

tobyink ♦

Google doesn't currently read OGP data - it mostly just supports its own RDF vocabulary (see http://rdf.data-vocabulary.org/), though has rcently announced support for an ecommerce vocab, GoodRelations.

Anyway, Google and Facebook certainly support RDFa in non-X HTML.

Plenty of open source RDFa implementations support HTML too - off the top of my head, my Perl library (RDF-RDFa-Parser), Damien Steer's java-rdfa, and Ivan Herman's PyRDFa do. Pretty much any in-browser Javascript implementation will to, as they'd just use the browser's built-in HTML parser.

By the way, OGP's namespace is now xmlns:og="http://ogp.me/ns#".

Edit 1, added: you should be aware that the W3C validator doesn't currently support HTML+RDFa, only XHTML+RDFa.

permanent link

answered 16 Nov '10, 22:18

tobyink's gravatar image

tobyink ♦
accept rate: 26%

edited 16 Nov '10, 22:24

Wow, thanks Toby! That's exactly what I needed to know, that FB, Google and other services will parse HTML RDFa! And thanks for the heads-up on the W3C validator; I already noticed it'll throw errors that @xmlns:prefix is not allowed, no matter where I placed it.

(17 Nov '10, 15:46) Filip Dupanović Filip%20Dupanovi%C4%87's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 16 Nov '10, 13:18

question was seen: 1,756 times

last updated: 16 Nov '10, 22:34