Re: ISSUE-117 (about-on-HTML): Consider disallowing @about on <html> [RDFa 1.1 in HTML5]

On Tue, 15 Nov 2011 17:55:23 +0000
RDF Web Applications Working Group Issue Tracker
<sysbot+tracker@w3.org> wrote:

> Consider disallowing @about on <html> [RDFa 1.1 in HTML5]

This suggestion is supposed to avoid ambiguous situations like the
following:

	<html about="#foo">
	  <title property="dc:title">Foo</title>
	</html>

Parsed as XHTML, you get the following triple, as you might expect:

	<#foo> dc:title "Foo" .

But parsed as HTML, you get:

	<> dc:title "Foo" .

Why? Notice the missing <head> element. An HTML parser (or indeed an
SGML parser supplied with an HTML DTD) will infer that there exists a
<head> element wrapping the <title> element. (Because the content model
of <html> does not allow <title> as a direct child element, and the DTD
says that <head> has an optional start tag. Yes, SGML is mighty clever,
but quite annoying at the same time.) Thus the parent element of
<title> is not <html>, but <head> when the example is parsed as HTML.

And of course, <head> and <body> have inferred about="" in XHTML+RDFa
and HTML+RDFa. Thus you end up with an example which gets parsed
differently in HTML+RDFa and XHTML+RDFa, yet very much non-obviously.

Disallowing @about on <html> does not solve the issue. Witness that the
same issue occurs here:

	<html resource="#foo">
	  <title property="dc:title">Foo</title>
	</html>

There are other possible ways of resolving this. Two which seem
preferable to me are:

1. Ditch the magic behaviour of the <head> and <body> elements in
HTML+RDFa. Preferably in XHTML+RDFa too.

2. Say that the magic behaviour of <head> and <body> only kicks in when
the <head> or <body> element carries the @typeof attribute. Preferably
in XHTML+RDFa too.

Solution #2 risks breaking fewer pages. After all, the magic behaviour
of <head> and <body> is mostly to allow things like:

	<body typeof="foaf:Document">

without creating a new blank node. Cases where @typeof is not present
on <head> or <body> but the magic makes a difference will be pretty
rare.

But #1 brings (X)HTML+RDFa closer to RDFa Core, which has got to be a
good thing.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Tuesday, 15 November 2011 20:34:40 UTC