Re: telecon Thursday, 1600 UTC

Ben, Manu,

All your explanation make sense indeed, and resembles my 'mental' model
(that I would favour) that @instanceof is no more and no less than an
abbreviated form of <..rel="rdf:type" resource="THE_URI_OF_THE_TYPE">

Alas! While Manu's description is in line with this, Ben's description
is not. (Or I seem to have some mental blockage here that I cannot get
over.) This becomes significant in slightly more complex setups, so bear
with me, sorry for the slightly longer mail...

_If_ I use explicit rdf:type, and take:

<div about="#a" rel="some:thing">
   <div rel="rdf:type" resource="[a:type]">
      <span property="a:p">Bla</span>
   </div>
   <div rel="rdf:type" resource="[another:type]">
      <span property="another:p">Bla again</span>
   </div>
</div>

then, according to our current set of chaining rule we get:

<#a> some:thing [
        rdf:type  a:type;
        a:p       "Bla";
        rdf:type  another:type;
        another:p "Bla again"
     ].

This was the new feature brought in by Mark, in fact; ie, this effect of
'merging' blank nodes that I did not like:-).

However, if I use @instanceof instead:

<div about="#a" rel="some:thing">
   <div @instanceof="a:type">
      <span property="a:p">Bla</span>
   </div>
   <div @instanceof="another:type">
      <span property="another:p">Bla again</span>
   </div>
</div>

then I seem to get (eg, in Ben's example a while ago)

<#a> some:thing [
        rdf:type  a:type;
        a:p       "Bla"
     ];
     [
        rdf:type  another:type;
        another:p "Bla again"
     ].

Because, _in some cases_, @instanceof creates a new blank node and
_that_ is used to fill in the hanging rel from the parent.

On the other hand, if I have

<div about="#a">
   <div @instanceof="a:type">
      <span property="a:p">Bla</span>
   </div>
   <div @instanceof="another:type">
      <span property="another:p">Bla again</span>
   </div>
</div>

(Note the missing @rel on the top!). I presume what I would/should get is:

<#a>
        rdf:type  a:type;
        a:p       "Bla";
        rdf:type  another:type;
        another:p "Bla again" .

and not

[
  rdf:type  a:type;
  a:p       "Bla"
].
[
  rdf:type  another:type;
  another:p "Bla again"
].

Right?

So my questions have always been: _what exactly are the processing rules
for the creation of yet another blank node with @instanceof_?

Let me try to answer this question myself, maybe I get the essence of
what you guys have in mind. So here we go:

 - _If_
      @instanceof is (almost) the _only_ RDFa related property of
      an element (ie, no @about, @src, @property, @rel, @rev, though
      @resource and @href are probably allowed for this step)
     _and_
      The parent node has hanging rel-s
     _then_
      create a new BNode and assign that to:
        1. values of the hanging rels in the parent
        2. subject of the rdf:type
        3. assign this as new local subject for, eg, @property as
           well as for all descendents
 - _Otherwise_
      follow the rules established for @rel for hanging rels,
      subject for rdf:type, subject for possible @property,
      descendents, etc.

_If_ this is what you have in mind (and that seems to be in line with
all earlier examples), then... to borrow Ben's characterization, I am
not happy:-(. Ie, I find it confusing for the user, an unnecessary extra
complication for the implementation, and not really justified in my mind...

My proposal would be: _no_ exceptional behaviour whatsoever for
@instanceof. It should behave _exactly_ like @rel in all respects
because _it is just an abbreviation_, not an extra semantic rule in the
RDFa processing. If an extra blank node is necessary then @about="_:a"
can be used explicitly which, with the @rel rules, would yield exactly
what we want...

Ok. your turn to either try to convince me or simply vote me down:-)

Ivan

P.S. By the way, this is the same mental model that led me to the
@a="_:" proposal in [1]. And, as I say in [2], Mark's counterargument on
[1], as he put them forward in [3], did not convince me...


[1]
http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2007Dec/0086.html
[2]
http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2007Dec/0101.html
[3]
http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2007Dec/0100.html



Ben Adida wrote:
> Manu Sporny wrote:
>> Let's take it step-by-step to see if there is any disagreement on what
>> an implementation would do:
>>
>> <div about="#q" rel="q:r">
>>
>> At this point in the process, we have the following data in the parser:
>>
>> <#q> <q:r> [UNKNOWN_HANGING_REL_OBJECT]
>>
>> When we process the next line,
>>
>> <div instanceof="a:b"/>
>>
>> At this point in the process, we have the following data in the parser:
>>
>> <#q> <q:r> [UNKNOWN_HANGING_REL_OBJECT].  <---- incomplete triple
>> _:x <rdf:type> <a:b>.                     <---- complete triple
>>
>> The parser would then, upon seeing a target object for the
>> UNKNOWN_HANGING_REL, which is _:x, complete that triple. This would
>> result in the following data, and complete triples, in the parser:
>>
>> <#q> <q:r> _:x.
>> _:x <rdf:type> <a:b>.
>>
>> Does that make sense? Mark, Ben, Ralph, was this your understanding of
>> the processing rules for @instanceof as well?
> 
> Yes, that is exactly the model. The @rel with no object is "left
> hanging", waiting for completion. @instanceof always applies to the
> current element's subject, which may complete a hanging triple from above.
> 
> Specifically, a hanging rel can be completed either by
> 
> 1) @about on a child node, which then becomes an object of the hanging rel.
> 
> or
> 
> 2) a bnode created by @instanceof on an element with no @about or @src.
> 
> or
> 
> 3) an implied bnode if you just start hanging new properties using
> @property and @rel.
> 
> 
> Note how this works out nicely, starting with your markup:
> 
>   <div about="#q" rel="q:r">
>      <div instanceof="a:b" />
>   </div>
> 
> which yields
> 
>   <#q> q:r _:bn0 .
>   _:bn0 rdf:type a:b .
> 
> and then, if you suddenly choose to give the inner div an @about:
> 
>   <div about="#q" rel="q:r">
>      <div about="#foo" instanceof="a:b" />
>   </div>
> 
> it gives you the same RDF graph structure, only now with a named node:
> 
>   <#q> q:r <#foo> .
>   <#foo> rdf:type a:b .
> 
> That's the kind of consistent behavior that convinced me that Mark's
> chaining rules are the right model.
> 
> -Ben
> 

-- 

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 Saturday, 22 December 2007 08:53:56 UTC