Re: Yet another instanceof test

Mark Birbeck wrote:
> Hi Ivan,
> 
> I hope you had a good trip.

Yep! Except that I did not sleep at all coming back, which was... last
night. You can easily deduce the rest:-(

> 
>> I attach yet another test that I believe addresses an issue not covered
>> by the others. We had a discussion at some point on the list, and got to
>> an agreement, that an 'instanceof' placed on the <html> element would
>> automatically generate a type for the whole document by virtue of the
>> fact that there is an implicit @about="" on the <html>.
> 
> We actually agreed that @about="" should apply to <head>. 

Ouch.


>                                                            Just to
> re-emphasise the rationale, it's because we need to be careful that
> certain constructs don't change the meaning of typical HTML mark-up.
> For example:
> 
>   <html>
>     <head instanceof="foaf:PersonalProfileDocument">
>       <link rel="foaf:maker" ... />
>       .
>       .
>       .
> 
> If the 'default @about' was placed on <html> then <head> would acquire
> a bnode due to the presence of @instanceof, and the @rel would apply
> to the bnode and not to the current document. 

Looking at the (approved) pair of test cases #0049 and #0050 you are
right if the usage pattern is:

<html>
   <head  instanceof="foaf:PersonalProfileDocument">

(in which case my submitted test case is wrong!)

However, I must admit that _my_ usage pattern has always been

<html instanceof="foaf:PersonalProfileDocument">
  <head>
  ...

which is actually quite correct and the situation

<html instanceof="foaf:PersonalProfileDocument">
   <head>
     <link rel="foaf:maker"...

would not yield any unexpected triples. And, frankly, in an RDFa setting
I do not see _any_ reason why we would have to give a different
treatment for <head>. In pure HTML it is of course true that <head> is
the place where a bunch of extra statements on the document are made,
but it is exactly the power of RDFa to allow the author to make
statements anywhere in the document, hence <head> does not have (in this
sense) any special meaning.

Having seen all that, I begin to question the wisdom of the #0050
choice. I am more more tempted to come to the simple model of Ben at
some point, that says: @instanceof is a shorthand; ie,

<div instanceof="bla:bla" ....>
...
</div>

is the _same_ (and could even be pre-processed:-) as

<div>
   <span rel="rdf:type" resource="bla:bla"/>
...
</div>

and that 'preprocessing' would happen regardless of what other RDFa
attributes are present (or not) on <div>. With all the other rules we
have around, the subject of rdf:type would be clear (and would solve the
possible issues related to <html about=""/>).

Remind me why we deviated from this simple model? The issues around
@instanceof begin to be very spaghetti like, and I am less and less
convinced it is worth it!

>                                                However, since in HTML
> this applies to the current document:
> 
>   <html>
>     <head>
>       <link rel="foaf:maker" ... />
>       .
>       .
>       .
> 
> then I believe that the addition of @instanceof is merely adding a
> statement, and not changing the subject of other statements. The only
> way to achieve this is to put @about as 'close' as possible to those
> statements, i.e., on <head>.
> 
> Of course this then means that we need a default for <body>, since
> there would no longer be one on <html>, and there are a number of ways
> to address that:
> 
>   * put @about on <html> as well;
> 
>   * put @about on <body>;
> 
>   * indicate that the contents of <head> are processed *before* the
> contents of <body>
>     and that <head> essentially sets the context for processing <body>.
> 

There _is_ one special treatment, which is that <base> sets the real
value of @about="". I do not see why a statement on processing *before*
would solve anything and I think I would be quite opposed to it... It
breaks the clean processing model we have now...

> My preferred approach is *both* the third one and second. :) I believe
> that there are other reasons for defining the processing rules quite
> precisely so that <head> is processed before <body>, which I won't go
> into here since they are more for 'future work'. But also I think we
> need to have @about on <body> for exactly the reasons we need it on
> <head>, which is to stop the presence of @instanceof from unexpectedly
> changing the subject for all child statements.
> 

Well, reading through my own lines above, I wonder if

- simplify @instanceof (in particular, change test #0050, no blank node!)
- put the default on <html>

is not a cleaner approach altogether.

Ivan


> Regards,
> 
> Mark
> 

-- 

Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Monday, 29 October 2007 12:54:49 UTC