RDF Namespaces and Attributes (again)

I realize that no one likes to discuss the thorny details of syntax here but
I'm working on an RDF parser in C and really need some clarification on some
issues.

We've seen this one before: According to the formal grammar in Section 6,
the attributes "ID", "about", and friends are NOT qualified with the RDF
namespace.

Section 6 also mentions that: "It is recommended that property names always
be qualified with a namespace prefix to unambiguously connect the property
definition with the corresponding schema."

Does this mean that property attributes without namespace prefixes should
NOT generate a statement? (With the exception of "type" via production
6.11).

I can handle that. It seems to be the most logical interpretation of the
spec that I can come up with but certainly not what most people would
reasonably assume. Including whoever wrote the fourth example from Section
2.2.2:

<rdf:RDF>
  <rdf:Description about="http://www.w3.org/Home/Lassila">
    <s:Creator rdf:resource="http://www.w3.org/staffId/85740"/>
  </rdf:Description>

  <rdf:Description about="http://www.w3.org/staffId/85740">
    <v:Name>Ora Lassila</v:Name>
    <v:Email>lassila@w3.org</v:Email>
  </rdf:Description>
</rdf:RDF>

Notice the "rdf" prefix on the "resource" attribute of the "s:Creator"
property element. This is illegal according to production 6.18. There are
examples that both qualify and do not qualify the resource attribute
throughout the spec.

In Sections 7.3, 7.4, and 7.5, "parseType" is qualified on all elements that
are not in the RDF namespace. Productions 6.32 and 6.33 don't allow for
this.

Section 7.5 contains an example that qualifies "about". See production 6.7.

Curiously, member attributes (according to production 6.31) are the only
attributes required to be qualified in the RDF namespace. Why are they
singled out?

I can't find any examples in the M&S with a typed node resource that
contains a property attribute from the same namespace as the element. Given
the recommendation quoted above, I would assume that they would be qualified
even though most humans would assume they would inherit their namespace from
the element. As it seems the writers of the M&S also assumed.

My questions are: Can I enforce this in my parser? Should I follow the
grammar as precisely as possible even though it will probably not parse
quite a bit of hand written RDF out there? Are the examples that explicitly
qualify "about", "resource", and "parseType" simply in error?

Or should I be a little more flexible? And allow these attributes to also be
qualified in the RDF namespace? That seems reasonable but it's currently
illegal.

Consider the last example in Section 2.2.2:

<rdf:RDF>
  <rdf:Description about="http://www.w3.org/Home/Lassila">
    <s:Creator>
      <s:Person about="http://www.w3.org/staffId/85740">
        <v:Name>Ora Lassila</v:Name>
        <v:Email>lassila@w3.org</v:Email>
      </s:Person>
    </s:Creator>
  </rdf:Description>
</rdf:RDF>

Ignoring the fact that there's no namespace delcarations, the "about"
property attribute on the "s:Person" typed node resource is lacking an "rdf"
prefix. This is legal according to the grammar. But previous messages [1]
discussing this problem have suggested that RDF parsers treat unprefixed
attributes on elements as being in the same namespace of the element.

My parser currently does not generate triples for unqualified property
attributes (except type). But I wasn't considering "about" to be "rdf:about"
unless the element it was found on was in the RDF namespace. As a result,
the above "s:Person" resource has an anonymous URI. Of course, I'm going to
modify the parser to now check for "about" and "rdf:about" (even though
these are two different attributes). But this only works if we can guarantee
that property attributes must be qualified. What if the schema that "Person"
was found in above include a property called "about"?

I think (hope) we all agree that unqualified attributes do NOT inherit the
namespace of their element. Can somebody at the W3C please put that in
writing?

I'm not proposing any alternative syntax (although I would probably prefer
one). As Dan Brickley recently stated [2], this is a W3C Recommendation and
implementors should keep on implementing. But implement what? The bugs and
inconsistencies in the RDF M&S should be clarified as quickly as possible
before RDF really takes off. Why hasn't this already been done?

Jason.

[1]
http://lists.w3.org/Archives/Public/www-rdf-interest/2000May/0004.html
[2]
http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0074.html

Received on Saturday, 30 September 2000 14:59:01 UTC