The Resource Directory Description Language (RDDL): What goes at the end of a namespace URI?

Jonathan Borden
jborden@mediaone.net

Abstract

The Resource Directory Description Language (RDDL) [RDDL] was created to answer the question of what ought a namespace URI reference? RDDL uses an XHTML [XHTML Basic] format in which resource elements are embedded. Each resource element contains a simple XLink referencing the related resource.

The use of URIs as a mechanism of namespace partitioning has been controversial and confusing for several reasons:

  1. For the computer science community: XML namespaces differ from traditional namespaces as traditional namespaces conventionally refer to a set whereas XML namespaces more properly refer to an unbounded partition
  2. For the web community: Use of URIs which can be resolved (i.e URLs) suggests that XML namespace identifiers 'point to something' yet no guidance is provided on what they ought reference.

RDDL [Resource Directory Description Language] is simple, addresses both of these issues, and works with the current Web infrastructure.

The Resource Directory Description Language is an extension of W3C XHTML Basic 1.0 with an added element named resource. This element serves as an XLink to the referenced resource, and contains a human-readable description of the resource and machine readable links which describe the purpose of the link and the nature of the resource being linked to. The nature of the resource being linked to is indicated by the xlink:role attribute and the purpose of the link is indicated by the xlink:arcrole attribute.

The rddl:resource element is defined as:

<!ELEMENT rddl:resource (#PCDATA | %Flow.mix;)*>
<!ATTLIST rddl:resource
id            ID       #IMPLIED
xml:lang      NMTOKEN  #IMPLIED
xml:base      CDATA    #IMPLIED
xmlns:rddl    CDATA    #FIXED   "http://www.rddl.org/"
xlink:type    (simple) #FIXED   "simple"
xlink:arcrole CDATA    #IMPLIED
xlink:role    CDATA             "http://www.rddl.org/#resource"
xlink:href    CDATA    #IMPLIED
xlink:title   CDATA    #IMPLIED
xlink:embed   CDATA    #FIXED   "none"
xlink:actuate CDATA    #FIXED   "none"
>

For the computer science community, a proper namespace is created from an XML namespace as the set of fragment identifier qualified URI [Uniform Resource Identifier] references contained in the RDDL document describing the XML namespace.

For the web community, a namespace name references a document which is readable by humans in popular browsers as well as providing machine readable links to resources related to the namespace. For example an "XML browser" would be able to locate code or plugins needed for the display of namespace qualified elements such as embedded SVG [Scalable Vector Graphics], MathML [Math Markup Language] or other formats.

The RDDL specification itself serves as a RDDL description of the RDDL namespace URI http://www.rddl.org/. RDDL is described a DTD, and various schemata including RELAX [Regular Expression for XML], TREX [Tree Regular Expression], Schematron and XML Schema. In this context RDDL serves as a case study for the development and comparision of these various schema languages.

RDDL is now found at the end of the namespace URI for schema languages such as Schematron, XML Schema, and Examplotron, and for namespaces such as RSS 1.0, and the Community XSLT Extension effort.

Natures and purposes of namespace related resources are defined to be URI references according to XLink [XML Linking]. Common RDDL natures and purposes (see: http://www.rddl.org/natures and http://www.rddl.org/purposes) are described.

Keywords: XHTML; XLink; Namespaces; Schema Languages

Jonathan Borden

Dr. Jonathan Borden is an editor of the RDDL specification. He is the Director of the Open Healthcare Group, and a co-chair of the ASTM E31.25 XML Healthcare DTD subcommittee.

The Resource Directory Description Language (RDDL)

What goes at the end of a namespace URI?

Jonathan Borden [Assistant Professor; Tufts University School of Medicine, Department of Neurosurgery]

Extreme Markup Languages 2001® (Montréal, Québec)

Copyright © 2001 Jonathan Borden. Reproduced with permission.

Introduction and Background

Introduction

The Resource Directory Description Language (RDDL) was created to answer the question: " What ought a namespace URI reference?" RDDL uses an XHTML format in which resource elements are embedded. Each resource element contains a simple XLink referencing the related resource.

Background

RDDL was developed on the XML-DEV mailing list in response to recurrent debates surrounding the W3C XML Namespaces Recommendation [XML Names]. Ever since the release of this recommendation, controversy has existed regarding whether a namespace URI ought be a dereferenced as a URL and if so, what ought be returned. Though the namespace recommendation does not require that the URI be dereferenced, URIs were chosen as the mechanism of generating unique names. Common usage of namespace URIs prefixed with "http:" suggests that some document be located at the end of the namespace URI.

In response to yet another periodic heated discussion regarding the role of namespace URIs, in late December 2000, Tim Bray suggested that a namespace URI ought dereference to some XHTML with a bunch of XLinks. Within a couple of days, a group of developers quickly settled on the RDDL proposal, and within a single week code to parse the RDDL format appeared. RDDL can now be found at the end of a number of schema related namespace URIs including XML Schema, and Schematron, document formats such as RSS 1.0 and software projects such as the XSLT Community Extension Library. The resource element has been previously suggested as an extension of the HTML vocabulary.[TBL95]

Abstract Syntax

The Resource Directory Description Language is an extension of XHTML Basic 1.0 [XHTML Basic] with an added element named resource. This element serves as an XLink to the referenced resource, and contains a human-readable description of the resource and machine readable links which describe the purpose of the link and the nature of the resource being linked to. The nature of the resource being linked to is indicated by the xlink:role attribute and the purpose of the link is indicated by the xlink:arcrole attribute.

  1. rddl ::= (lang?,base?,resource*)
  2. resource ::= (id?,title?,nature,purpose,href,lang?,base?,(resource*))

A Resource Directory represents a sequence of resources. Each resource has an optional id, an optional title, a nature, a purpose, an href, an optional lang, an optional base and a sequence of zero or more child resources.

  1. resource : the resource element
  2. id : an optional identifier
  3. title : an optional text title
  4. nature : the URI reference value of the xlink:role attribute, describes the nature of the referenced resource
  5. purpose : the URI reference value of the xlink:arcrole attribute, describes the purpose of the referenced resource
  6. lang : an optional xml:lang attribute value
  7. base : an optional xml:base URI
  8. child resources : an optional sequence of child resources

RDDL DTD

<!ELEMENT rddl:resource (#PCDATA | %Flow.mix;)*>
<!ATTLIST rddl:resource
id            ID       #IMPLIED
xml:lang      NMTOKEN  #IMPLIED
xml:base      CDATA    #IMPLIED
xmlns:rddl    CDATA    #FIXED   "http://www.rddl.org/"
xlink:type    (simple) #FIXED   "simple"
xlink:arcrole CDATA    #IMPLIED
xlink:role    CDATA             "http://www.rddl.org/#resource"
xlink:href    CDATA    #IMPLIED
xlink:title   CDATA    #IMPLIED
xlink:embed   CDATA    #FIXED   "none"
xlink:actuate CDATA    #FIXED   "none"
>

RDDL TREX

<grammar
ns="http://www.rddl.org/"
xmlns="http://www.thaiopensource.com/trex"
>
<define name="resource">
<element name="resource">
<ref name="resource.attlist"/>
<ref name="Flow.model"/>
</element>
</define>

<define name="resource.attlist">
<ref name="lang.attrib"/>
<ref name="id.attrib"/>
<ref name="XMLBASE.attrib"/>
<ref name="XLINK.simple.attlist"/>
</define>
</grammar>

Describing a Pizza in RDDL

The following is a real RDDL document containing a simple resource: an XML Schema for a ficticious "Pizza Description Language" [PizzaDL] as described by Leigh Dodds:

<!DOCTYPE html PUBLIC "-//XML-DEV//DTD XHTML RDDL 1.0//EN"
"http://www.rddl.org/rddl-xhtml.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:rddl="http://www.rddl.org/"
xml:lang="en"
xml:base="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/ns/">
<head>
<title>RDDL Document for the Pizza Description Language</title>
<link href="http://www.rddl.org/xrd.css" type="text/css" 
rel="stylesheet"/>
</head>
<body>
<h1>RDDL Document for the Pizza Description Language</h1>

<p>
This document provides a list of resources associated with the Pizza
description language, PizzaML.
</p>

<rddl:resource
xlink:href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/schema.xsd"
xlink:title="The PizzaML XML Schema">

<p>
The XML Schema for PizzaML documents is
<a href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/schema.xsd">
available from here</a>.
</p>

</rddl:resource>

</body>
</html>

Natures and Purposes

The nature[Natures] of a related resource has to do with characteristics of the resource itself. The nature is related to a resource type yet the term type has different meanings in different contexts and a different term Nature was chosen so as not to further confuse an already overloaded term. A resource nature is a URI reference, such as the namespace URI of the root element of the document, or a canonical URI describing the MIME media type of the document. A Nature URI can be any URI and is asserted by the RDDL document describing the resource as the value of the xlink:role attribute.

The purpose[Purposes] of a related resource is a URI reference which describes the purpose of the resource with respect to the URI being described by the RDDL document. The Purpose is asserted by the value of the xlink:arcrole attribute for the rddl:resource.

More Pizza

The Pizza Description Language[PizzaDL] is augmented by the addition of several resources which describe the XML Schema as well as several XSLT transforms converting from the Pizza Description Language into XHTML and into RSS 1.0:

<rddl:resource
xlink:role="http://www.w3.org/1999/XSL/Transform"
xlink:arcrole="http://www.w3.org/1999/xhtml"
xlink:href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/pizza2html.xslt"
xlink:title="Transform Pizza Menu to XHTML">
<!-- ... -->
</rddl:resource>

<rddl:resource
xlink:role="http://www.w3.org/1999/XSL/Transform"
xlink:arcrole="http://purl.org/rss/1.0/"
xlink:href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/pizza2rss.xslt"
xlink:title="Transform Pizza Menu to RSS">
<!-- ... -->
</rddl:resource>

<rddl:resource
xlink:role="http://www.isi.edu/in-notes/iana/assignments/media-types/text/xml-dtd"
xlink:arcrole="http://www.rddl.org/purposes#validation"
xlink:href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/pizzaml.dtd"
xlink:title="The PizzaML DTD">
<!-- ... -->
</rddl:resource>

<rddl:resource
xlink:role="http://www.w3.org/2000/10/XMLSchema"
xlink:arcrole="http://www.rddl.org/purposes#schema-validation"
xlink:href="http://www.bath.ac.uk/~ccslrd/examples/pizzaml/schema.xsd"
xlink:title="The PizzaML XML Schema">
<!-- ... -->
</rddl:resource>

Well known Natures and Purposes

RDDL defines a hierarchy of natures and purposes which are generally useful at the URLs: http://www.rddl.org/natures and http://www.rddl.org/purposes. These documents serve as examples defining RDDL terminologies in RDDL itself.

The URI prefix http://www.isi.edu/in-notes/iana/assignments/media-types/ serves as a root URI for media types and allows creation of a nature URI for any media type. For example http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml-dtd serves as the well known URI describing the Nature of a DTD.

  1. Generic HTML has the nature: http://www.isi.edu/in-notes/iana/assignments/media-types/text/html.
  2. HTML 4 the nature: http://www.w3.org/TR/html4/
  3. HTML 4 Strict the nature: http://www.w3.org/TR/html4/strict
  4. XHTML the nature: http://www.w3.org/1999/xhtml.

Using RDDL in distributed Web applications

XSLT

An XSLT stylesheet may transform from one nature to another. The nature of an XSLT stylesheet is: http://www.w3.org/1999/XSL/Transform. The purpose of an XSLT stylesheet is the nature of what results from transforming an input document having a nature of the base URI of the XSLT resource, typically the base URI of the RDDL document, by the stylesheet.

This convention provides for the possibility of generating a transform of A->C given known transforms from A->B and B->C. Such a transform might be automatically generated by chaining through the RDDL documents describing the namespaces for A, B and C.

SAX Filters

Similarly an XML processing pipeline might be generated by looking for RDDL resources within namespace URIs labelled as SAX filters implemented in whatever language desired. For example, a java and python implementation of a particular namespace related behavior can be implemented and referenced side by side within a RDDL document at the namespace URI.

XSV

Henry Thompson has implemented RDDL support in XSV [XSV] to support distributed schema validation. XSV is capable of incorporating namespace related XML Schema [XML Schema] modules by examining a RDDL document located at the namespace URI. The XML Schema is obtained as a resource of nature "http://www.w3.org/2001/XMLSchema".

RDDLClassLoader

The feature of referencing code within a namespace URI is made use of by the RDDLClassLoader java class. This class implements a java class loader that 'finds' java classes having a particular purpose within a namespace URI. This class is almost trivially simple:

/*
* RDDLClassLoader.java
*
* Created on March 3, 2001, 10:55 AM
*/
package org.rddl.helpers;
import java.util.SortedMap;
import java.util.Vector;
import java.util.Iterator;
import java.net.URL;

import org.rddl.Resource;
/**
*
* @author Jonathan Borden <jonathan@openhealth.org>
* @version
*/
public class RDDLClassLoader extends java.net.URLClassLoader {
static final String STR_NATURE_JAVA = "http://www.rddl.org/natures#java"
static final String STR_NATURE_JAR = "http://www.rddl.org/natures#JAR"
/** Creates new RDDLClassLoader
* @param nsUrl the namespace URI
* @param purposeURI The <code>purpose</code> of this ClassLoader connection
* @throws IOException
* @throws SAXException
*/

public RDDLClassLoader(String nsUrl,String purposeURI) throws java.io.IOException,org.xml.sax.SAXException{
super(buildUriList(nsUrl,purposeURI));
}

/** This is an internal static method that creates a URL array from the RDDL URI and purpose
* The <code>nature</code> is either "java" or "JAR"
* @param URI The namespace URI
* @param purposeURI The RDDL <code>purpose</code>
* @throws IOException
* @throws SAXException
* @return URL[] - an array of URLs -- this is typically passed to the
* constructor of URLClassLoader()
*/

protected static URL[] buildUriList(java.lang.String URI,java.lang.String purposeURI) 
throws java.io.IOException,org.xml.sax.SAXException {
org.rddl.Namespace ns = RDDLURL.getNamespace(URI);
java.util.SortedMap ress0 = ns.getResourcesFromNature(STR_NATURE_JAVA);
java.util.TreeMap ress = new java.util.TreeMap(ress0);
ress.putAll(ns.getResourcesFromNature(STR_NATURE_JAR));
java.util.Vector strArr = new java.util.Vector();
Iterator iter = ress.values().iterator();
while(iter.hasNext())
{
Resource res = (Resource)iter.next();
if (purposeURI.equals(res.getPurpose()))
strArr.addElement(res.getHref());
}

int len = strArr.size();
URL[] uris = new URL[len];
URL baseURL = new URL(URI);
for(int i=0;i<len;i++){
uris[i] = new URL(baseURL,(String)strArr.elementAt(i));
};
return uris;
}
}

Summary

RDDL provides a both a human and machine understandable description of a namespace referenced at the namespace URI. As the "Semantic Web" gets created, we feel it is important for this new web to be built in a fashion compatible with the current HTML based web. RDDL based on XHTML is readable in common browsers (which conveniently ignore the rddl:resource elements), and containing XLinks, is readable by software programs.

The XML community has desired an XML browser, which can display and manipulate any sort of XML document.. RDDL enables this by allowing dynamic download of new 'behaviors' attached to namespace qualified elements. Examples are SVG [SVG] and MathML [MathML].

Despite misgivings, the XML Namespaces recommendation has achieved widespread adoption in the marketplace. Hopefully RDDL is an acceptable solution to some of the problems the community has had with namespaces. By defining a reasonable solution to what a namespace URI might reference, RDDL allows XML namespaces to be used in more powerful ways than as mere unique identifiers for disambiguating elements names across vocabularies.


Bibliography

[MathML] http://www.w3.org/TR/REC-MathML/

[Natures] http://www.rddl.org/natures

[PizzaDL] http://www.xml.com/pub/a/2001/02/28/rddl.html

[Purposes] http://www.rddl.org/purposes

[RDDL] http://www.rddl.org/

[SVG] http://www.w3.org/TR/SVG/

[TBL95] http://www.w3.org/MarkUp/Resource/Specification

[XHTML Basic] http://www.w3.org/TR/xhtml-basic

[XML Linking] http://www.w3.org/TR/xlink

[XML Names] http://www.w3.org/TR/REC-xml-names

[XML Schema] http://www.w3.org/TR/xmlschema-1/

[XSV] http://www.ltg.ed.ac.uk/~ht/xsv-status.html



The Resource Directory Description Language (RDDL)

Jonathan Borden [Assistant Professor, Tufts University School of Medicine, Department of Neurosurgery]
jborden@mediaone.net