W3C

Semantic Annotations for WSDL

W3C Working Draft 30 June 2006

This version:
http://www.w3.org/TR/2006/WD-sawsdl-20060630/
Latest version:
http://www.w3.org/TR/sawsdl/
Editors:
Joel Farrell, IBM
Holger Lausen, DERI Innsbruck

Abstract

This document describes a set of extension attributes for the Web Services Description Language Version 2.0 (WSDL 2.0) [WSDL 2.0] that describes the semantics of WSDL 2.0 components. The specification defines how such semantic annotation is accomplished using references to semantic models, e.g. ontologies, defined outside the WSDL 2.0 document.

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 30 June 2006 First Public Working Draft of the Semantic Annotations for WSDL, the first publication of this specification. This document is produced by the SAWSDL Working Group, which is part of the W3C Web Services Activity.

The public is encouraged to send comments to the public mailing list public-ws-semann-comments@w3.org (public archive). Discussions on this specification should take place on the public-ws-semann@w3.org mailing list (public archive.)

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.

Publication as a Working Draft 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.

Table of Contents

Appendices

1. Introduction

Semantic Annotations in WSDL Version 1.0 (SAWSDL) defines how to add semantic annotations to WSDL 2.0 components. The specification defines extension attributes that can be applied to both WSDL elements and XML Schema elements to annotate input and output messages defined in a WSDL 2.0 interface.

Semantic annotations are references from an element within a WSDL or XML Schema document to a concept in an ontology. This specification defines annotation mechanisms for relating WSDL inputs and outputs to concepts defined in an outside ontology. Similarly, it defines how to annotate WSDL operations and how to categorize WSDL interfaces. Further, it defines an annotation mechanism for specifying the structural mapping of XML Schema types to and from an ontology. The annotation mechanism is independent of the ontology expression language and this specification requires no particular ontology language.

1.1 Terminology

We provide basic definitions for the terminology we use in this document.

Semantics
Semantics in this context refers to the meaning of objects or information. An agent invoking a web service concerns itself with the semantics of the service, as well as its input and output messages.
Semantic Model
A semantic model captures the terms and concepts used to describe and represent an area of knowledge or some part of the world, including a software system. A semantic model usually includes concepts in the domain of interest, relationships among them, their properties, and their values. Usually this is described as an ontology that embodies some community agreement.
Semantic Annotation
A semantic annotation is additional information in a document that identifies or defines the semantics of a part of that document. In SAWSDL, the semantic annotations are XML attributes added to a WSDL or associated XML Schema document. They establish the meaning of elements in WSDL document by referring to a part of a semantic model.
Concept
A concept is a semantic definition. When referring to a concept within a semantic model, this specification does not make an implicit statement about its type. A concept within a semantic model might be an instance, class or property.

1.2 Notational Conventions

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC2119 [keywords].

1.3 Namespaces

The XML namespace names [XML Namespaces] URIs [URI] used by this specification are as follows:

Prefix Namespace name
sawsdl http://www.w3.org/2002/ws/sawsdl/spec/sawsdl#
wsdl http://www.w3.org/2006/01/wsdl
xs http://www.w3.org/2001/XMLSchema

1.4 Running Example

In order to illustrate the concepts of SAWSDL, later sections will use a purchase order Web service. This Web service expects as input the customer account number and a list of items to be ordered, each containing quantity information and product identifier. The service will return the status of the order, which can be either reject, accept or pending. The WSDL for this service is given below. Later examples will add semantic annnotations.

<?xml version="1.0" encoding="UTF-8"?> <wsdl:description
  targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
  xmlns="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
  xmlns:wsdl="http://www.w3.org/2006/01/wsdl"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:sawsdl="http://www.w3.org/2002/ws/sawsdl/spec/sawsdl#">

  <wsdl:types>
    <xs:schema targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#" elementFormDefault="qualified">
       <xs:element name="OrderRequest">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="customerNo" type="xs:integer" />
            <xs:element name="orderItem" type="item" minOccurs="1" maxOccurs="unbounded" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="item">
        <xs:all>
          <xs:element name="EAN" type="xs:string" />
        </xs:all>
        <xs:attribute name="quantity" type="xs:integer"/>
      </xs:complexType>

      <xs:element name="OrderResponse" type="Confirmation"/>
      <xs:simpleType name="Confirmation">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Confirmed"></xs:enumeration>
          <xs:enumeration value="Pending"></xs:enumeration>
          <xs:enumeration value="Rejected"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:schema>
  </wsdl:types>

  <wsdl:interface name="Order">
     <wsdl:operation name="order" pattern="http://www.w3.org/2006/01/wsdl/in-out">
        <wsdl:input element="OrderRequest"/>
        <wsdl:output element="OrderResponse"/>
     </wsdl:operation>
  </wsdl:interface>
</wsdl:description>

2. Annotation Mechanism

This section describes how semantic annotations are added to WSDL components.

Conceptually, WSDL 2.0 has the following components to represent service descriptions: types, interface, operation, binding, service and endpoint. Of these, the first three, namely types, interface and operation, deal with the abstract definition of a service while the remaining three deal with service implementation. This specification focuses on semantically annotating the abstract definition of a service to enable dynamic discovery, composition and invocation of services. This specification does not address the annotation of service implementations. It provides URI reference mechanisms via extensibility elements to the WSDL types, interface and operation components to point to the semantic constructs defined in the domain models.

A summary of the extensibility attributes defined by SAWSDL is given below:

The semantic annotation mechanism defined by this specification does not rely on any particular semantic modeling language. It only requires that the semantic concepts defined in it be identifiable via URI references. The URIs typically refer to a semantic model document external to the WSDL document. However, the URIs can also refer to elements within the WSDL document if semantic information is included in the document via WSDL extension elements.

Both schema mapping and model reference can contain a list of pointers. The schema mappings are interpreted as alternatives whereas the model references all apply. SAWSDL does not specify any other relationship between them.

2.1 SAWSDL Model Reference

This section defines the extension attribute modelReference. A model reference may be used with every element within the WSDL, however SAWSDL defines its meaning only for wsdl:operation, wsdl:interface, xs:element, xs:complexType, xs:simpleType and xs:attribute.

The following XML schema excerpt defines the modelReference attribute.

…
<xs:simpleType name="listOfAnyURI">
    <xs:list itemType="xs:anyURI"/>
</xs:simpleType>
<xs:attribute name="modelReference" type="sawsdl:listOfAnyURI" />
…

The value of the attribute is a list of one or more URIs, separated by blanks, that reference concepts in a semantic model. Each referenced concept describes the annotated component of the WSDL document. Model references define the semantics of the components of the WSDL instance document. They make no statements about syntactic or structural relationships between operation inputs or outputs and instance data conforming to the semantic model.

When a WSDL component is annotated with a modelReference that includes multiple URI references to the model, each of them applies, but no logical relationship between them is defined.

SAWSDL does not define a particular way for dereferencing model references, i.e. it does not prescribe how a client processor can obtain the document in which the semantic model is defined. It is recommended that the URI used for pointing to a semantic concept resolves to a document containing its definition. If the semantic model is expressed using XML it alternatively can also be placed directly within the WSDL document.

The modelReference annotations on xs:element, xs:complexType, xs:simpleType and xs:attribute define the semantics of the input or output of WSDL operations that refer to these schema elements. A modelReference on a WSDL operation gives semantic information about that operation, while a modelReference on a WSDL interface provides a classification of the interface via a references classification scheme.

2.1.1 Annotating Interfaces With Model Reference

This section defines how modelReference can be used to annotate interfaces, particularly in order to categorize them according to some model. A modelReference on a WSDL interface component provides a reference to a concept or concepts in a semantic model that describe the interface. This specification describes specifically how to use modelReference to categorize the interface according to some taxonomy. The example below illustrates a categorization annotation on an interface.

…
<wsdl:interface name="Order" sawsdl:modelReference="http://example.org/categorization/products/electronics">
  …
</wsdl:interface>
…

The modelReference points to a category in a semantic model. For taxonomies that are not expressed as part of a semantic model, the modelReference can point to a simple semantic model that contains the taxonomy reference information. This specification does not define such a categorization semantic model, but includes a non-normative example in Appendix D.

One purpose for annotating services at the interface level is to help enable dynamic discovery. This is possible when services are published, cataloged and annotated with semantics. The modelReference mechanism adds categorization information to services which could be used while publishing services in registries such as Universal Description, Discovery and Integration (UDDI). Users can choose any categorization of their choice such as NAICS [NAICS], UNSPSC [UNSPSC] and GICS [GICS]. This aids in service discovery by narrowing the range of candidate services. The categorization can be used as input when the service is published in a UDDI registry since taxonomies supported by UDDI can be specified via the categorization ontology. Additionally, it can constitute the effective categorization when the service is made available via Web Services Inspection Language or some other solution-specific means. Service categorization is also aimed at supporting specialized taxonomies of middleware or utility services such as mediators. The category modelReference is used to ensure that there is basic and high-level categorization information about a service.

2.1.2 Annotating Operations With Model Reference

The example below illustrates how to use the modelReference attribute to annotate the operation element in the example introduced in Section 1.4. The annotation of the operation element is by reference to a concept in a semantic model which provides a high level description of the operation. In the purchase order example, the order operation can be annotated using the RosettaNet Ontology [RosettaNet Ontology]. The annotation of the operation using the modelReference attribute is shown below.

…
<wsdl:operation name="order" pattern="http://www.w3.org/2006/01/wsdl/in-out"
  sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/rosetta#RequestPurchaseOrder">
…

An OWL ontology created as an illustrative example using the RosettaNet PIPs is available at [RosettaNet Ontology]. Although, inputs and outputs provide a logical way of capturing the semantics of an operation, a simple semantic annotation indicating the intended behavior of a given operation as a verb concept may be useful at certain times. During service discovery, this verb provides a course indication of whether this service is a match for a given request.

2.1.3 Annotating Simple Types With Model Reference

To annotate simple types, include a modelReference on the xs:simpleType element. An example is shown below for the output of the order operation.

<xs:simpleType name="Confirmation"
  sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderConfirmation">
  …
</xs:simpleType>

2.1.4 Annotating Complex Types With Model Reference

The two principal techniques for annotating complex types can be summarized as follows:

In the bottom level annotation, all the member elements and attributes in a complex type can be annotated. In some cases, the members of a complex type will correspond with the concepts in a semantic model. To accommodate this case, the member elements and attributes can be annotated by adding a modelReference attribute to the relevant schema element or attribute definition. Botton level annotation is formally defined under Annotating Elements With Model Reference and Annotating Attributes With Model Reference.

In top level annotation, complex types themselves are annotated with the semantic concept. If multiple concepts describe the complex type, all of their URIs can be included in the value of the modelReference attribute. This sawsdl:modelReference attribute on a complex type annotates the type as a whole, but does not necessarily make specific statements about the elements or attributes within the complex type.

A complex type can be annotated at both the top and member level. Both the high-level type annotation and the specific member element or attribute annotation apply to the member.

2.1.5 Annotating Elements With Model Reference

To annotate elements, include a modelReference on the xs:element element. An example of annotating the member elements of a complex type with the modelReference attribute is shown below.

<xs:sequence minOccurs="1" maxOccurs="unbounded">
  <xs:element name="quantity" type="xs:integer"
    sawsdl:modelReference="POOntology#Quantity"/>
  <xs:element name="ISBN" type="xs:string"
    sawsdl:modelReference="POOntology#ItemCode"/>
</xs:sequence>

2.1.6 Annotating Attributes With Model Reference

To annotate elements, include a modelReference on the xs:attribute element. If the quantity element in the example above where defined as an attribute, a modelReference could be applied to it as follows.

<xs:attribute name="quantity" type="xs:integer"
    sawsdl:modelReference="POOntology#Quantity"/>

2.2 SAWSDL Schema Mapping

Schema mapping relates the instance data defined by an XML schema document with some semantic data defined by a semantic model. Such mappings are useful when the structure of the instance data does not correspond to the organization of the semantic data. The mappings are used when mediation code is generated to support invocation of a Web service.

This section defines the extension attributes liftingSchemaMapping and loweringSchemaMapping. They are used to associate a schema type with an ontology, as just described. Schema mappings may be added to global type definitions (complex or simple) as well as to global element and attribute definitions. It is possible to specify either lowering or lifting information as well both together on the same schema element. The following schema excerpt defines the liftingSchemaMapping and loweringSchemaMapping attributes.

…
<xs:simpleType name="listOfAnyURI">
    <xs:list itemType="xs:anyURI"/>
</xs:simpleType>
<xs:attribute name="liftingSchemaMapping" type="sawsdl:listOfAnyURI" />
<xs:attribute name="loweringSchemaMapping" type="sawsdl:listOfAnyURI" />
…

The value of the liftingSchemaMapping attribute is a list of URI's that reference mapping definitions. A mapping referenced by this attribute defines how an XML instance document conforming to the element or type defined in a schema is transformed to data that conforms to a semantic model, i.e. the output of the transformation process will be semantic data. The input to the transformation is the element on whose declaration the mapping is located; or an element valid according to the type on whose definition the mapping is located.

The value of the loweringSchemaMapping attribute is a list of URI's that reference mapping definitions. A mapping referenced by this attribute defines how data in a semantic model is transformed to XML instance data. The input will be some semantic data. The output of the process will be the XML element on whose declaration the mapping is located; or an element valid according to the type on whose definition the mapping is located.

This specification provides a mechanism for associating optional schema mapping functions with a global type or element definition without any restriction on the choice of the schema mapping language. The following excerpt from the purchase order example shows how XSLT can be used as a schema mapping language to specify associations between XSD elements and concepts in a semantic model. Detailed examples showing mapping using XSLT [XSLT] and XQuery [XQuery] are shown in Appendix A.

…
<xs:element name="OrderRequest"
    sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderRequest"
    sawsdl:liftingSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/mapping/Request2Ont.xslt">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="customerNo" type="xs:integer" />
      <xs:element name="orderItem" type="item" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
</xs:element>
…

In order to perform the lifting of the data contained in some message, a client processor applies the transformation that can be retrieved from the URI given in the value of sawsdl:liftingSchemaMapping and applies the transformation to those elements where the schema mapping was specified. In the case above http://www.w3.org/2002/ws/sawsdl/spec/mapping/Request2Ont.xslt will be applied to OrderRequest elements. If a mapping is specified on a global type definition the mapping definition must only be applied to the elements that are of that type.

A mapping specified on an element, including an empty value (""), overrides any mappings specified on its type. If no mapping is specified on the element, the mapping on its type applies to the element.

A mapping specified on a complexType, including an empty value (""), overrides any mappings specified on its member attributes and elements.

3. WSDL 1.1 Support

The mechanism for semantic annotation described in this specification can also be applied to WSDL 1.1 [WSDL 1.1] conformant Web services descriptions. All the XML attributes defined in this specification apply without modification to the WSDL 1.1 descriptions. However, in some cases they are applied to different elements in the WSDL document structure.

Input and Output

Annotation of XML Schema types with modelReference, liftingSchemaMapping or loweringSchemaMapping or schema can be accomplished using the approach described for annotating these elements in WSDL 2.0. In addition, a liftingSchemaMapping, loweringSchemaMapping or modelReference attribute may be added to a part element (under a message element) to specify an input or output annotation that applies to the entire message part. These elements are part of the portType structure in WSDL1.1 which generally corresponds to the WSDL2.0 interface structure.

Faults

In WSDL 1.1, faults are specified as messages that are generated when a particular condition arises. Annotations for fault messages are done just as annotations are done for any other output message.

Operations

An operation is annotated as in WSDL 2.0.

portTypes

A portType is annotated in the same way as a WSDL 2.0 interface.

4. References

4.1 Normative References

[keywords]
Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, Author. Internet Engineering Task Force, June 1999. Available at http://www.ietf.org/rfc/rfc2119.txt.
[OWL]
OWL Web Ontology Language Reference, Mike Dean and Guus Schreiber, Editors. W3C Recommendation, 10 February 2004, http://www.w3.org/TR/2004/REC-owl-ref-20040210/.
Latest version available at http://www.w3.org/TR/owl-ref/.
[SOAP]
SOAP Version1.2 Part 1: Messaging Framework, M. Gudgin, M. Hadley, N. Mendelsohn, J-J. Moreau, H. Frystyk Nielsen, Editors. World Wide Web Consortium, 24 June 2003. This version of the "SOAP Version 1.2 Part 1: Messaging Framework" Recommendation is http://www.w3.org/TR/2003/REC-soap12-part1-20030624/. The latest version of "SOAP Version 1.2 Part 1: Messaging Framework" is available at http://www.w3.org/TR/soap12-part1/.
[URI ]
UniformResource Identifiers (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.
[WSDL 2.0]
Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language, R. Chinnici, J-J. Moreau, A. Ryman, S. Weerawarana, Editors. World Wide Web Consortium, 27 March 2006. This version of the "Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language" Specification is available is available at http://www.w3.org/TR/2006/CR-wsdl20-20060327. The latest version of "Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language" is available at http://www.w3.org/TR/wsdl20.
[XML Namespaces]
Namespaces in XML, T. Bray, D. Hollander, and A. Layman, Editors. World Wide Web Consortium, 14 January 1999. This version of the Namespaces in XML Recommendation is http://www.w3.org/TR/1999/REC-xml-names-19990114. The latest version of Namespaces in XML is available at http://www.w3.org/TR/REC-xml-names.
[XML]
Extensible Markup Language (XML) 1.0 (Third Edition), T. Bray, J. Paoli, C. M. Sperberg-McQueen, E. Maler, and F. Yergeau, Editors. World Wide Web Consortium, 4 February 2004. This version of the XML 1.0 Recommendation is http://www.w3.org/TR/2004/REC-xml-20040204/. The latest version of "Extensible Markup Language (XML) 1.0" is available at http://www.w3.org/TR/REC-xml.
[XMLSchema Part 1: Structures]
XML Schema Part 1: Structures, H. Thompson, D. Beech, M. Maloney, and N. Mendelsohn, Editors. World Wide Web Consortium, 28 October 2004. This version of the XML Schema Part 1 Recommendation is http://www.w3.org/TR/2004/REC-xmlschema-1-20041028. The latest version of XML Schema Part 1 is available at http://www.w3.org/TR/xmlschema-1.
[XMLSchema Part 2: Datatypes]
XML Schema Part 2: Datatypes, P. Byron and A. Malhotra, Editors. World Wide Web Consortium, 28 October 2004. This version of the XML Schema Part 2 Recommendation is http://www.w3.org/TR/2004/REC-xmlschema-2-20041028. The latest version of XML Schema Part 2 is available at http://www.w3.org/TR/xmlschema-2.
[XQuery]
XQuery 1.0: An XML Query Language, Don Chamberlin , Anders Berglund, Scott Boag, et. al., Editors. World Wide Web Consortium, 3 Nov 2005. This version is http://www.w3.org/TR/2005/CR-xquery-20051103/. The latest version is available at http://www.w3.org/TR/xquery/.
[XSLT]
XSL Transformations (XSLT) Version 2.0, Michael Kay, Editor. World Wide Web Consortium, 3 Nov 2005. This version is http://www.w3.org/TR/2005/CR-xslt20-20051103/. The latest version is available at http://www.w3.org/TR/xslt20/.

4.2 Informative References

[GICS]
Global Industry Classification Standard. Available at http://www.msci.com/equity/gics.html.
[NAICS]
North American Industry Classification System. Available at http://www.census.gov/epcd/www/naics.html.
[ODM]
Ontology Definition Metamodel. Revised Submission to OMG/RFP ad/2003-03-40, Jan. 2005.Available at http://www.omg.org/docs/ad/05-01-01.pdf.
[RosettaNet]
RosettaNet.Available at http://www.rosettanet.org.
[RosettaNet Ontology]
RosettaNet Ontology. Available at http://www.w3.org/2002/ws/sawsdl/spec/ontology/rosetta.owl.
[UML]
Unified Modeling language (UML) Version 2.0. Object Management Group. Available at http://www.omg.org/technology/documents/formal/uml.htm.
[UNSPSC]
The United Nations Standard Products and Services Code. United Nations Development Programme. Available at http://www.unspsc.org/.
[WSDL 1.1]
W3C Note, Web Services Description Language (WSDL) 1.1 Erik Christensen, Francisco Curbera, Greg Meredith and Sanjiva Weerawarana, Authors. Available at http://www.w3.org/TR/2001/NOTE-wsdl-20010315.

A. An Example (Non-Normative)

The purpose of the ontologies is purely to illustrate the concepts outlined within this specification. The relevance of the concepts referenced might be increased in subsequent versions of the specification.

This is an example WSDL document that is annotated with semantic information to give the reader an example of what is explained in the rest of the document. The semantic annotations that have been explained in section 2 drew from this example.

The two ontologies we use in this example are:

The complete wsdl file is given below and available as separate http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:description
  targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
  xmlns="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
  xmlns:wsdl="http://www.w3.org/2006/01/wsdl"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:sawsdl="http://www.w3.org/2002/ws/sawsdl/spec/sawsdl#">

  <wsdl:types>
    <xs:schema targetNamespace="http://example.org/order#" elementFormDefault="qualified">
      <xs:element name="OrderRequest"
        sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderRequest"
        sawsdl:liftingSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/mapping/Request2Ont.xslt">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="customerNo" type="xs:integer" />
            <xs:element name="orderItem" type="item" minOccurs="1" maxOccurs="unbounded" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="item" sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#Item">
        <xs:all>
          <xs:element name="EAN" type="xs:string" />
        </xs:all>
        <xs:attribute name="quantity" type="xs:integer"/>
      </xs:complexType>

      <xs:element name="OrderResponse" type="Confirmation" sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderConfirmation"/>
      <xs:simpleType name="Confirmation">
        <xs:restriction base="xs:string">
          <xs:enumeration value="Confirmed"></xs:enumeration>
          <xs:enumeration value="Pending"></xs:enumeration>
          <xs:enumeration value="Rejected"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:schema>
  </wsdl:types>

  <wsdl:interface name="Order" sawsdl:modelReference="http://example.org/categorization/products/electronics">
    <wsdl:operation name="order" pattern="http://www.w3.org/2006/01/wsdl/in-out"
        sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/rosetta#RequestPurchaseOrder">
      <wsdl:input element="OrderRequest"/>
      <wsdl:output element="OrderResponse"/>
    </wsdl:operation>
  </wsdl:interface>
</wsdl:description>

In this sample, we present a simple Web service for an item purchase order. The semantic concepts and their relationships are modeled in an OWL ontology. The inputs, outputs of the ProcessPurchaseOrder service are annotated within the respective schema definition.

A.1 Specifying Schema Mapping Using XSLT

The XSLT transformation is work in progress and known to be incomplete.

<?xml version='1.0' ?> <xsl:transform version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
  xmlns:POOntology="http://example.org/ontologies/purchaseorder#">
  <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes" />

  <xsl:template match="/">
    <!-- NOTE: unclear what ID to give element -->
    <POOntology:OrderRequest rdf:ID="req123">
      <POOntology:has_items rdf:resource="item123"/>
    </POOntology:OrderRequest>

    <xsl:apply-templates select="//po:orderItem" />
  </xsl:template>

  <xsl:template match="//po:orderItem">
    <!-- NOTE: unclear what ID to give element -->
    <POOntology:Item rdf:ID="item123">
      <POOntology:has_EANCode><xsl:value-of select="po:EAN" /></POOntology:has_EANCode>
      <POOntology:has_Quantity>12.0</POOntology:has_Quantity>
    </POOntology:Item>
  </xsl:template>

</xsl:transform>

Below the result of the xslt transformation applied to a sample message.

<?xml version="1.0" encoding="iso-8859-1"?> <rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"
         xmlns:POOntology="http://example.org/ontologies/purchaseorder#">
   <POOntology:OrderRequest rdf:ID="req123">
      <POOntology:has_items rdf:resource="item123"/>
   </POOntology:OrderRequest>
   <POOntology:Item rdf:ID="item123">
      <POOntology:has_EANCode>912898437732</POOntology:has_EANCode>
      <POOntology:has_Quantity>12.0</POOntology:has_Quantity>
   </POOntology:Item>
</rdf:RDF>

A.2 Specifying Schema Mapping Using XQuery

We will provide this in future versions of the specification

B. Mapping Choices

This specification does not specify a single mapping language to use. However, as domain models like UML, OWL and XSD are represented in XML, the examples in the document represent mappings either as transformations using XSLT or queries using XQuery. Using these mappings from xml schema elements to concepts in a domain model, it is possible to map instances of Web service schemas from one representation to another. The process of capturing mappings can be complicated by heterogeneities at various levels and XQuery or XSLT might not be suited for all cases. The annotation mechanism defined in this specification can refer to mappings expressed in other mapping languages since it is agnostic to the mapping language used.

Table 1 illustrates the schema/data conflicts that most mapping representation languages are capable of handling and how instances of one schema can be mapped to instances of another using a common ontology.

Schematic / Data conflicts

Table 1: Possible schematic / data conflicts between xml input/output messages

* Although the mapping function is well defined in one direction, from the WSDL element to the Ontology concept, it is not well defined in the reverse direction. Although converting a 5 digit StudentID to a 9 digit StudentID is conceivable through use of a look up table, the transformation is not a well defined function in itself.

Legend: WS1, WS2 denote Web Services 1 and 2 and f1 and f2 denote mapping functions from the WSDL elements to the ontology.

C. XML Schema for Semantic Annotations for WSDL

The SAWSDL schema is also available as separate document.

<?xml version="1.0" encoding="UTF-8"?> <xs:schema
  targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/sawsdl#"
  xmlns:sawsdl="http://www.w3.org/2002/ws/sawsdl/spec/sawsdl#"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:wsdl="http://www.w3.org/2006/01/wsdl">

  <xs:simpleType name="listOfAnyURI">
    <xs:list itemType="xs:anyURI"/>
  </xs:simpleType>

  <xs:attribute name="modelReference" type="sawsdl:listOfAnyURI" />
  <xs:attribute name="liftingSchemaMapping" type="sawsdl:listOfAnyURI" />
  <xs:attribute name="loweringSchemaMapping" type="sawsdl:listOfAnyURI" />

</xs:schema>

D. An Example Categorization Model (Non-Normative)

In this example,a modelReference points to concept in an ontology that gives three pieces of information, the name of the category, the taxonomy value (category code) of the category and the URI of the taxonomy. An example of instance data that would be referenced by an interface annotation is shown here.

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:if="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#">
  <if:Category rdf:about="urn:Electronics"
    if:hasValue="443112"
    if:usesTaxonomy="http://naics.com/"/>
</rdf:RDF>

This instance data derives from the following simple example model.

<rdf:RDF>
<rdfs:Class rdf:about="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#Category"/>
	<rdf:Property rdf:about="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#hasValue">
<rdfs:domain rdf:resource="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#Category"/>
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
</rdf:Property>
	<rdf:Property rdf:about="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#usesTaxonomy">
<rdfs:domain rdf:resource="http://www.w3.org/2002/ws/sawsdl/spec/ontology/interface#Category"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#anyUri"/>
</rdf:Property>
</rdf:RDF>

E. Acknowledgements (Non-Normative)

This document is the work of the W3C Semantic Annotations for Web Service Description Language Working Group.

Members of the Working Group are (at the time of writing, and by alphabetical order): Rama Akkiraju (IBM Corporation), Carine Bournez (W3C), J.B. Domingue (The Open University), Joel Farrell (IBM Corporation), Laura Ferrari (Telecom Italia SpA), Laurent Henocque (ILOG, S.A.), Nicholas Gibbins (University of Southampton), James Hendler(Maryland Information and Network Dynamics Lab at the University of Maryland), Mathias Kleiner (ILOG, S.A.), Jacek Kopecký (DERI Innsbruck at the Leopold-Franzens-Universität Innsbruck, Austria), Holger Lausen (DERI Innsbruck at the Leopold-Franzens-Universität Innsbruck, Austria), Jianhui Li (Chinese Academy of Sciences), Terry Payne (University of Southampton), Carlos Pedrinaci (The Open University), Eric Prud'hommeaux (W3C), Brahmananda Sapkota (DERI Galway at the National University of Ireland, Galway, Ireland), Amit Sheth (Semagix, Inc.), Claudio Venezia (Telecom Italia SpA), Tomas Vitvar (DERI Galway at the National University of Ireland, Galway, Ireland).

The working group also recieved significant help from John Miller (University of Georgia).

F. Change Log (Non-Normative)

Table F-1. Summary of Semantic Annotations for WSDL Specification Changes
Date Author Description
20060628 JAF Made all textual changes required for publication as 1st Public Draft, as indentified in 27 June 2006 WG call.
20060626 JAF Completed documentation of decisions from f2f in Galway, including resolutions to issues 6, 7, 8, 9 and 14 on schema mapping, and 10 on categorization as a modelReference. (Some done in HL's previous update)
20060620 HL Reordered Appendixes according to f2f. Referenced copy of RNet ontology. changed text on semantic models
20060614 JAF Documented resolution to Issue 18: Relationship between modelReferences. Documented initial part of Issue 6 on lifting and lowering mappings. Continued with section 2 restructuring.
20060607 JAF Documented resolution to Issue 5: Multiplicity of modeReferences. Documented initial part of Issue 6: Clarification of SchemaMapping concept.
20060530 JAF Documented resolution to Issue 2: embedding semantic descriptions. Removed some WSDL 1.1 terminology.
20060523 HL changed categoryname from xs:NcName to xs:string.
20060523 HL Introduced simple example in Section 1, modified structure 2 to reflect the elements defined. (Addressed Issue 1 and 9).
20060519 JAF Split References into Normative and Informative and brought them up to TR quality.
20061505 HL made sawsdl scheme independent of wsdl xsd by resolution in http://www.w3.org/2002/ws/sawsdl/minutes/20060509
20060508 HL Created sawsdl xsd, removed example.org imports for sawsdl schema.
20060509 HL Created separate files for documents in purchase order example (grouped xsds to one file). Corrected several errors (mainly namespace), adopted xslt and XQuery examples respectively.
20060504 JAF Based on 02 May 06 call - added requirements on semantic models, example.org for examples namespace, added todo list. More editorial clean up.
20060418 JAF Changed name of spec based on decision in 18 April 06 call. Also editorial clean up.
20060414 JAF Removed non-spec material from Mapping Choices Appendix.

G. Editors' Todo List (Non-Normative)

Table G-1. Summary of Editors' Semantic Annotations for WSDL Specification Work Items
Type Description
Editorial Need to update examples so a single example is built up from the introduction though the appendix.
Editorial Example of an XSLT schema mapping function needs to be updated and an XQuery example needs to be added.