W3C

The SML XLink Reference Scheme

W3C Working Group Note 15 October 2009

This Version:
http://www.w3.org/TR/2009/NOTE-sml-xlink-ref-scheme-20091015
Latest Version:
http://www.w3.org/TR/sml-xlink-ref-scheme
Previous Version:
http://www.w3.org/TR/2009/NOTE-sml-xlink-ref-scheme-20090630
Editors:
Pratul Dublish, Microsoft Corporation
Len Charest, Microsoft Corporation
Virginia Smith, Hewlett-Packard

[Jump to Table of Contents]

Abstract

The Service Modeling Language [SML] specification extends the Extensible Mark-up Language [XML] and XML Schema [XML Schema] with a mechanism for incorporating into XML documents references to other documents or document fragments. This technical note addresses the construction of an SML reference scheme based on the XML Linking Language [XLink].

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is the W3C Working Group Note "The SML XLink Reference Scheme". This document was produced by the SML Working Group as part of the XML Activity.

Please submit comments on this document using the procedure described on the Working Group's home page. In summary, the Working Group solicits comments in Bugzilla from those who have access, and on the Working Group's public mailing list (public archive) from others.

Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document is intended to illustrate the design of an SML reference scheme based on XML Linking Language [XLink] links. Currently, this document is consistent with the Service Modeling Language (SML) 1.1 specification [SML] and the Service Modeling Language Interchange Format (SML-IF) 1.1 specification [SML-IF], but it may be obsoleted by future versions of these specifications. The SML WG does not expect this document to become a W3C Recommendation.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents


1. Introduction [Back to Contents]

The Service Modeling Language [SML] specification extends the Extensible Mark-up Language [XML] and XML Schema [XML Schema] with a mechanism for incorporating into XML documents references to other documents or document fragments. A reference to another document or document fragment is encoded by means of markup compliant with one or more reference schemes as defined in SML ([SML], section 4.3). The SML specification defines one reference scheme, the SML URI Reference Scheme, which enables XML documents to use URIs [RFC 3986] to identify documents or document fragments. The SML URI Reference Scheme has the significant advantage of guaranteeing referential conformance of models that are exchanged between vendors ([SML-IF], section 5.1).

The SML specification does not mandate the use of any specific reference scheme, and provides an extensibility mechanism for defining new reference schemes. This note illustrates how the extensibility mechanism can be used to define an SML reference scheme based on XLink links.

Note:

The xlink prefix is used throughout this document to stand for the declaration of the XLink namespace on elements in whose scope the so-marked attribute appears (on the same element that bears the attribute or on some ancestor element), whether or not an XLink namespace declaration is present in the example.

2. SML XLink Reference Scheme Definition [Back to Contents]

The SML XLink Reference Scheme is defined as follows:

  1. An SML reference is identified as an instance of the SML XLink Reference Scheme if and only if the following condition is true:

    1. It has an attribute information item whose [local name] is href, and whose [namespace name] is http://www.w3.org/1999/xlink.

  2. An instance of the SML XLink Reference Scheme is valid if it meets all of the following requirements:

    1. The content of xlink:href is of type xs:anyURI [XSD Datatypes].

    2. The fragment component (if present) follows the syntax of one of the following:

      1. The smlxpath1() XPointer scheme as defined in [SML]

      2. An XPointer shorthand pointer as defined in [XPointer]

    3. If an attribute information item whose [local name] is type and whose [namespace name] is http://www.w3.org/1999/xlink is present, then its content is the string simple.
  3. An SML reference that is an instance of the SML XLink Reference Scheme is resolved using the following steps:

    1. Let U be the URI reference that is the content of xlink:href. Let S be the specification that defines the URI scheme of U.

    2. An XML document D is obtained as follows:

      1. If U is a same-document reference, then D is the document containing the SML reference.

      2. Otherwise, D is determined as follows:

        1. If U is a relative reference, then let U′ be the result of transforming U to form an (absolute) URI using the [base URI] property [XML Infoset] of the SML reference element as the base URI. Otherwise, let U′ be U (i.e., the URI reference itself). The computation of the [base URI] property is implementation-defined.

        2. Dereference U′ as defined in S. If the document targeted by U′ is in the current SML model, then D is that document. Otherwise, if the document is not in the current SML model, then the SML XLink Reference Scheme instance is unresolved (and D has no value).

          Note:

          If the retrieved object is not of XML media type or if it is not well-formed XML then, per the definition in section 2.2 of [SML], that object is not a document. In this case, the SML reference scheme instance is unresolved.

    3. If no fragment component is present in U, the SML XLink Reference Scheme instance resolves to the root element of D.

    4. If a fragment component is present in U, then the appropriate case among the following applies:

      1. If the fragment component complies with the smlxpath1() XPointer scheme syntax, then the reference target is obtained by applying the fragment component to D, as defined in section 4.3.1.1 of [SML].

      2. If the fragment component complies with the shorthand pointer syntax, then the appropriate case among the following applies:

        1. If a target T can be identified in D based on the schema-determined ID, then the reference target is T.

        2. If a target in D cannot be identified based on the schema-determined ID, then it is implementation-defined whether the reference target in D is identified based on other criteria allowed for shorthand pointers.

  4. Instances of the SML XLink Reference Scheme are transformed to target-complete identifiers through standard URI processing, as described in the applicable RFC for URI generic syntax.

3. Examples [Back to Contents]

The following example illustrates an instance of the XLink Reference Scheme:

<Student>
  <ID>123</ID>
  <Name>Jane Doe</Name>
  <EnrolledCourses>
    <EnrolledCourse 
       xmlns:sml="http://www.w3.org/ns/sml"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       sml:ref="true" 
       sml:nilref="false"
       xlink:href="http://www.university.example.org/phy101.xml"
    </EnrolledCourse>
  </EnrolledCourses>
</Student>

Here, the EnrolledCourse element is a valid instance of the SML XLink Reference Scheme since an attribute xlink:href is present and its content is of type xs:anyURI. It is also an SML reference since the content of sml:ref is the string true; in particular, it is a non-null SML reference since the content of sml:nilref is the string false. The target of the reference is the root element of the XML document obtained by dereferencing http://www.university.example.org/phy101.xml.

The following example illustrates an instance of XLink Reference Scheme where the content of xlink:href has a fragment component that follows the syntax of the smlxpath1() XPointer scheme:

<Student>
  <ID>123</ID>
  <Name>Jane Doe</Name>
  <EnrolledCourses>
    <EnrolledCourse 
       xmlns:sml="http://www.w3.org/ns/sml"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:u="http://www.university.example.org/ns"
       sml:ref="true" 
       sml:nilref="false"
       xlink:href="http://www.university.example.org/physics.xml
                   #smlxpath1(u:Courses/u:Course[u:Name='PHY101'])"
    </EnrolledCourse>
  </EnrolledCourses>
</Student>

In the above example, the target of the reference is the element identified by the path /u:Courses/u:Course[u:Name='PHY101'] in the XML document obtained by dereferencing http://www.university.example.org/physics.xml.

A. References [Back to Contents]

[RFC-3986]
Uniform Resource Identifier (URI): Generic Syntax, T. Berners-Lee, R. Fielding, L. Masinter, Authors. Internet Engineering Task Force, January 2005. Available at http://www.ietf.org/rfc/rfc3986.txt.
[SML]
Service Modeling Language, Version 1.1, Bhalchandra Pandit, Valentina Popescu, Virginia Smith, Editors. World Wide Web Consortium, 12 May 2009. This version of the Service Modeling Language Recommendation is available at http://www.w3.org/TR/2009/REC-sml-20090512/. The latest version of Service Modeling Language, Version 1.1 is available at http://www.w3.org/TR/sml/.
[SML-IF]
Service Modeling Language Interchange Format Version 1.1, Bhalchandra Pandit, Valentina Popescu, Virginia Smith, Editors. World Wide Web Consortium, 12 May 2009. This version of the Service Modeling Language Interchange Format Recommendation is available at http://www.w3.org/TR/2009/REC-sml-if-20090512/. The latest version of Service Modeling Language Interchange Format Version 1.1 is available at http://www.w3.org/TR/sml-if/
[XLink]
XML Linking Language (XLink) Version 1.1, Steve DeRose, Eve Maler, David Orchard, Editors. World Wide Web Consortium, 31 March 2008. This version of the XLink Recommendation is available at http://www.w3.org/TR/2001/REC-xlink-20010627/. The latest version of XLink is available at http://www.w3.org/TR/xlink11/.
[XML]
Extensible Markup Language (XML) 1.0 (Fourth Edition), T. Bray, J. Paoli, C. M. Sperberg-McQueen, and E. Maler, Editors. World Wide Web Consortium, 10 February 1998, revised 16 August 2006. The edition cited (http://www.w3.org/TR/2006/REC-xml-20060816) was the one current at the date of publication of Service Modeling Language [SML] as a Candidate Recommendation. The latest version of XML 1.0 is available at http://www.w3.org/TR/xml/. Implementations may follow the edition cited and/or any later edition(s); it is implementation-defined which editions are supported by an implementation.
[XML-Infoset]
XML Information Set (Second Edition), John Cowan, Richard Tobin, Editors. World Wide Web Consortium, 4 February 2004. This version of the XML Information Set Recommendation is available at http://www.w3.org/TR/2004/REC-xml-infoset-20040204/. The latest version of XML Information Set is available at http://www.w3.org/TR/xml-infoset/.
[XML-Schema]
The XML Schema definition language (XSD) is specified in the following Recommendations from the Word Wide Web Consortium:
[XSD-Structures]
XML Schema Part 1: Structures Second Edition, Henry S. Thompson, David Beech, Murray Maloney, Noah Mendelsohn, Editors. World Wide Web Consortium, 2 May 2001, revised 28 October 2004. This version of the XML Schema Part 1 Recommendation is available at http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The latest version of XML Schema 1.0 Part 1 is available at http://www.w3.org/TR/xmlschema-1/.
[XSD-Datatypes]
XML Schema Part 2: Datatypes Second Edition, P. Byron and A. Malhotra, Editors. World Wide Web Consortium, 2 May 2001, revised 28 October 2004. This version of the XML Schema Part 2 Recommendation is available at http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/. The latest version of XML Schema 1.0 Part 2 is available at http://www.w3.org/TR/xmlschema-2/.
[XPointer]
XPointer Framework, P. Grosso, E. Maler, J. Marsh, and N. Walsh, Editors. World Wide Web Consortium, 25 March 2003. This version of the XPointer Framework Recommendation is http://www.w3.org/TR/2003/REC-xptr-framework-20030325/ The latest version of XPointer Framework is available at available at http://www.w3.org/TR/xptr-framework/.