The "namespace" HTML Profile

Introduction

HTML walks a fine line in the area of extensibility: browsers are told to ignore elements and attributes with names they do not recognize, but document creators are encouraged to stay with "valid" documents, avoiding all non-standard names. XML adds two more dimensions: well-formedness and namespaces. Namespaces have the potential to allow new names to be introduced without breaking validity, although this potential has not yet materialized in the HTML world.

Meanwhile, HTML has an area of naming, separate from element and attribute names, for which extensibility has not been completely addressed: linktypes. These are uses as values of the "rel" and "rev" attributes on "a" and "link" links, and they are strings drawn from a set determined by the head's profile attribute.

The linktype and profile mechanisms are rarely used, and there is some perception that they have never been sufficiently defined. They are, however, well enough defined to tie them the RDF's linking mechanism, which is an area of considerable semantic precision and extensibility. This profile can be used to perform exactly this connection.

An Example

Here's an example namespace document:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head profile="http://www.w3.org/2002/12/namespace">
<title>The "L" Namespace</title>
</head><body>

<h1>The Example-L Namespace</h1>

<p>This document addresses the <a 
href="http://lists.w3.org/Archives/Public/www-tag/2002Nov/0147>RDDL 
Challenge"</a>.   It uses terms from the
<a rel="namespace:rddl" href="http://www.rddl.org/purposes#">RDDL Purposes</a> namespace.
</p>


<p>If you are using the Example-L namespace, you may be interested in
  <a rel="rddl:validation"
     type="http://relaxng.org/ns/structure/1.0"
     href="http://example.com/schemas/L.rng">a RelaxNG schema</a>
and
  <a rel="rddl:render" type="text/css"
     href="http://example.org/style/L.css">a very terse style sheet</a>
</p>
</body></html>

which you can also see directly.

Details

Namespace Declarations

When this profile is used, linktypes starting with "namespace" are taken to be declarations of namespace use, very much like XML's "xmlns" attributes. The linktype "namespace" links to the resource standing in for the default namespace for linktypes. Linktypes of the form "namespace:foo" link to resources standing in for the namespaces of linktypes using names beginning with "foo:". The intent here is to match XMLNS as closely as possible.

Link Semantics

All other linktypes using prefixes declared as above (or no prefix if a default namespace has been declared) are taken to have the same meaning as in RDF. That is, the HTML fragments:

   <a rel="namespace:animal" href="http://example.com/animals">Animals Ontology</a>
...
   <a rel="animal:breed" href="http://example.com/animal/breeds#akita">Akita</a>

means the same thing as the RDF/XML fragment:

   <rdf:Description about="">
       <animal:breed xmlns:animal="http://example.com/animals" 
                     rdf:resource="http://example.com/animal/breeds#akita" />
   </rdf:Description>

What it might mean for a web page to have the dog breed "Akita" is left as an exercise to the reader. (Seriously, this is an ongoing problem with RDF, which I've been trying to help address. In any case, it should be sufficient to tie HTML's link semantics to RDF's.)

Future Directions

I think that html's CLASS attributes can work the same way, seen as a relationship between the parent element and the element of that class, but there are some details to work out. In particularly, are we talking about the content, the container, or the subject of each element? How do we group elements into larger subtrees? I've done some prototype implementations (look at the HTML in this dogs example), but I'm not sure about the answers.

I do not know if this is a good direction to go; simply allowing RDF to be embedded in HTML (which alas violated validity) might be better.


This work is being done as part of the MIT/LCS DAML Project under the MIT/AFRL cooperative agreement number F30602-00-2-0593. This work is not on the W3C recommendation track and is not the product of a W3C working group or interest group.

Sandro Hawke
First: 2002-12-26; This: $Date: 2002/12/26 21:12:17 $