xefer

URIs and Ids

· Friday, January 31st, 2003 ·

Identifiers

My original proposal for dealing with the problem of generating more palatable URIs for accessing XBEL-encoded hierarchical data was to base the URIs on the “id” attribute. This would be better than basing them solely on the <title> elements of the resource and its parent folders since those titles can be lengthy and contain spaces, etc. However, after thinking this approach through, I realize that because the id must be unique across the entire document, it would be far too restrictive.

I’ve decided instead to key off of an element from the Dublin Core Metadata Initiative, the refinement element <alternative>. The formal definition of this element is as follows:

Any form of the title used as a substitute or alternative to the formal title of the resource.

While this demands an extension to the standard XBEL schema, the element is one with standardized semantics; it’s better than the alternative of attempting to define a completely new element.

This element is similar in affect to the little known “SHORTCUTURL” attribute defined by the Mozilla project. This attribute is used to associate a keyword with a bookmark in the Mozilla browser. The name of the attribute is somewhat misleading as it really is simply a keyword, not a URL as defined by RFC2396. The name seems to derive from the fact that once a keyword is associated with a bookmark, typing the keyword into Mozilla’s URL address bar will dereference the bookmark URL.

The use of the <alternative> element will demand the declaration of a namespace definition in the root XBEL element:


  <xbel xmlns:dcterms="http://purl.org/dc/terms/">
    <title>Standards Documents</title>
    <info>
      <metadata owner="Jeffrey Winter">
    </info>
    <description>
      A collection of standards information
    </description>
    <folder>
      <dcterms:alternative>xml</dcterms:alternative>
      <title>XML Standards</title>
      <bookmark>
        <dcterms:alternative>xpointer</dcterms:alternative>
        <title>XML Pointer Language</title>
      </bookmark>
    </folder>
  </xbel>
        

The inclusion of the <dcterms:alternative> elements allow the bookmark above to be referenced as:

http://www.xefer.com/xbel/xml/xpointer

as opposed to:

http://www.xefer.com/xbel/XML%20Standards/XML%20Pointer%20Language

Additional constraints would have to be applied to the alternative value:

  1. It will have to be unique within its parent folder; i.e., none of the element’s siblings can have the same attribute value.
  2. The name cannot contain any “/” or “\” characters. This would disrupt the URI mapping scheme.
  3. Only a single <dcterms:alternative> element will be allowed for a <bookmark> or <folder> element.

In the absence of an <alternative> element, the <title> will be used to locate the XBEL resource.

archive

topics

projects

feed