osdir.com
mailing list archive

Subject: Re: telecon Thursday, 1600 UTC - msg#00142

List: org.w3c.html.rdf

Date: Prev Next Index Thread: Prev Next Index


Ben Adida wrote:
[snip]
>
> This is more complicated than it needs to be, in particular whether
> there is a hanging rel or not does not affect the parsing of
> @instanceof. Here's how I would write the rule:
>
> The subject of @instanceof on element X is:
> - the value of @about if @about exists on X, _otherwise_
> - the value of @src if @src exists on X, _otherwise_
> - a new blank node corresponding to element X
>
> In all cases:
> - the subject of @instanceof may complete hanging @rel's just like any
> other subject declaration does, _and_
> - the subject of @instanceof becomes the inherited subject for child
> elements, _and_
> - the subject of @instanceof is also the subject for @rel, @property
> (and the object for @rev) when those attributes are present on X.
>
> In your mental model, there is basically only one thing missing:
> @instanceof is syntactic sugar for @rel="rdf:type" _but_ with an
> explicit setting of @about to a new bnode if there is no other explicit
> subject.
>
> Hopefully, that makes you happier :)
>

Well... not really:-(

- the rules that you describe above have the merit;-) to be clear. I may
have missed it before, but that is the first time I see them so clearly
stated; thanks!!!!

- but... why? I mean: why is it necessary to introduce an extra rule?
Why isn't it good enough to equate it to the behaviour of @rel and that
is it?

Ivan




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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: telecon Thursday, 1600 UTC

Ivan Herman wrote: > 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"> Not quite... because @instanceof really is *on* an element, I don't think it can ever really apply to something that's inherited. That's the difference. That's why it "creates a new bnode." In fact, if there is no @about or @src on the element where @instanceof is present, there is *always* a new bnode corresponding to that element. It might complete a hanging @rel, but that's orthogonal. > _If_ I use explicit rdf:type, and take: Yes, that's not quite the same thing, because @rel inherits from above, whereas @instanceof does not, it determines its subject entirely locally, and that subject may happen to complete a hanging @rel. > This was the new feature brought in by Mark, in fact; ie, this effect of > 'merging' blank nodes that I did not like:-). Don't think of it as merging blank nodes. It's more "if there is a hanging rel and no node is created to complete it, then a blank node takes is inserted to chain with additional properties." > 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. I agree with the above markup and triples, but it's not really a special case, see below. > 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" . No, I don't think so. The subject of @instanceof is entirely determined using local information on that element. You can look at the <div> and from that <div> know exactly the subject of @instanceof. So, in the case above, you would indeed get the triples you thought you weren't getting: > [ > rdf:type a:type; > a:p "Bla" > ]. > [ > rdf:type another:type; > another:p "Bla again" > ]. So let's look at the rules to see where we disagree: > 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. This is more complicated than it needs to be, in particular whether there is a hanging rel or not does not affect the parsing of @instanceof. Here's how I would write the rule: The subject of @instanceof on element X is: - the value of @about if @about exists on X, _otherwise_ - the value of @src if @src exists on X, _otherwise_ - a new blank node corresponding to element X In all cases: - the subject of @instanceof may complete hanging @rel's just like any other subject declaration does, _and_ - the subject of @instanceof becomes the inherited subject for child elements, _and_ - the subject of @instanceof is also the subject for @rel, @property (and the object for @rev) when those attributes are present on X. In your mental model, there is basically only one thing missing: @instanceof is syntactic sugar for @rel="rdf:type" _but_ with an explicit setting of @about to a new bnode if there is no other explicit subject. Hopefully, that makes you happier :) -Ben

Next Message by Date: click to view message preview

Re: telecon Thursday, 1600 UTC

Hi Ivan, > - the rules that you describe above have the merit;-) to be > clear. I may > have missed it before, but that is the first time I see them so > clearly > stated; thanks!!!! > > - but... why? I mean: why is it necessary to introduce an > extra rule? > Why isn't it good enough to equate it to the behaviour of > @rel and that > is it? I'm pretty sure I agree with everything Ben has said, and I think he has explained it particularly clearly. So I'll just look at one aspect of what you say, which is that @instanceof is 'equivalent' to a @rel with rdf:type as its value, and why do we need an additional rule. It isn't actually the case that they are equivalent...at least not in terms of the evolution of the idea. This was mentioned a few times in my long emails to try to explain this whole thing, which probably got lost. (I know...they were very long emails...) But the evolution of RDFa was such that at one point we had this: <div about="A"> <link rel="[B]" href="C" /> </div> We decided at a certain point that link/meta as children of an element would 'attach' a property to the element they were a child of, and if the element they were a child of had no subject, one would be created. In other words, we made link/meta children behave in a way that was different to, say, span. Which means that this: <div> <link rel="[B]" href="C" /> </div> is equivalent to this: <div about="_:a"> <link rel="[B]" href="C" /> </div> but this is not: <div> <div rel="[B]" href="C" /> </div> Now, you might say 'hang on...I've never heard of this!', and you might be right. :) The reason is that although we never 'dropped' this behaviour of link/meta in the 'big picture', when we (Ben, I think) discovered that some browsers relocate any link/meta elements that appear in the body to the head, we had to say that we couldn't support this feature, at least for XHTML+RDFa. But we've not abandoned this feature in principle, and for example, it is still in XHTML 2+RDFa. Anyway...the point is that although we are unable to support this feature in XHTML+RDFa now, the fact is that @instanceof (and @class before it) remains a shorthand for it. Which means that this: <div instanceof="C"> ... </div> is equivalent to this: <div> <link rel="rdf:type" href="C" /> </div> which as I said, is the same as this: <div about="_:a"> <link rel="rdf:type" href="C" /> </div> This consistency is quite important, because I think we'll find going forward that there are a number of situations where 'creating a new item and giving it properties' is the right thing to do with certain types of predicates. (I won't go into the rationale here, for why link/meta were made to behave differently to span/div, etc., but it's quite an important idea in RDFa, and it solved a lot of problems that were extremely tricky before we made that change. These problems are not obvious in XHTML+RDFa, but they definitely are in XHTML 2+RDFa, and this solution turned out to be extremely helpful there.) Regards, Mark -- Mark Birbeck, formsPlayer mark.birbeck@xxxxxxxxxxxxxxx | +44 (0) 20 7689 9232 http://www.formsPlayer.com | http://internet-apps.blogspot.com standards. innovation.

Previous Message by Thread: click to view message preview

Re: telecon Thursday, 1600 UTC

Ivan Herman wrote: > 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"> Not quite... because @instanceof really is *on* an element, I don't think it can ever really apply to something that's inherited. That's the difference. That's why it "creates a new bnode." In fact, if there is no @about or @src on the element where @instanceof is present, there is *always* a new bnode corresponding to that element. It might complete a hanging @rel, but that's orthogonal. > _If_ I use explicit rdf:type, and take: Yes, that's not quite the same thing, because @rel inherits from above, whereas @instanceof does not, it determines its subject entirely locally, and that subject may happen to complete a hanging @rel. > This was the new feature brought in by Mark, in fact; ie, this effect of > 'merging' blank nodes that I did not like:-). Don't think of it as merging blank nodes. It's more "if there is a hanging rel and no node is created to complete it, then a blank node takes is inserted to chain with additional properties." > 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. I agree with the above markup and triples, but it's not really a special case, see below. > 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" . No, I don't think so. The subject of @instanceof is entirely determined using local information on that element. You can look at the <div> and from that <div> know exactly the subject of @instanceof. So, in the case above, you would indeed get the triples you thought you weren't getting: > [ > rdf:type a:type; > a:p "Bla" > ]. > [ > rdf:type another:type; > another:p "Bla again" > ]. So let's look at the rules to see where we disagree: > 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. This is more complicated than it needs to be, in particular whether there is a hanging rel or not does not affect the parsing of @instanceof. Here's how I would write the rule: The subject of @instanceof on element X is: - the value of @about if @about exists on X, _otherwise_ - the value of @src if @src exists on X, _otherwise_ - a new blank node corresponding to element X In all cases: - the subject of @instanceof may complete hanging @rel's just like any other subject declaration does, _and_ - the subject of @instanceof becomes the inherited subject for child elements, _and_ - the subject of @instanceof is also the subject for @rel, @property (and the object for @rev) when those attributes are present on X. In your mental model, there is basically only one thing missing: @instanceof is syntactic sugar for @rel="rdf:type" _but_ with an explicit setting of @about to a new bnode if there is no other explicit subject. Hopefully, that makes you happier :) -Ben

Next Message by Thread: click to view message preview

Re: telecon Thursday, 1600 UTC

Hi Ivan, > - the rules that you describe above have the merit;-) to be > clear. I may > have missed it before, but that is the first time I see them so > clearly > stated; thanks!!!! > > - but... why? I mean: why is it necessary to introduce an > extra rule? > Why isn't it good enough to equate it to the behaviour of > @rel and that > is it? I'm pretty sure I agree with everything Ben has said, and I think he has explained it particularly clearly. So I'll just look at one aspect of what you say, which is that @instanceof is 'equivalent' to a @rel with rdf:type as its value, and why do we need an additional rule. It isn't actually the case that they are equivalent...at least not in terms of the evolution of the idea. This was mentioned a few times in my long emails to try to explain this whole thing, which probably got lost. (I know...they were very long emails...) But the evolution of RDFa was such that at one point we had this: <div about="A"> <link rel="[B]" href="C" /> </div> We decided at a certain point that link/meta as children of an element would 'attach' a property to the element they were a child of, and if the element they were a child of had no subject, one would be created. In other words, we made link/meta children behave in a way that was different to, say, span. Which means that this: <div> <link rel="[B]" href="C" /> </div> is equivalent to this: <div about="_:a"> <link rel="[B]" href="C" /> </div> but this is not: <div> <div rel="[B]" href="C" /> </div> Now, you might say 'hang on...I've never heard of this!', and you might be right. :) The reason is that although we never 'dropped' this behaviour of link/meta in the 'big picture', when we (Ben, I think) discovered that some browsers relocate any link/meta elements that appear in the body to the head, we had to say that we couldn't support this feature, at least for XHTML+RDFa. But we've not abandoned this feature in principle, and for example, it is still in XHTML 2+RDFa. Anyway...the point is that although we are unable to support this feature in XHTML+RDFa now, the fact is that @instanceof (and @class before it) remains a shorthand for it. Which means that this: <div instanceof="C"> ... </div> is equivalent to this: <div> <link rel="rdf:type" href="C" /> </div> which as I said, is the same as this: <div about="_:a"> <link rel="rdf:type" href="C" /> </div> This consistency is quite important, because I think we'll find going forward that there are a number of situations where 'creating a new item and giving it properties' is the right thing to do with certain types of predicates. (I won't go into the rationale here, for why link/meta were made to behave differently to span/div, etc., but it's quite an important idea in RDFa, and it solved a lot of problems that were extremely tricky before we made that change. These problems are not obvious in XHTML+RDFa, but they definitely are in XHTML 2+RDFa, and this solution turned out to be extremely helpful there.) Regards, Mark -- Mark Birbeck, formsPlayer mark.birbeck@xxxxxxxxxxxxxxx | +44 (0) 20 7689 9232 http://www.formsPlayer.com | http://internet-apps.blogspot.com standards. innovation.
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by