(mis)using XML 'syntactic' namespaces

I am expecting/hoping David Booth to send a formal comment soon 
containing the following example.
I am sending this to the WG list now, because of time difference issues 
and because I think this issue merits discussion, and I would like to 
ensure that we have had adequate e-mail before the next telecon.

I am not including David's suggested solutions, since I am not sure 
exactly where he is at with them. I expect they will be included in a 
formal comment.

====

quoted from David Booth

Does an XML namespace necessarily imply a certain set of semantics?  For 
example, suppose Freddy at example.org defines a convenient XML schema 
for writing a person's legal residence ("a:primaryAddress") a vacation 
home address ("a:secondaryAddress"), such as:

<a:root xmlns:a="http://example.org/AddressSchema.xml">
   <a:primaryAddress>25 Park St, Rochester, NY</a:primaryAddress>
   <a:secondaryAddress>88 Spring St, Salem, MA</a:secondaryAddress>
</a:root>

Freddy makes the XML schema definition downloadable from the namespace 
URI, and separately provides prose documentation explaining the meaning 
and purpose of a:primaryAddress and a:secondaryAddress.

Later, Ralph needs a schema for billing and shipping addresses and he 
notices that Freddy's AddressSchema has the exact form he needs: 
a:primaryAddress could represent the billing address and 
a:secondaryAddress could represent the shipping address.  In other 
words, Ralph wishes to reuse the syntax but not the semantics.  (This is 
analogous to a type of inheritance in OO programming, though at the 
moment I'm forgetting what it is called.  Structural inheritance?)  Raph 
notes that an XML schema only defines the structure of a document -- not 
the semantics -- and the namespace spec does not seem to say anything 
about the semantics of a namespace either.  Ralph reuses Freddy's schema 
by reference, and provides separate prose documentation to his users 
explaining that the syntax of Freddy's schema is being reused but the 
semantics are different.  Example:

<a:root xmlns:a="http://example.org/AddressSchema.xml">
   <a:primaryAddress>123 Winter St, Palo Alto, CA</a:primaryAddress>
   <a:secondaryAddress>444 El Camino, San Diego, CA</a:secondaryAddress>
</a:root>

Is Ralph permitted to do this?  If not, what spec prohibits it?  If so, 
then suppose that Freddy later decides to update his XML schema document 
at http://example.org/AddressSchema.xml to declare a GRDDL 
transformation in the namespace document such that the above example 
would be GRDDL transformed to RDF like:

. . .
foo:lucy foo:legalResidence "25 Park St, Anytown, NY".
foo:lucy foo:vacationAddress "88 Spring St, Othertown, MA".

Ralph on the other hand wants the semantics of one of his documents to 
be GRDDL transformed to RDF like:

. . .
fum:desi fum:billingAddress "123 Winter St, Palo Alto, CA".
fum:desi fum:shippingAddress "444 El Camino, San Diego, CA".

How can Ralph indicate that the semantics of his documents are different 
from Freddy's semantics?

====
end of quote

Jeremy


-- 
Hewlett-Packard Limited
registered Office: Cain Road, Bracknell, Berks RG12 1HN
Registered No: 690597 England

Received on Friday, 25 May 2007 09:53:22 UTC