<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.6//EN"
               "http://www.w3.org/2002/xmlspec/dtd/2.6/xmlspec.dtd" [
  <!-- ================================================================ -->
  <!ENTITY draft.day "1">
  <!ENTITY draft.DD "01">
  <!ENTITY draft.month "12">
  <!ENTITY draft.monthname "December">
  <!ENTITY draft.year "2005">
  <!ENTITY iso6.doc.date "&draft.year;-&draft.month;-&draft.DD;">
  <!ENTITY http-ident "http://www.w3.org/2001/tag/doc/nsDocuments">
]>
<spec w3c-doctype='other'>
<?CVS $Id: Overview.xml,v 1.1 2005/12/01 19:31:20 NormanWalsh Exp $?>
<header>
<title>Associating Resources with Namespaces</title>
<w3c-designation>&http-ident;-&iso6.doc.date;</w3c-designation>
<w3c-doctype>DRAFT TAG Finding</w3c-doctype>
<pubdate><day>&draft.day;</day>
<month>&draft.monthname;</month>
<year>&draft.year;</year>
</pubdate>
<publoc>
<loc href="&http-ident;-&iso6.doc.date;/">&http-ident;-&iso6.doc.date;/</loc>
</publoc>
<altlocs>
<loc href="&http-ident;-&iso6.doc.date;/Overview.xml">XML</loc>
</altlocs>
<latestloc>
<loc href="&http-ident;/">&http-ident;/</loc>
</latestloc>
<prevlocs>
<loc href="&http-ident;-2005-11-07/">&http-ident;-2005-11-07/</loc>
</prevlocs>
<authlist>
<author><name>Norman Walsh</name>
<affiliation>Sun Microsystems, Inc.</affiliation>
<email href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</email></author>
</authlist>

<abstract>
<p>This Finding addresses the question of how ancillary information (schemas,
stylesheets, documentation, etc.) can be associated with a namaespace.</p>
</abstract>

<status>

<p>This document has been produced for review by the <loc href="/2001/tag/">W3C
Technical Architecture Group (TAG)</loc>. This finding addresses TAG
<loc href="http://www.w3.org/2001/tag/ilist#namespaceDocument-8">issue
namespaceDocument-8</loc>.</p>

<p>This document is an editor's draft without any normative standing.
</p>

<p><loc href="/2001/tag/findings">Additional TAG findings</loc>, both
accepted and in draft state, may also be available.</p>

<p>The terms <rfc2119>MUST</rfc2119>, <rfc2119>SHOULD</rfc2119>, and
<rfc2119>SHOULD NOT</rfc2119> are used in this document
in accordance with <bibref ref="rfc2119"/>.</p>

<p>Please send comments on this finding to the publicly archived TAG
mailing list <loc
href="mailto:www-tag@w3.org">www-tag@w3.org</loc>
(<loc
href="http://lists.w3.org/Archives/Public/www-tag/">archive</loc>).</p>

</status>
<pubstmt>
<p>Chicago, Vancouver, Mountain View, et al.: World-Wide Web Consortium,
Draft TAG Finding, 2005.</p>
</pubstmt>
<sourcedesc>
<p>Created in electronic form.</p>
</sourcedesc>
<langusage>
<language id="EN">English</language>
</langusage>
<revisiondesc>
<slist>
<sitem>2005-09-13: Published draft</sitem>
</slist>
</revisiondesc>
</header>
<body>

<div1 id="preface">
<head>Preface</head>

<p>The names in a namespace form a collection:</p>

<ulist>
<item>
<p>Sometimes it is a
collection of element names (DocBook and XHTML, for example),</p>
</item>
<item>
<p>sometimes it is a collection of attribute names (XLink, for example),</p>
</item>
<item>
<p>sometimes it is a collection of functions (XQuery 1.0 and XPath 2.0
Data Model),</p>
</item>
<item>
<p>sometimes it is a collection of properties (FOAF),</p>
</item>
<item>
<p>sometimes it is a collection of concepts (WordNet), and many other uses
are likely to arise.</p>
</item>
</ulist>

<p>The names in a
namespace can, in theory at least, be defined to identify any thing or
any number of things.</p>

<p>Given the wide variety of things that can be identified, it follows
that an equally wide variety of ancillary resources may be relevant to
a namespace. A namespace may have documentation (specifications,
reference material, tutorials, etc., perhaps in several formats and
several languages), schemas (in any of several forms), stylesheets,
software libraries, applications, or any other kind of related
resource.</p>

<p>A user, encountering a namespace might want to find
any or all of these related resources. In the absence of any other
information, a logical place to look for these resources, or information
about them, is at the location of the namespace URI itself.</p>

<p><bibref ref="webarch"/> says that it is a
<loc href="http://www.w3.org/TR/webarch/#pr-namespace-documents">Good
Practice</loc> for the owner of a namespace to make available at the
namespace URI “material
intended for people to read and material optimized for software agents
in order to meet the needs of those who will use the namespace”.</p>

<p>The question remains, how can we best provide both human and machine
readable information at the namespace URI such that we can achieve the
good practice identified by web architecture?
One early attempt was <bibref ref="rddl10"/>. RDDL 1.0 is an XLink-based 
vocabulary for identifying the nature and purpose of related resources.</p>

<p>Several attempts were made to simplify RDDL. The TAG's original plan for
addressing
<loc href="http://www.w3.org/2001/tag/ilist#namespaceDocument-8">namespaceDocument-8</loc>
was to help define a simpler, standard RDDL format. However, this space
has matured somewhat since the TAG's original discussions and
RDDL 1.0 is now widely deployed. In addition, some of the proposed alternative
formats are also deployed. And it seems likely that over time new
variations may arise based on other evolving web standards.</p>

<p>This finding therefore attempts to address the problem by considering
it in a more general fashion.
We hope to:</p>

<olist>
<item>
<p>Define a conceptual model for identifying related resources that is
simple enough to garner community consensus as a reasonable
abstraction for the problem.</p>
</item>
<item>
<p>Show how RDDL 1.0 is one possible concrete syntax for this model.</p>
</item>
<item>
<p>Show how other concrete syntaxes could be defined and identified in
a way that would preserve the model.</p>
</item>
</olist>
</div1>

<div1 id="model">
<head>The Model</head>

<p>For the resource identified by a namespace URI, there may exist
other resources related to it. Borrowing on the terminology defined by
<bibref ref="rddl10"/>, we say that each of these other resources has
a nature and a purpose. The nature of the resource is a
machine-readable label that identifies “what kind of thing” it is. For
example, its nature might be “HTML documentation” or “XML Schema” or
“CSS Stylesheet”. The purpose of a resource, with respect to the
resource identified by the namespace URI, is a machine-readable label
that identifies “what use” the thing is. For example, its purpose
might be “validation” or “normative reference” or “specification” or
“transformation”.</p>

<p>For example, here's a diagram of the model for some DocBook-related
resources:</p>

<graphic source="rddl-2.png" alt="RDDL Model for DocBook"/>

<p>This model indicates that for the purpose of validation there are two
schemas, <emph>docbook.xsd</emph> which has the nature “XML Schema” and
<emph>docbook.rng</emph> which has the nature “RELAX NG”. This model
also includes two examples of HTML documentation, <emph>defguide.html</emph>
which has the purpose “reference documentation” and <emph>docbook.html</emph>
which has the purpose “specification”.</p>

<p>If an application can obtain this model from the document that it
gets from the namespace URI, then it can find the relevant related
resources. For example, a RELAX NG validator could find all the
resources that serve the purpose “validation” and identify the one (or
one of the ones) with the nature “RELAX NG” and proceed with a
validation task. Similarly, a human being could find the resource with
the purpose “specification” to locate the specification in a
convenient format.</p>

<p>One way to write down the model described above is with RDF. There's
nothing about the process of finding related resources that requires
the model to be instantiated in RDF or requires any processor to know
anything about RDF. But having the model in RDF will allow us to describe
how the model can be obtained from specific kinds of documents.</p>

<p>Here's an example of the DocBook model above, expressed in RDF using
N3:</p>

<eg><![CDATA[# RDDL Model for DocBook

@prefix rddl: <http://www.w3.org/2005/11/rddl#> .
@prefix purpose: <http://www.w3.org/2005/11/rddl/purpose#> .
@prefix nature: <http://www.w3.org/2005/11/rddl/nature#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

<http://docbook.org/ns/docbook>
   purpose:validation <http://docbook.org/xml/5.0b1/rng/docbook.rng> ;
   purpose:validation <http://docbook.org/xml/5.0b1/xsd/docbook.xsd> ;
   purpose:spec <http://docbook.org/specs/wd-docbook-docbook-5.0b1.html> ;
   purpose:reference <http://docbook.org/tdg5/en/html/> .

<http://docbook.org/xml/5.0b1/rng/docbook.rng>
   rddl:nature nature:RELAXNG .

<http://docbook.org/xml/5.0b1/xsd/docbook.xsd>
   rddl:nature nature:XMLSchema .

<http://docbook.org/specs/wd-docbook-docbook-5.0b1.html>
   rddl:nature nature:HTML .

<http://docbook.org/tdg5/en/html/>
   rddl:nature nature:HTML .]]></eg>

<p>If we can construct this model from a namespace document, then we know
we have all the information we need to locate related resources.</p>
</div1>

<div1 id="div.formats">
<head>Namespace Document Formats</head>

<p>This section describes two formats deployed explicitly to address the
question of namespace documents and a third format which can be seen as
simultaneously providing a unified view of these two formats and also
providing a model to make other new formats available.</p>

<div2 id="div.rddl10">
<head>RDDL 1.0</head>

<p>A RDDL 1.0 document encodes the nature and purpose of the related
resource in a <el>rddl:resource</el> element. That element uses XLink:</p>

<eg><![CDATA[<rddl:resource xlink:title="RELAX NG for validation"
	       xlink:arcrole="http://www.w3.org/2005/11/rddl/purposes#validation"
	       xlink:role="http://www.w3.org/2005/11/rddl/natures/RELAXNG"
	       xlink:href="http://docbook.org/xml/5.0b1/rng/docbook.rng">
A <a href="http://docbook.org/xml/5.0b1/rng/docbook.rng">schema</a>
for RELAX NG validation.
</rddl:resource>]]></eg>

<p>Extacting the model is a simple matter of reading the <att>xlink:href</att>,
<att>xlink:role</att>, and <att>xlink:arcrole</att> attributes of each
<el>rddl:resource</el>.</p>

</div2>

<div2 id="div.rddl20">
<head>RDDL 2.0</head>

<p>One of the RDDL 2.0 proposals encodes the nature and purpose of the
related resource directly on the HTML <el>a</el> element:</p>

<eg><![CDATA[A
<a rddl:nature="http://www.w3.org/2005/11/rddl/natures/RELAXNG"
   rddl:purpose="http://www.w3.org/2005/11/rddl/purposes#validation"
   href="http://docbook.org/xml/5.0b1/rng/docbook.rng">schema</a>
for RELAX NG validation.]]></eg>

<p>Extacting the model is a simple matter of reading the <att>rddl:nature</att>,
<att>rddl:purpose</att>, and <att>href</att> attributes of each
HTML <el>a</el>.</p>

</div2>

<div2 id="div.grddl">
<head>Using GRDDL</head>

<p>A third approach is to use <bibref ref="grddl"/>. GRDDL provides a
mechanism for gleaning resource descriptions from XML.
Employing GRDDL allows an author to associate a transformation 
with a document. The result of applying that transformation is an RDF
model (the resource description).</p>

<p>Given that our RDDL model can be expressed in RDF, such a gleaned
resource description can be seen as a RDDL model. Consider the following
example:</p>

<p>The URI <code>http://www.w3.org/2000/10/swap/pim/usps</code> is the
namespace name for an RDF vocabulary that describes United States
postal addressing terms. It's
<loc href="http://www.w3.org/2000/10/swap/pim/usps">namespace document</loc>
is an XHTML document that uses GRDDL to identify the transformation
<code>http://www.w3.org/2000/07/hs78/html2rdfs</code>.</p>

<p>If this transformation is applied, the resulting resource description
includes the following model fragment:</p>

<eg><![CDATA[<http://www.w3.org/2000/10/swap/pim/usps>
 purpose:normative-reference <http://pe.usps.gov/cpim/ftp/pubs/Pub28/pub28.pdf>,
                             <http://pe.usps.gov/cpim/ftp/pubs/Pub63/Pub63.pdf> .]]></eg>

<p>In other words, this RDDL model:</p>

<graphic source="rddl-3.png" alt="RDDL Model for USPS"/>

<p>It's important to note that processing a GRDDL document only requires
XSLT processing in the general case. For well-known transformation URIs,
an application can simply understand the markup.</p>

<p>In fact, a pair of well-known GRDDL transformation URIs for RDDL
1.0 and RDDL 2.0 will allow us to unify both RDDL variants and the
GRDDL case.</p>

<p>The use of GRDDL would allow arbitrary, perhaps non-human readable,
documents to function as namespace documents. However, that's counter to the
<bibref ref="webarch"/> good practice. Hopefully that will be sufficient
discouragement.</p>

</div2>
</div1>

<div1 id="div.fragid">
<head>Identifying Individual Terms</head>

<p>For many applications of namespaces, it's valuable not only to be
able to point to the namespace as a whole, but also to be able to
point to terms within that namespace. Fragment identifiers are the
obvious mechanism for achieving this. For example,
<code>http://www.w3.org/2005/xpath-functions/#matches</code> is the
URI for the “matches” function, a term in the <emph>XQuery 1.0,
XPath 2.0, and XSLT 2.0 Functions and Operators Namespace</emph>,
<code>http://www.w3.org/2005/xpath-functions/</code>.</p>

<p>If it would be valuable to directly address specific terms in a
namespace, namespace owners <rfc2119>SHOULD</rfc2119> provide
identifiers for them. It follows that if the namespace document 
is available in multiple forms (RDDL 1.0, RDF through GRDDL, etc.)
that consistent fragment identifiers <rfc2119>MUST</rfc2119>
be made available.</p>
</div1>

<div1 id="div.natures">
<head>Natures</head>

<p>@@ list of natures, borrow from RDDL.</p>

</div1>

<div1 id="div.purposes">
<head>Purposes</head>

<p>@@ list of purposes, borrow from RDDL.</p>

</div1>

<div1 id="references">
<head>References</head>

<blist>
<bibl id="rfc2119" href="http://www.ietf.org/rfc/rfc2119.txt" key="RFC 2119">S.
Bradner. <titleref>Key words for use in RFCs to Indicate Requirement Levels</titleref>.
IETF. March, 1997.</bibl>

<bibl id="rddl10" href="http://www.rddl.org/" key="RDDL 1.0">Jonathan Borden
and Tim Bray. <titleref>Resource Directory Description Language
(RDDL)</titleref>. February, 2002.</bibl>

<bibl id="webarch" href="http://www.w3.org/TR/webarch/" key="WebArch Vol 1">Ian Jacobs and Norman Walsh, editors.
<titleref>Architecture of the World Wide Web, Volume 1</titleref>.
World Wide Web Consortium, 2004.
</bibl>

<bibl id="grddl" href="http://www.w3.org/TR/grddl/" key="GRDDL">Dominique
Hazaël-Massieux and Dan Connolly, editors.
<titleref>Gleaning Resource Descriptions from Dialects of Languages (GRDDL)</titleref>.
World Wide Web Consortium, 2004.
</bibl>

</blist>
</div1>
</body>
</spec>
