Re: chaining-friendly rules for @instanceof

Hi Ben,

_yes_, this is more or less the way I thought back when I made my last
implementation round on the matter...

I checked the processing step in the current document, and my feeling is
that it is very simple to modify them to fit your description. Indeed:

[[[
- The section on [current element indentifier] should be removed from #2
- After entry #4 we can say something:

The [current element identifier] is set as follows: if @about is
present, then [current element identifier] = @about; otherwise, it will
be set to [current object resource].

(note that a Bnode is generated for [current object resource] even if
@href/@resource etc are not present, and this is exactly what we want!)

- Then entry #5 comes into the picture.
]]]

Well...:-( it is not yet 100% complete, though. At present, #5 of the
processing steps say that chaining will occur if any triples are
generated via step #5. And chaining is defined as substituting the
[current resource] by [current object resource] before recursion. What
this means is that

<el about="#bla" instanceof="blabla">

1. Will generate a bnode for [current object resource]
2. Will generate a <#bla> a <blabla> triplet (which is fine!)
3. Will chain with the bnode defined for [current object resource]!

And I do not think step #3 is right.

A way of avoiding that in the processing rules is to say in #5

"If any triples are generated and @about is not present then the
[chaining] flag is set to true"

Indeed the value of [chaining] flag has already been set to true or
false if, eg, there was a @resource; this remark will take care of the
corner case of:

<el instanceof="blabla">

How does that sound?

We may have this issue closed. Time for planning for a LC Working Draft?:-)

Ivan

Ben Adida wrote:
> 
> Hi all,
> 
> Manu wanted me to express my proposed @instanceof rules in a way similar
> to what he recently posted [1], so that we could compare.
> 
> 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.
> 
> Here's the rule summary.
> 
> ==============================
> 
> THE RULES IF ALL ATTRIBUTES ARE PRESENT
> ---------------------------------------
> 
> On an element, processing proceeds as follows:
> 
> 1) @about  [set the subject]
> 2) @rel   [set one or more predicates]
> 3) @rev   [set one or more reverse predicates]
> 4) @property   [set one or more literal-object predicates]
> 5) @resource/@href/@src [set object for @rel, subj for @rev]
> 6) @content  [set object for @property]
> 7) @datatype  [set datatype of object for @property]
> 8) The URI object becomes the CHAINING NODE, which becomes the inherited
> subject for all contained elements.
> 9) @instanceof  [sets the type of the CHAINING NODE]
> 
> 
> 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.
> 
> So, for clarity, let me propose a different take on my rules that
> attempts to cover more markup, not just the all-attributes example. This
> is a bit more complicated, but I think any attempt to write up complete
> parsing rules for @instanceof will be about as complicated.
> 
> On element <EL>:
> 
> A) Process RDFa attributes (@about, @rel, @rev, @property, @content,
> @datatype, @href, @resource) on <EL> as if there were no @instanceof.
> 
> B) Determine the RDF identity of the element:
>  - the URI object if it's there [@resource/@href/@src]
>  OTHERWISE
>  - the chaining bnode if there's @rel/@rev
>  OTHERWISE
>  - the value of an explicit @about if there is one
>  OTHERWISE
>  - a new bnode.
> 
> C) @instanceof applies to the RDF identity of the element it's on, and
> causes chaining on that RDF identity if it hasn't been triggered yet.
> 
> 
> ==============================
> 
> -Ben
> 
> [1] http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2007Nov/0001
> 

-- 

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 Friday, 9 November 2007 10:19:58 UTC