RE: RDF Namespaces and Attributes (again)

Hi, Dan.

Thanks for the pointers. I had missed Lee Jonas' writeup and didn't notice
any mention of this problem on the issue list. Going through Brian's list of
issues was really eye-opening. I really appreciate all of the effort you and
a lot of other people are putting into getting RDF accepted. A lot of people
claim it's too complicated and when I encounter problems like this, I start
to agree with them. I hope that they can be resolved so that there's nothing
left to complain about.

For what it's worth, I think assuming <rdf:element about/> == <rdf:element
rdf:about/> isn't quite adequate. The typed node abbreviation would require
you to prefix the about attribute. That doesn't seem to be too cumbersome of
a concept for people to grasp but I'd rather keep things uniform and not add
any of our own semantics to the interpretation of a document's namespaces.

Here's my proposed modified grammar:

  [6.1] RDF            ::= ['<rdf:RDF>'] obj* ['</rdf:RDF>']
  [6.2] obj            ::= description | container
  [6.3] description    ::= '<rdf:Description' idAboutAttr? bagIdAttr?
propAttr* '/>'
                         | '<rdf:Description' idAboutAttr? bagIdAttr?
propAttr* '>'
                                propertyElt* '</rdf:Description>'
                         | typedNode
  [6.4] container      ::= sequence | bag | alternative
  [6.5] idAboutAttr    ::= idAttr | aboutAttr | aboutEachAttr
  [6.6] idAttr         ::= ' ' ['rdf:'] 'ID="' IDsymbol '"'
  [6.7] aboutAttr      ::= ' ' ['rdf:'] 'about="' URI-reference '"'
  [6.8] aboutEachAttr  ::= ' ' ['rdf:'] 'aboutEach="' URI-reference '"'
                         | ' ' ['rdf:'] 'aboutEachPrefix="' string '"'
  [6.9] bagIdAttr      ::= ' ' ['rdf:'] 'bagID="' IDsymbol '"'
 [6.10] propAttr       ::= typeAttr
                         | NSprefix ':' propName '="' string '"'
                               (where NSPrefix != 'xml'
                                 and if NSprefix == 'rdf',
                                   propName != 'ID', 'about', 'aboutEach',
                                     'aboutEachPrefix', 'bagID',
                                     'resource', or 'parseType')
                               (with embedded quotes escaped)
 [6.11] typeAttr       ::= ' ' ['rdf:'] 'type="' URI-reference '"'
 [6.12] propertyElt    ::= '<' propName idAttr? '>' value '</' propName '>'
                         | '<' propName idAttr? parseLiteral '>'
                               literal '</' propName '>'
                         | '<' propName idAttr? parseResource '>'
                               propertyElt* '</' propName '>'
                         | '<' propName idRefAttr? bagIdAttr? propAttr* '/>'
 [6.13] typedNode      ::= '<' typeName idAboutAttr? bagIdAttr? propAttr*
'/>'
                         | '<' typeName idAboutAttr? bagIdAttr? propAttr*
'>'
                               propertyElt* '</' typeName '>'
 [6.14] propName       ::= Qname
 [6.15] typeName       ::= Qname
 [6.16] idRefAttr      ::= idAttr | resourceAttr
 [6.17] value          ::= obj | string
 [6.18] resourceAttr   ::= ' ' ['rdf:'] 'resource="' URI-reference '"'
 [6.19] Qname          ::= [ NSprefix ':' ] name
 [6.20] URI-reference  ::= string, interpreted per [URI]
 [6.21] IDsymbol       ::= (any legal XML name symbol)
 [6.22] name           ::= (any legal XML name symbol)
 [6.23] NSprefix       ::= (any legal XML namespace prefix)
 [6.24] string         ::= (any XML text, with "<", ">", and "&" escaped)
 [6.25] sequence       ::= '<rdf:Seq' idAttr? '>' member* '</rdf:Seq>'
                         | '<rdf:Seq' idAttr? memberAttr* '/>'
 [6.26] bag            ::= '<rdf:Bag' idAttr? '>' member* '</rdf:Bag>'
                         | '<rdf:Bag' idAttr? memberAttr* '/>'
 [6.27] alternative    ::= '<rdf:Alt' idAttr? '>' member+ '</rdf:Alt>'
                         | '<rdf:Alt' idAttr? memberAttr? '/>'
 [6.28] member         ::= referencedItem | inlineItem
 [6.29] referencedItem ::= '<rdf:li' resourceAttr '/>'
 [6.30] inlineItem     ::= '<rdf:li' '>' value </rdf:li>'
                         | '<rdf:li' parseLiteral '>' literal </rdf:li>'
                         | '<rdf:li' parseResource '>' propertyElt*
</rdf:li>'
 [6.31] memberAttr     ::= ' ' ['rdf:'] '_n="' string '"' (where n is an
integer)
 [6.32] parseLiteral   ::= ' ' ['rdf:'] 'parseType="Literal"'
 [6.33] parseResource  ::= ' ' ['rdf:'] 'parseType="Resource"'
 [6.34] literal        ::= (any well-formed XML)

Sorry about 6.10 looking so ugly.

I've made the "rdf" prefix optional on all RDF attributes regardless of the
element's prefix.

I've also made a prefix on all property attributes required as suggested by
the recommendation in the prose part of the formal grammer. Production 6.10
tries to exclude generating a triple for attributes where the prefix is rdf
and the local part is any of "ID", "about", and friends.

The only exception to requiring a prefix on property attributes is in
production 6.11 with the type property. On a side note, I've often wondered
why subject, predicate, and object weren't allowed as property attributes
where subject and predicate (by definition) have to be resources but object
would be a literal.

For the sake of uniformity, I've also made the rdf prefix on member
attributes (6.31) optional.

Not only does this conform to the namespace spec (attributes do not
automatically inherit their element's namespace) I'm pretty sure that this
also makes all of the examples in the M&S valid without any sort of change.

Comments, anyone?

Jason.

> -----Original Message-----
> From: www-rdf-interest-request@w3.org
> [mailto:www-rdf-interest-request@w3.org]On Behalf Of Dan Brickley
> Sent: Saturday, September 30, 2000 12:39 PM
> To: Jason Diamond
> Cc: www-rdf-interest
> Subject: Re: RDF Namespaces and Attributes (again)
>
>
>
> On Sat, 30 Sep 2000, Jason Diamond wrote:
>
> > 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.
>
> It would be great to put syntax issues behind us; as you say, we
> shouldn't have this (or similar) threads every time someone takes on the
> task of writing an RDF parser. In the meantime, this is the right palce
> for such a thread.
>
> > 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.
>
> This is indeed a developer FAQ. I've sadly failed to get a revision to
> the RDF Issue list done before leaving for the Dublin Core
> workshop next week. Brian McBride has however made a great contribution
> by collecting together, see:
> http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0240.html
>
> Dan C mentioned this too in context of FRODO RDFSViz,
> http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0224.html
> and offers one perspective on an answer.
>
> On this particular issue, Lee Jonas was good enough to take time out to
> write it up in the style of the issue list I circulated,
> see
> http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0065.html
>
> I circulated the first pass at an issue list on the 5th Sept,
> http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0025.html
> http://www.w3.org/2000/03/rdf-tracking/ and the last update was
> 24 days ago, though given the traffic we've seen in september, it feels
> much longer!
>
>
> [...]
>
> > 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?
>
> I'm not an rdf syntax expert, so my honest answer is "I don't know". My
> instinct would be to accept qualifications of about, resource, parseType
> since the intent is clear, even if the spec isn't. There's a pretty
> clear need for an errata entry here I think. I'll be seeing Ralph Swick
> soon, will investigate the "life after REC" question of errata.
>
> Having a clear problem statement couched in terms of an errata
> statement that might go on
> http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/errata would be a
> help. I think we probably have much of that in the messages to date.
>
> [...]
>
> > 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?
>
> You're right, this needs chasing up, nailing down, and other such
> metaphors. I launched the issue list at the start of the most
> disconcertingly active month in RDF history, and have (to be
> honest) been a little bit blown off course by day to day
> events. Despite the bugs and inconsistencies, a lot of code is getting
> built. And you're right, we owe it to you (and other developers) not to
> waste your time through poor documentation of known problems.  I hope my
> existing skeletal Issue List, subsequent threads this month, and
> Brian's excellent issue/thread summary go some way towards addressing
> this need. Plenty more to do; I'm thankful I'm not attempting this
> alone. My concern right now is not becoming a bottleneck in managing the
> Issue list, though it'll (see my point ;-) be over a week before I'll
> likely do any more on that front.
>
> hoping this doesn't put you off parser hacking,
>
> Dan
>
> >
> > 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 17:14:25 UTC