Re: xmlns, uri+name pairs or just uris..? Clarification needed.

"McBride, Brian" wrote:
> >From section 6 of the model and syntax spec:
> 
>   Each propertyElt E contained by a Description element results in the
>   creation of a triple {p,r,v} where:
> 
>    1.p is the expansion of the namespace-qualified tag name (Generic
>      Identifier) of E. This expansion is generated by concatenating the
>      namespace name given in the namespace declaration with the LocalPart
>      of the qualified name.
> 
> This defines the mapping of qname to a URI.

My opinion, which I know is shared by at least some of the implementors on
this list, is that this part of the RDF spec is in error.

For one thing, it contradicts the model suggested by two other
specifications: the XML Infoset and the XML Namespace spec itself.

Excerpt from XML Infoset <http://www.w3.org/TR/xml-infoset>

  4.1. Core Conformance
  
  An XML processor conforms to the XML Information Set core if it provides
  at least the following information items and properties:
[snip]
             2. All element information items, including the following
   	      properties: 
  
                     [namespace name] 
                     [local name] 
                     [children] 
                     [attributes] 
                     [declared namespaces] 
                     [base URI] 
                     [parent] 

[And similar properties for attributes]

The Infoset model strongly suggests to me that the data model for XML is to
maintain the namespace name and local name as separate items.

Excerpt from XML Namespace <http://www.w3.org/TR/REC-xml-names/#ns-expnames>

    A.3 Expanded Element Types and Attribute Names

    For convenience in specifying rules and in making comparisons, we
    define an expanded form, expressed here in XML element syntax,
    for each element type and attribute name in an XML document.

    [Definition:] An expanded element type is expressed as an empty
    XML element of type ExpEType. It has a required type attribute
    which gives the type's LocalPart, and an optional ns attribute
    which, if the element is qualified, gives its namespace name.

    [Definition:] An expanded attribute name is expressed as an empty
    XML element of type ExpAName. It has a required name attribute
    which gives the name. If the attribute is global, it has a
    required ns attribute which gives the namespace name; otherwise,
    it has a required attribute eltype which gives the type of the
    attached element, and an optional attribute elns which gives the
    namespace name, if known, of the attached element.

    Example:
    <ExpEType type="section" ns="urn:com:books-r-us" />

Though this is a non-normative appendix, it does imply that the expanded
name of an element or attribute is intended to be treated as a pair of
strings: a local name, and a namespace name.

For another thing, namespace names tend to be several times larger than
local names. The implication for storage of concatanated expanded names is
wasted memory.  On the other hand, storing expanded names as pairs of
strings lends itself towards sharing storage of either name.

I think you can guess from the above how I chose to implement expanded names
in our RDF processor and API.

Perry

Received on Thursday, 27 July 2000 17:47:03 UTC