SkunkLink: A Common Ground for XML Linking

Skunkworks 23 December 2002

This version:
http://dubinko.info/writing/skunklink/

Abstract

The SLink language provides a data model and syntax for XML linking, suitable for use in XHTML 2.0 and related languages.

Status of this Document

This document is a private skunkworks and has no official standing of any kind, not having been reviewed by any organization in any way.

This draft was assembled by Micah Dubinko with inspriation from the [XLink] Editors (Steve DeRose; Eve Maler; David Orchard), the [HLink] Editors (Steven Pemberton; Masayasu Ishikawa), the editor of [XArc] (Gabe Beged-Dov), and the other panel members at the XML 2002 Hypertext Town Hall (Norm Walsh; Ron Daniel; Liam Quin; Eve Maler; Simon St. Laurent).  There should be no suggestion that anybody other than Micah Dubinko approves of the content or even the existence of the present document.

Table of Contents

1 Introduction
2 Requirements
3 Terminology and Data Model
4 Inline Markup
    4.1 The xml:href Attribute
    4.2 The xml:src Attribute
5 Out-of-line Markup
6 Conformance

Appendices

A References
    A.1 Normative References
    A.2 Informative References
Questions and Answers (non-normative)


1 Introduction

XML linking has been a subject of frequent discussion.

The process at the W3C that led to this document started with XLL, one of the major directions for the work to be built upon the then-new XML standard. Other W3C specifications, which involved a very large number of contributors from within and without the W3C, include the [XLink] Recommendation and the [HLink] Working Draft. Lists of contributors may be found in these specifications.

This document takes a fundamental approach of expressing only the author's intent for a link, leaving other kinds of link metadata and details of link processing as application-specific. As a result, many features from XLink and HLink are not included. The criteria for determining which features to include in this document is the features must be widely appropriate to many different kinds of XML languages.

This document may be distributed freely, as long as all text and legal notices remain intact.

2 Requirements

  1. SLink must be straightforwardly usable over the Internet.
  2. SLink must be usable by a wide variety of link usage domains and classes of linking application software.
  3. SLink must support XHTML linking constructs.
  4. SLinks must be expressible in XML, and may be expressible in other languages.
  5. The SLink design must be prepared quickly.
  6. The SLink design must be formal, concise, and illustrative.
  7. SLinks must be human-readable and human-writable.
  8. SLink syntax may reside within or outside the documents in which the participating resources reside.
  9. SLink must represent the abstract structure and significance of links.
  10. SLink must be feasible to implement.
  11. SLink must be informed by knowledge of established hypermedia systems and standards.

The following goals are specifically not addressed in SLink 1.0. For these features, either application-specific markup, XLink 1.0, or a successor to SLink is the appropriate technology.

  1. Link-metadata, including roles, titles, and arcroles.
  2. Specific hints on actuation and rendering of links.
  3. Reverse links and linkbases.

3 Linking Data Model and Terminology

Links can be described in terms of a simple data model. The fundamental unit of the data model is the arc. [Definition: An arc consists of the following: a reference to a starting resource (optionally with a reference to a sub-resource), an ending resource (optionally with a reference to a sub-resource), an arc-type, and a prominence.]  In some cases, such as URI fragment identifiers, a sub-resource might actually be a view or interpretation of the resource. When this is not possible, or when no specific sub-resource is specified, the sub-resource is the same as the resource. 

[Definition: The possible arc-types defined in this document are: href, src, and none.] The arc-type describes the intent of the author in providing the link. An arc-type of href indicates the intention that, when the link is traversed at the user's option, the presentation context will be changed to the ending (sub-)resource. An arc-type of src indicates the intention that, without requiring any special action of the user, the ending (sub-)resource will be presented in place of the starting (sub-)resource. An arc-type of none indicates that the author did not intend to create an arc. Implementations are free to process SLink links in any suitable manner. For example, a bandwidth-limited device might prompt the user before traversing any link, even if the arc-type is src, or a desktop browser with certain configuration settings might open a new window, even when the arc-type is href.

[Definition: The prominence is a zero-based non-positive integer that describes the author's intent of how readily a link is to be presented to the user for activation.] A larger prominence indicates that an arc is to be presented to the user for activation before related arcs of a smaller prominence. Prominence is important for multi-ended links, where typically a single "default" arc might have a prominence of 0, and additional arcs will have smaller prominences. For example, in a suitably constructed link, a browser might traverse an arc with prominence 0 by a single click; with promenence -1 by a context menu; with prominence -2 with a 2nd-level context menu, and so on. When a link contains multiple arcs with the same prominence, the arcs in question are intended as alternatives for selection by the end user. As with the arc-type, implementations are free to interpret the prominence in any suitable manner.

The notion of resources is universal to the World Wide Web. [Definition: As discussed in [RFC 2396], a resource is any addressable unit of information or service.] Examples include files, images, documents, programs, and query results. For example, if the whole resource is an XML document, a useful portion of that resource might be a particular element inside the document. Following a link to it might result, for example, in highlighting that element or scrolling to that point in the document.

[Definition: When a link associates a set of resources, those resources are said to participate in the link.] SLink links, as defined abstractly here, may appear in non-XML documents (such as PDF or Flash), and are able to associate all kinds of resources, not just XML-encoded ones.

One of the common uses of SLink is to create hyperlinks. [Definition: A hyperlink is a link that is intended primarily for presentation to a human user.] Nothing in SLink's design, however, prevents it from being used with links that are intended solely for consumption by generic link-aware software.

[Definition: Using or following a link for any purpose is called traversal.] Even though some kinds of link can associate arbitrary numbers of resources, traversal always involves a pair of resources (or portions of them); [Definition: the source from which traversal is begun is the starting resource] and [Definition: the destination is the ending resource]. Note that the term "resource" used in this fashion may at times apply to a resource portion, not a whole resource.

[Definition: An SLink link is a collection of one or more arcs, intended to express an explicit relationship between resources or portions of resources.] For [XML], a SLink link is realized by one of the syntax options defined later in this document.

4 Inline Markup

This section discribes markup that can appear inline in an [XML] document to define a SLink link.

4.1 The xml:href Attribute

The xml:href attribute expresses a SLink link as follows: the starting resource is the resource containing the attribute, with the sub-resource being the specific element containing the attribute. The content of this attribute is a URI reference, as defined by the datatype xsd:anyURI [XML Schema part 2]. Relative URIs are processed according to [XML Base]. The ending resource and sub-resource are defined by the URI and fragment identifier (if any) in the attribute value. The arc-type is href. The prominence is equal to -1 times the number of ancestor elements that represent arcs of arc-type href.

NOTE: In XML documents conforming to [XML Names], the prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace, and does not require any additional declaration markup on the part of the author.

Examples: The following example shows how a custom-defined language can contain a hyperlink detectable by generic link processors.

<item partNo="A6342X" xml:href="http://example.info/inventory/description?pn=A6342X"/>

This example shows how the a element might be defined in a future version of XHTML.

<a xml:href="bookmarks.html#linking">This is a hyperlink</a>

This example shows how the nl element could be defined as a multi-ended link in a future version of XHTML.

<nl xml:href="/">
<label>Navigate the site:</label>
<li xml:href="guide.html">Access Guide</li>
<li xml:href="search.html">Search</li>
</nl>

This example shows how a commonly occurring idiom in news and press releases could be defined as a multi-ended link in a future version of XHTML.

<p>Today, <a xml:href="http://www.microsoft.com">Microsoft
<a href="news.example.com?symbol=MSFT" title="news"</a>
<a href="related.example.com/msft" title="web sites"</a>
<a href="quote.example.com?symbol=MSFT" title="stock quotes"></a>
</a> announced...

This example shows alternative links presented to the user, based on a language preference.

<nl>
<label>Choose a Language:</label>
<li xml:href="en.html" xml:lang="en">English</li>
<li xml:href="es.html" xml:lang="es">Español</li>
<li xml:href="de.html" xml:lang="de">Deutch</li>
</nl>

.

4.2 The xml:src Attribute

The xml:src attribute expresses a SLink link as follows: the starting resource is the resource containing the attribute, with the sub-resource being the specific element containing the attribute. The content of this attribute is a URI reference, as defined by the datatype xsd:anyURI [XML Schema part 2]. Relative URIs are processed according to [XML Base]. The ending resource and sub-resource are defined by the URI and fragment identifier (if any) in the attribute value. The arc-type is src. The prominence is equal to -1 times the number of ancestor elements that represent arcs of arc-type href.

Examples: The following example shows how an XML language could bear both xml:href and xml:src links at the same time.

<svg:label xml:href="description.xml" xml:src="graphic.png"/>

The following example shows how the object element might be defined in a future version of XHTML.

<!-- First, try the applet -->
<object
xml:base="http://www.example.com" 
xml:src="TheEarth.class"
type="application/x-java-applet">
<longdesc xml:href="applet_description.html"/>
<!-- Else, try the MPEG video -->
<object
xml:src="TheEarth.mpeg"
type="video/mpeg"
<longdesc xml:href="video_description.html"/>
<!-- Else, try the GIF image -->
<object
xml:src="TheEarth.gif"
type="image/gif"
<longdesc xml:href="image_description.html"/>
<!-- Else process the alternate text -->
The <strong>Earth</strong> as seen from space.
</object>
</object>
</object>

The following example shows how the html element might be modified in a future version of XHTML to allow an automatic client-side 'redirect' to a new document.

<html xml:src="http://example.info/redirect.html">

.

5 Out-of-line Markup

This document does not define a syntax for out-of-line markup, along the lines of [HLink]. It would, however, be straightforward to define a mapping from RDF, meta elements, or CSS syntax, to the SLink data model.

6 Conformance

An XML element conforms to SLink if it contains one or more attributes defined in this specification, and the value of any such attributes conforms to the lexical constraints of xsd:anyURI. This specification imposes no particular constraints on DTDs or schemas; conformance applies only to elements and attributes.

An XML application conforms to SLink if it recognizes the attributes defined in this specification, processes relative URIs in accordance with [XML Base], and provides a suitable user interface to realize the intent indicated by the attributes.

A References

A.1 Normative References

XLink
XML Linking Language (XLink) Version 1.0, Steve DeRose, Eve Maler, David Orchard, 2001. W3C Recommendation available at: http://www.w3.org/TR/xlink.
HLink
HLink: Link recognition for the XHTML Family, Steven Pemberton, Masayasu Ishikawa, 2002. W3C Working Draft available at: http://www.w3.org/TR/hlink.
XML 1.0
Extensible Markup Language (XML) 1.0 (Second Edition), Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, 2000. W3C Recommendation: available at: http://www.w3.org/TR/REC-xml
RFC 2396
RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax, T. Berners-Lee, R. Fielding, L. Masinter. 1998. Available at: http://www.ietf.org/rfc/rfc2396.txt.
XML Schema Part 2
XML Schema Part 2: Datatypes, Paul V. Biron, Ashok Malhotra, 2001. W3C Recommendation available at: http://www.w3.org/TR/xmlschema-2/.
XML Base
XML Base, Jonathan Marsh, 2001. W3C Recommendation available at: http://www.w3.org/TR/xmlbase/.

A.2 Informative References

XArc
XArc (a.k.a. XLink--++), Gabe Beged-Dov, 1998. Available at: http://www.jfinity.com/xarc/spec-current/index.html.
XML Names
Namespaces in XML, Tim Bray, Dave Hollander, Andrew Layman, 1999. W3C Recommendation available at: http://www.w3.org/TR/REC-xml-names/.

B Questions and Answers (Non-normative)

The following informative set of questions and answers discusses some common concerns with this approach.