It seems your theme has none of the RDF stuff found in core D7. I am slightly ignorant on the topic, but is that something you are planning on adding back in? Is RDF even compatible with HTML5?

Comments

spaceninja’s picture

Status: Active » Postponed (maintainer needs more info)

Those are excellent questions. I haven't found any answers, myself. All the RDFa stuff was prefaced with xml:, so I pulled it out for this first release. I've read that RDF is or will be compatable with HTML5, but it's unclear how to make that work. Once I have more info, I'll add all the RDFa stuff back in.

Chris Gillis’s picture

Sounds like exactly where I am at. I aim to research his over the next couple of days, so I'll let you know what I find.

spaceninja’s picture

Thanks, I'd really appreciate that. I'll be sure to give you credit if you're able to figure it all out.

Chris Gillis’s picture

Okay, here are my initial thoughts (for anyone to comment on before I go too far with testing).

In order to use xmlns (necessary for all RDF stuff), we must use the XML serialization for HTML5 (XHTML5).

According to http://wiki.whatwg.org/wiki/FAQ
"The XHTML serialization must be served using an XML MIME type, such as application/xhtml+xml or application/xml. Unlike XHTML1, XHTML5 must not be served as text/html."

From what I can see, the only thing holding people back from using application/xhtml+xml is the fact that Internet Explorer still does not support it. From what I've read, IE asks the user to download the page, instead of rendering it.

There seem to be two possible ways around this:

1) Content Negotiation
Sniff the capabilities of the user agent and serve either application/xhtml+xml (with all of our xmlns and RDF goodies) or text/html (without any of our xmlns and RDF goodies). So when seeing the page in IE, we will get none of the benefit of RDF.

2) XSL
There are rumors that it may be possible to serve IE application/xml with an XSL stylesheet, that mirrors our CSS stylesheet that the rest of the browsers get. The downside is that we are maintaining two stylesheets that should be as identical as possible (although I tend to serve an IE-Only stylesheet anyway using conditional comments). The plus is that we are not modifying our content-layer for browser compatibility. That is what makes this my preferred option, and I will begin further research.

It seems odd to me that this has not been explored more. I cannot find anywhere on the internet that is successfully using xhtml5 with xmlns.
Also, congratulations to Boron for being the first (and, I think, only) D7 HTML5 theme!

Chris Gillis’s picture

Okay, after researching more, it seems my first assumption could be incorrect.

According to: http://dev.w3.org/html5/rdfa/rdfa-module.html
"It is currently unknown whether or not the xmlns: attribute will be supported in HTML5"

IF it is, then we will not need to serve as xml, we can stick with html, and still use our namespaces. My current feeling is to chuck all the namespaces straight back in to this theme. I imagine that it may chuck an error on current validators, but the HTML5 spec is a moving target anyway, so those validators will change over time. Hopefully, HTML5 will be pressured into allowing xmlns for backward compatibility, and they will not allow those attributes to cause validation to fail.

I think we can have our cake and eat it too!

Chris Gillis’s picture

So, I think we just need to change line 37 of html.tpl.php from:
<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
to
<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>" xmlns="http://www.w3.org/1999/xhtml" <?php print $rdf_namespaces; ?>>

(Sorry, I'm not a cool cvs patcher-dude)

Chris Gillis’s picture

Status: Postponed (maintainer needs more info) » Active

Perhaps we could add in this xmlns stuff, only if the RDF module is present. We can then advise that the RDF module will fail current html5 validators. If users wish to validate, they can disable the RDF module.

To see an example of failed validation: http://validator.nu/?doc=http://www.gyglive.com/

robflaherty’s picture

I'm far from an expert on RDF this but it's something I've been working on lately, trying to combine the RDFa features of OpenPublish (a Drupal package) with HTML5. Here are a few things I've gleaned so far.

The latest RDFa+HTML draft has some conformance recommendations. For instance, the HTML element should have a version attribute with a value of "HTML+RDFa 1.1".
http://www.w3.org/TR/2010/WD-rdfa-in-html-20100624/

Per the HTML5 spec, the only valid value for HTML documents for an xmlns attribute is "http://www.w3.org/1999/xhtml". Also in the spec: "When parsed by an HTML parser, the attribute ends up in no namespace, not the "http://www.w3.org/2000/xmlns/" namespace like namespace declaration attributes in XML do". So I'm guessing that has some implications beyond validation.

Of course all these things are just about guaranteed to change... =)

JeremyFrench’s picture

subscribe

chichiMi5’s picture

subscribe

chia’s picture

subscribe

Jeff Burnz’s picture

You guys had any updated thoughts on this, I'm mulling over HTML5 as well and this is a bit of a show stopper.

JeremyFrench’s picture

So long as you use drupal_attributes() where needed, RDFa in drupal pretty much works, all you will need to do for this theme is change the header

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">
<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>" version="HTML+RDFa 1.1"
<?php print $rdf_namespaces; ?>>

I think is all that will need to be changed in html.tpl.php

Although it does look like the html5 and rdfa groups really don't see eye to eye. I think this will work.

David Vespoli’s picture

subscribe

rovo’s picture

subscribe

Jeff Burnz’s picture

@13, thanks Jeremy, I've run with your suggestion for now. I have to admit I've kind of snuck into the Boron queue here to ask this question and my HTML5 theme is actually over here. I made the doctype, html version and profile stuff dependent on RDF module be enabled so its actually possible to validate the theme (switch off RDF first). Cheers, have to keep an eye on this for sure and hopefully we see some resolution to the this whole RDFa in HTML5 debacle.

spaceninja’s picture

Hey everyone, I just wanted to reassure you all that this project (and this particular issue) is not dead. My boss has me working on other projects right now, but once I get some more Boron time, I will probably be implementing something similar to what Jeff did for AdaptiveTheme. Also note the W3C just uploaded a new version of HTML+RDFa today, so I'll be reading that and seeing if I can figure out where the ball is going to land on this one. Until we have a final answer, Jeff's solution seems the most practical to me. Thanks for your patience.

Jeff Burnz’s picture

@spaceninja - thanks for the heads up re the new version of HTML+RDFa, cheers.

First glance of the Oct19 editors draft crops up this:

"The removal of the @version attribute to bring the specification more in-line with HTML5's version-less design."

I assume that refers to the the html version.

spaceninja’s picture

Status: Active » Fixed

Jeff, I've gotta hand it to you, your solution is simple and elegant. I've copied your code into the latest version of Boron (giving you credit, of course). Thanks for spending the time to investigate it, the whole thing makes my head hurt.

Thanks also to everyone else who participated in this thread.

Anyone who actually uses RDF features - please download the latest version and let me know if there are any problems. Since this isn't something I know how to use, I can only assume it's working properly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mark Nielsen’s picture

I'm working on an HTML5 theme and this issue has arisen for me too. Like you, spaceninja, I'm no expert with RDFa or the semantic web, and I quickly get a headache with this stuff. I can see how the web might benefit from being more semantic, but I'm a long way from understanding the specifications.

Anyhow, I thought I'd add a bit of a reality check here, which is a conclusion I've just come to after some more hours of research and head-scratching.

The Semantic Web and RDFa certainly seem like Good Things. And it's cool that Drupal is on the cutting edge by offering it. I'm sure we all feel proud of that. However, as of today, I'm not sure what concrete benefits RDFa holds for me or my clients. I am not aware of any technologies functioning today, or likely to become available this year or next, which will take advantage of RDFa in my clients' sites. Now the stuff I don't know on this topic is pretty vast, so I eagerly await correction, but so far I've not found any concrete benefits.

On the other hand, by adding RDFa to my HTML5, it appears I can't validate my site. Now, I'm not a purist by any means, and I don't believe a bit of invalid mark-up hurts anyone. But validation is a really useful tool for spotting errors in my pages; for example, un-closed DIVs which are breaking my layout. I do use it. Not loads, but a lot more than I think I'll feel any benefits from RDFa.

So, if I implement RDFa in my theme, I gain a set of vague benefits, or the promise of future benefits. But I loose something important and tangible today. I will probably want to implement RDFa in the future, when HTML5+RDFa is more stable and has a more reliable validator. But for now, I'm inclined to conclude it's a bit early for RDFa. I'll lean back on my default axiom: "the early bird may well catch the worm, but it's the second mouse that generally gets the cheese" :)

I hope this stream of conciousness was of some help! Thanks, spaceninja, for your pioneering work on HTML5/Drupal.

rovo’s picture

I had read an article, now slightly dated, but I do believe it outlines some of the tangible benefits to RDF being correctly implemented; such as an increase in visibility. It might be worth a read, but basically it seems to allude to major sites reporting a significant increase in traffic, not by the traditional rankings of search engines, but by the increase findability RDF enabled pages provide.

http://www.scienceforseo.com/semantic-web/semantic-web-spam-semspam/

Midas Man’s picture

Please see http://drupal.org/node/1085168#comment-4371304 for my comment on HTML5 and RDF validation errors