W3C home > Mailing lists > Public > www-rdf-interest@w3.org > September 2000

Re: RDF Namespaces and Attributes (again)

From: Perry A. Caro <caro@Adobe.COM>
Date: Sat, 30 Sep 2000 18:58:58 -0700
Message-ID: <39D69A62.D32C947@corp.adobe.com>
To: www-rdf-interest <www-rdf-interest@w3.org>
Jason Diamond wrote:
> Given this:
> 
> <rdf:RDF xmlns:rdf="..." xmlns:schema="...">
>   <rdf:Description about="http://subject">
>     <schema:predicate resource="http://object" foo="bar" baz="quux"/>
>   </rdf:Description>
> </rdf:RDF>
> 
> Does your parser require the property element to be this: (?)
> 
> <schema:predicate rdf:resource="http://object" foo="bar" baz="quux"/>

Jason, you have landed in the middle of the XML Namespace unqualified
attribute controversy.  Do unqualified attributes "inherit" the namespace of
their element, or not?  What does this mean for RDF?

It seems to me that you are arguing for "foo" and "baz" to NOT be in the
"schema:" namespace.  I think that is a valid interpretation, but I don't
think it is the most popular one.  The popular one seems to be that
unqualified attributes "inherit" their namespace from their element. 
Appendix A.2 of the XML Namespace spec is oft (mis?)interpreted to have that
meaning.

If A.2 is clear about anything, it is clear that for this example:

<rdf:RDF xmlns:rdf="...">
	<rdf:Description about="this" rdf:about="that" ... />
</rdf:RDF>

"about" and "rdf:about" are two completely different attributes.  So where
does that leave RDF?  Beats me.

While there isn't a very good understanding of the XML Namespace spec today,
there was even less when the RDF spec was being drafted.  In hindsight, it
was probably a mistake to treat attribute and element names as if they were
interchangeable (and to wed namespaces to schemas to URIs, but that's
another tar pit :-), but for better or worse, RDF assumes they are.  So what
do we do?

At a minimum, the RDF FAQ should deprecate using unqualified names for
properties when in the abbreviated (attribute) form.  For the rest ...

> Do you generate the following two statements: (?)
> 
> (http://subject, schema:foo, "bar")
> (http://subject, schema:baz, "quux")

Yes, and without the "rdf:" on resource, it would also generate:

  (http://subject, schema:resource, "http://object")

> My preference would be to not assume that foo and baz came from the "s"
> namespace and silently ignore those attributes.

While I think that is a valid interpretation, I just don't think it will
make you any friends. :-)  If the author of your example above INTENDED for
foo and baz to be in s, I think that author would be annoyed if you ignored
his properties, even if his practice was questionable.  You can't even point
to the spec and claim that the RDF is not well-formed, since it is.  There's
no good answer to this (so far), so I took a conservative approach: better
to have too much information, even if it is spurious, than to lose
information.

> > <?xml version="1.0"?>
> > <Foo about="me" and="you" xmlns="schema:"/>
> 

While my trivia question is indeed a trick question, it isn't because
rdf:RDF is missing.  rdf:RDF is optional, as indicated by production [6.1].

Perry
Received on Saturday, 30 September 2000 21:59:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:44 GMT