Subject: Atom namespace, qname-uri-qname roundtripping

From: Benjamin Nowack <[email-masked]>
Date: Sun, 31 Jul 2005 14:53:18 +0200

Hi,

as the atom namespace is declared as "http://www.w3.org/2005/Atom"
(i.e. without a trailing separator such as "/" or "#"), term URIs
from atom documents are expanded by xml parsers to
   - http://www.w3.org/2005/Atomfeed
   - http://www.w3.org/2005/Atomtitle
etc.
This makes it difficult for automated qname generation after
atom docs have been processed by generic aggregators which
mix terms from different vocabularies. It would be nice if
atom adopted good practice from rdf vocabularies such as
dc, cc, rss 1.0, etc and used a trailing separator, so that
re-serialized data doesn't end up as
   <Atomfeed xmlns="http://www.w3.org/2005/">
which will then break simple atom parsers that ignore
xml namespaces.

(sorry if this has been discussed before, but the ML archive
didn't seem to be searchable..)

cheers,
benjamin

--
Benjamin Nowack

Kruppstr. 100
45145 Essen, Germany
http://www.bnode.org/

---

From: Graham <[email-masked]>
Date: Sun, 31 Jul 2005 14:19:05 +0100

>    - http://www.w3.org/2005/Atomtitle

Exactly which part of the XML namespaces spec backs up this behaviour?

Graham

---

From: Benjamin Nowack <[email-masked]>
Date: Sun, 31 Jul 2005 15:55:27 +0200

>Exactly which part of the XML namespaces spec backs up this behaviour?
No idea, but that's what libxml returns. Which expanded URI would you
say should be generated from the qname "atom:feed" given the current
namespace uri?

best,
benjamin

--
Benjamin Nowack

Kruppstr. 100
45145 Essen, Germany
http://www.bnode.org/

---

From: Graham <[email-masked]>
Date: Sun, 31 Jul 2005 15:16:54 +0100

On 31 Jul 2005, at 2:55 pm, Benjamin Nowack wrote:

> No idea, but that's what libxml returns.

What function are you using?

> Which expanded URI would you

There's no such thing. <feed xmlns="http://www.w3.org/2005/Atom">  
represents the element "feed" in the namespace "http://www.w3.org/ 
2005/Atom", and nothing else. There's no way of merging them.

Graham

---

From: James Cerra <[email-masked]>
Date: Sun, 31 Jul 2005 08:01:12 -0700 (PDT)

> Benjamin Nowack wrote:
> > Graham wrote:
> > > Benjamin Nowack wrote:

Strictly speaking there is no standard "expanded URI" form for XML names [1]. 
Each XML name has two parts:

1) a namespace URI
2) a no-colon name

Together they identify the element or attribute names used in a document. 
Think of the namespace URI as like a person's surname (like Nowack) and the
no-colon name as a person's given name (like Benjamin).  However, they are
separate things as defined by the spec and not initially meant to be
concatenated.  It would be like concatenating a string and a
java.sql.Connection object.  ;-)

However, two different methods were invented that define what an "expanded URI"
could look like.  James Clark came up with one method called Clark notation
[2].  In it, you prefix and postfix the namespace URI with squigle brackets, as
in:

{http://www.w3.org/2005/Atom}

Then you simply append the no-colon name:

{http://www.w3.org/2005/Atom}feed

This has the advantage that it preserves the semantics of XML names (that the
namespace URI is separate from the no-colon name).  However, in practice it is
hard to work with sometimes.  As an alternative - for their work with RDF/XML -
the W3C came up with the RDF interpretation [3], where a namespace URI:

http://www.w3.org/2005/Atom

is simply appended to the beginning of the no-colon name:

http://www.w3.org/2005/Atomfeed

That's apparently what libxml does.  As you can see, with Atom's namespace it
is a mess.  It is also a mess with XHTML's namespace, XSLT's namespace, and
most document-oriented namespaces.  But is is still a valid URI that RDF could
still use.

With RDF-compatible data-oriented namespaces, they are often appended with a
"/" or a "#" or another separator for consistency.  If Atom followed this
pattern, the above might be:

http://www.w3.org/2005/Atom#feed

where the namespace URI is:

http://www.w3.org/2005/Atom#

I think this is a good idea and that the Atom Spec should use a hash mark at
the end like that.  The spec authors just want to annoy us RDF folks, I think. 
;-)  Of course "it is too late to change."  Then again, it has been too late to
change for a looooonnnnngggggg time now.  That excuse by the IETF is very very
annoying to me given how long it has been.  But enough of that rant....

-- Jimmy Cerra

[1] See the spec: http://www.w3.org/TR/REC-xml-names/

[2] Tutorial at: http://www.jclark.com/xml/xmlns.htm

[3] Tutorial at: http://www.w3.org/TR/rdf-primer/

P.S. I think you could use a little more help than currently offered on the
Atom mailing list.  They can be very confrontational and unhelpful sometimes. 
:-(  Hope this message is informative!  :-)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

---

From: "A. Pagaltzis" <[email-masked]>
Date: Sun, 31 Jul 2005 17:22:54 +0200

>    - http://www.w3.org/2005/Atomtitle

Let’s see some other examples of W3C namespaces:

• http://www.w3.org/1999/xhtml
• http://www.w3.org/1999/XSL/Transform
• http://www.w3.org/2001/XMLSchema
• http://www.w3.org/XML/1998/namespace

Hmm…

PS.: looking at those makes we wonder what all the hubub with the
capitalization of “Atom” in “http://www.w3.org/2005/Atom” was
about…

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

---

From: Benjamin Nowack <[email-masked]>
Date: Sun, 31 Jul 2005 17:19:40 +0200

On 31.07.2005 15:16:54, Graham wrote:
>There's no such thing.

I see, thanks for the clarification.

(I guess atom never intended to allow free -as in speech *and* in
beer- data mixing anyway, but another namespace would perhaps have
facilitated the inclusion of atom data in existing rdf tools.)

so long,
benjamin

--
Benjamin Nowack

Kruppstr. 100
45145 Essen, Germany
http://www.bnode.org/

---

From: Graham <[email-masked]>
Date: Sun, 31 Jul 2005 16:32:11 +0100

On 31 Jul 2005, at 4:01 pm, James Cerra wrote:

> most document-oriented namespaces.

Were the RDF folks not smart enough to think of this problem and come  
up with a better system or a workaround?

> http://www.w3.org/2005/Atomfeed

I'm off to start the Atomf working group which will produce a  
standard specification for eed documents.

Graham

---

From: David Powell <[email-masked]>
Date: Sun, 31 Jul 2005 16:34:27 +0100

> facilitated the inclusion of atom data in existing rdf tools.)

I would recommend shifting Atom into a separate AtomRDF namespace if
you want to use it with RDF tools. You'll probably need to anyway to
disambiguate things in Atom that are context sensitive, eg link/@type
vs title/@type.

Actually this raises an issue with my Atom/RDF model.  I currently
convert Simple Extension Elements to RDF properties, but I probably
need to create another triple to preserve the namespace URI of the
property - eg:

_:entry                        <http://example.comlattitude>         "53"
<http://example.comlattitude>  ns:namespaceURI                        <http://example.com>

otherwise, it won't be possible to round-trip properties.

-- 
Dave

---

From: Bill de hÓra <[email-masked]>
Date: Sun, 31 Jul 2005 16:42:44 +0100

James Cerra wrote:

> ;-)  Of course "it is too late to change."  

It is too late to change it. In RDF, it's all URIs, not namespaces, not
qnames, not something-else, so it doesn't matter if you work to spec.
This only comes up when you are trying to roundtrip RDF through RDF/XML
(since XML namespaces is such a flaky technology, depending on it leaves
you exposed to roundtripping issues).  RDF itself doesn't have the
notion of a vocabulary that you might want to corden off in a namepace.
Arguably, RDF technologies which are baking in 'using prefix as uri' are
building on sand.

[All of which reinforces my belief that XML Namespaces are broken as
designed.]

cheers
Bill

---

From: David Powell <[email-masked]>
Date: Sun, 31 Jul 2005 16:49:01 +0100

> up with a better system or a workaround?

It is an RDF/XML problem, not an RDF problem, and on the list of
RDF/XML problems, there are plenty more serious ones.

Anyway, it is only a problem if you are trying to use ns-qualified
elements that aren't RDF/XML as input to an RDF/XML processor - or
something similar. I'm not really surprised that that doesn't work too
well.

WebDAV does the same thing with namespaces btw[1].

[1] http://lists.w3.org/Archives/Public/w3c-dist-auth/1999OctDec/0343.html

-- 
Dave

---

From: Bill de hÓra <[email-masked]>
Date: Sun, 31 Jul 2005 16:56:50 +0100

> up with a better system or a workaround?

You should consider digging through the history. The XML folks were the
ones who weren't as you put it, 'smart enough'  (XML namespaces) and the
RDF folks weren't any smarter given they went along with the XML folks
anyway (RDF/XML). The ensuing RDF/XML workaround (fragids as
punctuation) doesn't work and raises a bunch of other issues related to
what # actually identifies on the HTML Web. There's no general case
solution to this, it's architectural, which is why it gets kicked up the
W3C TAG periodically.

cheers
Bill

---

From: Benjamin Nowack <[email-masked]>
Date: Sun, 31 Jul 2005 18:00:06 +0200

Thanks for the pointers, Jimmy,

and thanks for the p.s. note, just thought that clear *practical*
reasons could have made someone rethink the ns decision, but I'm
surely late in the game. (That's at least a  good reason to
directly leave it again. I paid my tax already ;)

cheers,
benjamin

--
Benjamin Nowack

Kruppstr. 100
45145 Essen, Germany
http://www.bnode.org/