W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > November 2007

Re: chaining-friendly rules for @instanceof

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Fri, 09 Nov 2007 00:32:35 -0500
Message-ID: <4733F0F3.708@digitalbazaar.com>
To: RDFa <public-rdf-in-xhtml-tf@w3.org>

Ben Adida wrote:
> The main driver for my rules is to make it easy for @instanceof to be
> used on chaining nodes, so that one can say "I know a person named
> 'Ralph'", or even the more complicated "I know a person who knows a
> person who knows a person named 'Bill'".
> The result is something a tad more complicated than Manu's rules, but
> fairly consistent and able to express the important use case above.

The main issues I had with what I thought Ben was proposing were that:

1. The rules sounded very complex and corner case-y.
2. The rules would be hard to explain to a publisher.

Both of those don't seem to hold anymore. Ben's rules are simple enough
to summarize and it doesn't look like there are a bunch of special
cases. It also addresses what happens when every RDFa attribute is on an

Mark, it would be very helpful to see your proposed approach at this
point as I don't think we've really seen it written down.

> Of course, the above rules, just like Manu's, describe only the parsing
> when all attributes are there. For example, in Manu's case, the rules
> have to be tweaked to consider the
> <img src="photo.jpg" instanceof="foaf:Image" />
> markup, since @instanceof is processed before @src.

You're correct, the rules would have to change... I may have left out a
detail on how all processing happens. In the above case, the triple
would be:

<photo.jpg> a <foaf:Image>.

This is because, in my little RDFa parser world, all RDFa attributes on
an element are processed in relation to the current element's scope
first, and then the parent elements scope. Thus, if you had this:

<p about="#me" rel="foaf:depiction">
 <img src="photo.jpg" instanceof="foaf:Image" />

<#me> foaf:depiction <photo.jpg>
<photo.jpg> a <foaf:Image>

The updated rules would be:

1. @about       [Set the Subject]
2. @instanceof  [Set the Subject Type]
3. @rel/@rev    [Set the Predicate]
4. @property    [Set the Predicate]
5. @resource    [Set the Object or Subject if there is none]
6. @href        [Set the Object or Subject if there is none]
7. @src         [Set the Object or Subject if there is none]
8. @content     [Set the Object or Subject if there is none]
9. @datatype    [Set the Object Data Type]

I haven't checked the above rules against all of the examples, so I
don't know how watertight the above set of rules are... however, I'd be
happy to drop them at this point for Ben's rules.

-- manu

Manu Sporny
President/CEO - Digital Bazaar, Inc.
blog: Bitmunk Launches World's First Open Music Recommendation Service
Received on Friday, 9 November 2007 05:32:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:25 UTC