W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > November 2011

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

From: Toby Inkster <tai@g5n.co.uk>
Date: Tue, 15 Nov 2011 20:35:09 +0000
To: RDF Web Applications Working Group WG <public-rdfa-wg@w3.org>
Cc: sysbot+tracker@w3.org
Message-ID: <20111115203509.13f5fb65@miranda.g5n.co.uk>
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

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

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>

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

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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:27 UTC