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

On Nov 15, 2011, at 21:35 , Toby Inkster wrote:

> 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>
> 

Sigh.... This means that @resource is on the black list, too...


> 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.
> 

What this means is that the processing would begin by not having a subject at all. I am not yet sure what the effects would be. IN any case, lots of backward compatibility issues: although I dislike them, but all those stylesheet triples would disappear, because they are almost always generated through the <head> and its magic property.

A more complicated solution is to 'copy' a possible @about, @typeof, or @resource attribute in <html> to the <body> or <head> elements, unless those are present; if there is nothing on <html> then the magic stuff kicks in.

> 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.
> 

I do not think that works. I may have very legitimate reasons to use

<body typeof="T">

ie, to create a blank node of type 'T'.

Ivan


> 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>
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Wednesday, 16 November 2011 08:05:30 UTC