The "namespace" HTML Profile


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"
<html xmlns="" lang="en" xml:lang="en">
<head profile="">
<title>The "L" Namespace</title>

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

<p>This document addresses the <a 
Challenge"</a>.   It uses terms from the
<a rel="namespace:rddl" href="">RDDL Purposes</a> namespace.

<p>If you are using the Example-L namespace, you may be interested in
  <a rel="rddl:validation"
     href="">a RelaxNG schema</a>
  <a rel="rddl:render" type="text/css"
     href="">a very terse style sheet</a>

which you can also see directly.


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="">Animals Ontology</a>
   <a rel="animal:breed" href="">Akita</a>

means the same thing as the RDF/XML fragment:

   <rdf:Description about="">
       <animal:breed xmlns:animal="" 
                     rdf:resource="" />

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 $