Namespaces and RDDL

September 2001

C. M. Sperberg-McQueen



This document discusses the rationale and practical details of using RDDL documents as the retrievable resources at URIs which serve as the names of namespaces. The primary concern is namespaces defined by the W3C; some assumptions made here may not be applicable for other namespaces.
The document begins by describing some goals I take as a given. It then describes how RDDL (the Resource Directory Description Language) works [Borden/Bray 2001]; this necessitates some brief detours into discussions of the XML Linking Language [DeRose et al. 2001]. To illustrate, I describe two concrete examples: the document at the URI which names the XML Schema namespace, and a document which would describe important resources associated with the XHTML namespace.

1. Assumptions

I assume some things without further discussion here.
  • The W3C Namespaces Rec [Bray et al. 1999] does not require that a namespace name be dereferenceable.
  • It is nevertheless good practice in general for namespace names to be dereferenceable URIs.
  • The resource retrieved by dereferencing the namespace name should provide authoritative information about the namespace.
  • Some software will dereference the namespace name while searching for a schema it can use to validate data in the namespace (an XML DTD, an SGML DTD, an RDF Schema document, an XML Schema document, a SQL schema, or a schema in any of the many other schema languages used for formal definition of XML document types or other data.
  • Some software will dereference the namespace name while searching for dynamically loadable software it can use to process data in the namespace.
  • Some software will dereference the namespace name for reasons we cannot predict in advance.
  • Some human beings will dereference the namespace name in an attempt to find human-readable information explaining what the human being wants to know.
  • For any language (viewed formally as a set of strings) there may be an arbitrarily large number of schemas (viewed as consisting in or containing grammars). (This is a simple fact of formal language theory: different grammars can generate the same language.)
  • We must take it as a given that for any namespace there may be multiple languages. XHTML is a case in point; if we view languages in a formal way, then the strict, transitional, and other DTDs each define distinct languages. As a community, we have after long discussion established that these formally distinct languages do not have different namespace names; they all have, or are all associated with, or are all within, or all use the vocabulary of [pick any of the above phrasings] the same namespace.
  • The dereferenceable resource at a URI used as a namespace name should be human-readable and usefully machine-processable.
It will be useful to establish some terminology:
  • A name (other than a namespace name) is, for purposes of this document, a string of characters which matches the NCName production of [Bray et al. 1999].
  • A namespace name is a URI used to identify a namespace.
  • A namespace may, for purposes of this document, be regarded as a collection of names. In practice, some namespaces may have very well-defined internal structures (e.g. they may in effect be languages with formally defined syntax), and in many namespaces each name has a unique denotation, but neither syntax nor unique denotation is required by the Namespaces recommendation, and neither is guaranteed true of all namespaces. The combination of a namespace name and a name, sometimes called a `universal name', is not guaranteed to have a unique denotation; the only thing guaranteed by the Namespaces Rec is that people working independently in different namespaces will never accidentally cause name collisions.
  • A namespace name names or identifies a namespace.
  • A URI denotes a resource.
  • A namespace name, being a URI, denotes a resource. I call the resource denoted by a namespace name the namespace resource. The namespace resource is not identical to the namespace: one is a resource, and one is a collection of names.
  • If a URI is dereferenceable and immutable, the resource denoted by it is identical (or equivalent, for some meaning of equivalence) to the sequence of characters retrieved by dereferencing the URI.
  • If a URI is dereferenceable and mutable, the resource denoted by it is identical / equivalent at the time of retrieval to the sequence of characters retrieved by dereferencing the URI.

2. Background information

RDDL is an attempt to make it possible for the namespace resources to fulfil the goals outlined above, by making it possible to provide both human-readable and machine-processable information about the namespace in the same resource. Since software will dereference the namespace name looking for very different things, and we want to avoid long arguments about whether the namespace resource should be a DTD or an XML Schema document or any of the other candidates, RDDL effectively serves as a directory of where to find the particular form of resource being sought.
The RDDL vocabulary is intended as an extension to XHTML (although it could in theory be used to extend any markup language for human-readable textual material).

2.1. The RDDL resource element type

...

2.2. Well known natures (values of xlink:role)

The XLink specification says that the value of the xlink:role attribute on a simple link (and thus on rddl:resource) has the same meaning as on an xlink:locator element, for which the role attribute "suppl[ies] information about the resource in generic terms, outside of the context of a particular arc that leads to it; the role attribute indicates a property that the resource has".
The RDDL spec refers to the xlink:role attribute as specifying the nature of the resource. The value is always a URI. In general, when the resource being described is a document in a formally defined namespace, and the namespace name adequately distinguishes the nature of the resource [this means, necessarily, "adequately for some purpose"], then the namespace name should be used as the value. When the MIME type of the resource is the best indicator of its nature, then the RDDL spec recommends using a URI beginning http://www.isi.edu/in-notes/iana/assignments/media-types/.
A list of `well known' natures, i.e. values for the xlink:role element, are given at http://www.openhealth.org/RDDL/natures/. Among them are:
  • CSS style sheets: http://www.openhealth.org/RDDL/natures/
  • XML DTDs: http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml-dtd
  • mailboxes: http://www.rddl.org/natures#mailbox
  • HTML 4 in general: http://www.w3.org/TR/html4/
  • HTML 4 strict: http://www.w3.org/TR/html4/strict
  • HTML 4 transitional: http://www.w3.org/TR/html4/transitional
  • HTML 4 frameset: http://www.w3.org/TR/html4/frameset
  • XHTML: http://www.w3.org/1999/xhtml
  • XHTML 1.0 Strict: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict
  • XHTML 1.0 Transitional: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional
  • RDF Schema: http://www.w3.org/2000/01/rdf-schema#
  • XML Schema (Candidate Rec): http://www.w3.org/2000/10/XMLSchema
  • software written in Python: http://www.rddl.org/natures/software#python
  • software written in Java: http://www.rddl.org/natures/software#java
  • IETF RFCs: http://www.ietf.org/rfc/rfc2026.txt
  • ISO standards: http://www.iso.ch/
If no value is provided for the xlink:role attribute on a RDDL resource element, the default value is http://www.rddl.org/#resource -- i.e., it's just a resource. (We knew that already.)

2.3. Well-known purposes (values for xlink:arcrole)

The XLink specification says that on a simple link, the xlink:arcrole attribute ""

3. Examples

3.1. The XML Schema namespace

3.2. The XHTML namespace

4. Some shortcomings of RDDL

Some aspects of RDDL appear less than ideal, at least at first glance. Those that struck me as I wrote this note include the following.

4.1. Semantic bogosity

The RDDL resource element is defined as an XLink simple link; this is semantically bogus.
The RDDL resource element asserts a relation between a namespace and the resource identified by its xlink:href attribute.[1] Simple link elements, by contrast, assert a relation between their contents (or, more exactly, the simple link element itself) and the resource identified by their xlink:href attribute. The namespace is not identical to a network-accessible resource at all: it is an abstraction. Even if for some purposes we wish to treat the namespace as identical with the namespace resource (i.e. the resource retrieved by dereferencing the namespace name), the fact remains that in that case the namespace is the entire RDDL document, not a particular paragraph within it.
It would be semantically much cleaner to use an extended link, in which one locator identifies the namespace and the others identify other resources. (This would also allow users to associate schemas, stylesheets, etc. with arbitrary namespaces, not just with namespaces owned by the user. Equally, it would allow users to associate related resources with a namespace they own even if they cannot place a RDDL document at the URI which is the namespace name -- perhaps because of a recalcitrant Webmaster, or perhaps because the namespace name is not a dereferenceable URI.)
An extended-link version of the directory information for the XML Schema namespace might look something like this (note that many of the attributes can be defaulted and omitted from the actual document). More or less directly within the body, we embed a resource-directory element which identifies this link as providing a namespace directory:
...
<body>
  ...
  <div id="related.resources">
    <myrddl:resource-directory
      xmlns:myrddl="http://example.com/languages/myrddl"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xlink:type="extended"
      xlink:role="http://example.com/linkroles#namespace-directory">
Directly within the resource-directory element, we have a series of locator and arc elements. The first locator is for the namespace itself:
      <myrddl:locator 
        xlink:type="locator"
        xlink:title="XMLSchema namespace" 
        xlink:label="ns"
        xlink:role="http://www.w3.org/TR/xml-names" 
        xlink:href="http://www.w3.org/2001/XMLSchema"/>
Then, following a title and some other content, we have the locator for the DTD for schemas, which contains a description. (I have not marked up the description as a local resource which participates in the extended link, but one could.)
      <h1 xlink:type="title">Related Resources for XML Schema</h1>

      <h2>Schemas for XML Schema</h2>

      <myrddl:locator 
        xlink:type="locator"
        xlink:label="dtd"
        xlink:title="DTD for validating schema documents" 
        xlink:role="http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml-dtd" 
        xlink:href="XMLSchema.dtd">
        <div class="resource" id="DTD">
          <h3>DTD</h3>
          <p>A DTD <a href="XMLSchema.dtd">XMLSchema.dtd</a> for XML
          Schema.  It incorporates an auxiliary DTD, <a
          href="datatypes.dtd">datatypes.dtd</a>.</p>
        </div>
      </myrddl:locator>
The second locator identifies the schema for schemas. Again, there is some prose documentation.
      <myrddl:locator id="xmlschema" 
        xlink:type="locator"
        xlink:label="schema"
        xlink:title="XML Schema document for validating schema documents" 
        xlink:role="http://www.w3.org/2001/XMLSchema" 
        xlink:href="XMLSchema.xsd">
        <div class="resource">
          <h3>XML Schema</h3>
          <p>An <a href="XMLSchema.xsd">XML Schema schema document</a> 
          for XML Schema schema documents.  Note the simple type formerly 
          called 'decimal', which was briefly renamed 'number', is back 
          to being called 'decimal'.  Schema documents validated with 
          this schema document between 16 March and 30 March 2001 will 
          need to be modified if they used the 'number' type.</p>
        </div>
      </myrddl:locator>
Finally, we have three locators for the three parts of the Recommendation.
      <h2>Normative References for XML Schema</h2>
      <myrddl:locator id="xmlschemap1" 
        xlink:title="W3C XML Schema Part 1" 
        xlink:label="Rec-Part1"
        xlink:role="http://www.w3.org/TR/html4" 
        xlink:href="http://www.w3.org/TR/xmlschema-1">
        <p><a href="http://www.w3.org/TR/xmlschema-1"
            >XML Schema Part 1: Structures</a> 
        </p>
      </myrddl:locator>
      <myrddl:locator id="xmlschemap2" 
        xlink:title="W3C XML Schema Part 2" 
        xlink:label="Rec-Part2"
        xlink:role="http://www.w3.org/TR/html4" 
        xlink:href="http://www.w3.org/TR/xmlschema-2">
        <p><a href="http://www.w3.org/TR/xmlschema-2"
            >XML Schema Part 2: Datatypes</a> 
        </p>
      </myrddl:locator>

      <h2>Non-normative Documentation for XML Schema</h2>
      <myrddl:locator id="xmlschemap0" 
        xlink:title="W3C XML Schema Part 0" 
        xlink:label="Rec-Part1"
        xlink:role="http://www.w3.org/TR/html4" 
        xlink:href="http://www.w3.org/TR/xmlschema-0">
        <p><a href="http://www.w3.org/TR/xmlschema-0"
            >XML Schema Part 0: Primer</a> 
        </p>
      </myrddl:locator>
And finally, we have the declarations of the arcs in this extended link. For purposes of this example, we have assumed arcs from the namespace itself to the DTD, to the schema, and to each part of the documentation.
      <myrddl:arc
        xlink:from="ns"
        xlink:to="dtd"
        xlink:arcrole="http://www.rddl.org/purposes#validation" >
      <myrddl:arc
        xlink:from="ns"
        xlink:to="schema"
        xlink:arcrole="http://www.rddl.org/purposes#schema-validation" >
      <myrddl:arc
        xlink:from="ns"
        xlink:to="Rec-Part1"
        xlink:arcrole="http://www.rddl.org/purposes#normative-reference" >
      <myrddl:arc
        xlink:from="ns"
        xlink:to="Rec-Part2"
        xlink:arcrole="http://www.rddl.org/purposes#normative-reference" >
      <myrddl:arc
        xlink:from="ns"
        xlink:to="Rec-Part0"
        xlink:arcrole="http://www.rddl.org/purposes#non-normative-reference" >
And finally, the resource-directory element is closed.
    </myrddl:resource-directory>
  </div>
  ...
</body>
While I believe the semantics of this extended link are much clearer, it is easy to see why the syntactic simplicity of the simple link type appealed to RDDL's designers.
NOTE:
To do: make abbreviated version of this, move full version to appendix.
Show how extended links can be enhanced to show and and or relations by using the arc roles.

A. References

Bray, Tim, Dave Hollander, and Andrew Layman, ed. Namespaces in XML. World Wide Web Consortium 14 January 1999. [Cambridge, Sophia-Antipolis, Tokyo]: W3C, 1999. http://www.w3.org/TR/1999/REC-xml-names-19990114/ (Most recent version: http://www.w3.org/TR/REC-xml-names/)

Borden, Jonathan, and Tim Bray, ed. Resource Directory Description Language (RDDL). [n.p.]: [n.p.], 2001. http://www.openhealth.org/RDDL/20010305/ (Most recent version: http://www.rddl.org)

DeRose, Steve, Eve Maler, and David Orchard, ed. XML Linking Language (XLink) Version 1.0. W3C Recommendation 27 June 2001. [Cambridge, Sophia-Antipolis, Tokyo]: W3C, 2001.


Notes

[1] Some readers may be unhappy with the idea that a namespace is a thing of any kind at all, and thus with the notion that the rddl:resource element asserts a relation in which the namespace plays a role. For these nominalists, the argument may be recast without loss of force: The RDDL resource element asserts a relation between (a) all the documents, elements, attributes, values, or other data of any kind labeled with names in a namespace and (b) the resource identified by its xlink:href attribute.