Re: rdf:nodeID and external entities?

At 12:18 11/12/2002 +0000, Dave Beckett wrote:

> >>>Joshua Allen said:
> >
> > http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-blank-nodes
> >
> > Spec does not seem to mention the impact that expansion of external
> > entities would have on rdf:nodeID.  For example, if I have:
> >
> > File1.xml
> > <rdf:Description rdf:nodeID="1">
> > &extern;
> > </rdf:Description>
> >
> > File2.xml
> > <rdf:Description rdf:nodeID="1">
> > ....
> > </rdf:Description>
> >
> > I would expect that the two would _not_ resolve to the same blank node,
> > even if &extern; was pointing to File2.xml.  In other words, I expected
> > the spec to say something like:
> >
> > "values for rdf:nodeID are evaluated with respect to the baseURI
> > property of their containing element"
>
>An interesting point that hadn't come up beforex.

+1  Good catch.

>   I certainly don't
>want to depend on XML detail such as external entities, so it would
>have to be expressed in terms of infoset infoitems, such as the
>in-scope base URI.
>
>We've been considering the blank node identifiers to be scoped to the
>RDF graph

Forgive me butting in here a little Dave, I just want to check my 
understanding.

Strictly, there are no such things as blank node id's in the rdf 
graph.  The nodes have their own identity, but we have to use ID's when we 
write the graph down e.g. in n-triples or rdf/xml.  So in this case, the 
ID's are a feature of the xml serialization, right?

>but I guess we either have in-scope base URI (baseURI
>accessor of element event), or use the outermost XML document element
>to pick from.

Personally, I'm a bit nervous of that.  My recollection is that the WG has 
discussed these node id's as being file scoped.  If we start making them 
relative to the base uri then they are starting to look like URI's.  They 
are not and that will lead to confusion.

Do we have a test case here:

   <rdf:Description xml:base="&foo;" rdf:nodeID="A">
     <foo:prop>foo</foo:prop>
   </rdf:Description>
   <rdf:Description xml:base="&bar;" rdf:nodeID="A">
     <foo:prop>bar</foo:prop>
   </rdf:Description>

I would expect the answer to be:

   _:xxx foo:prop "foo" .
   _:xxx foo:prop "bar" .

Returning to the original question, and again for my education and begging 
forgiveness of my ignorance; I tend to think of external entities as being 
about macro inclusion, in which case I would expect Joshua's example to be 
such that the to nodes identified by "1" would be the same.  Is it possible 
to construct a similar example from other xml specs, e.g. using an ID 
attribute.  If I had in XML:

   <pref:local ID="foo"/>
   &extEntity
    ...

where extEntity pointed to

   <pref:local ID="foo"/>
   ....

and ID is an xml identifier attribute, i.e. you are only allowed one in a 
document, would that be legal XML?

I ask as this might be a good pattern to follow.

Brian

Received on Friday, 13 December 2002 06:38:01 UTC