URIs and Ids
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
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.
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:
as opposed to:
Additional constraints would have to be applied to the alternative value:
- It will have to be unique within its parent folder; i.e., none of the element’s siblings can have the same attribute value.
- The name cannot contain any “/” or “\” characters. This would disrupt the URI mapping scheme.
Only a single
<dcterms:alternative>element will be allowed for a
In the absence of an
<title> will be used to locate the XBEL resource.