Movatterモバイル変換


[0]ホーム

URL:


W3C

Semantic Annotations for WSDL and XML Schema

W3C Recommendation 28 August 2007

This version:
http://www.w3.org/TR/2007/REC-sawsdl-20070828/
Latest version:
http://www.w3.org/TR/sawsdl/
Previous version:
http://www.w3.org/TR/2007/PR-sawsdl-20070705/
Editors:
Joel Farrell, IBM
Holger Lausen, DERI Innsbruck

Please refer to theerrata for this document, which may include some normative corrections.

See alsotranslations.

Copyright © 2007W3C® (MIT,ERCIM,Keio), All Rights Reserved. W3Cliability,trademark anddocument use rules apply.


Abstract

This document defines a set of extension attributes for the Web ServicesDescription Language and XML Schema definition language that allowsdescription of additional semantics of WSDL components. The specification defines how semantic annotation is accomplished using references to semantic models, e.g.ontologies. Semantic Annotations for WSDL and XML Schema (SAWSDL) does not specify a language for representing the semantic models.Instead it provides mechanisms by which concepts from the semantic models, typically defined outsidethe WSDL document, can be referenced from within WSDL and XML Schema components using annotations.

Status of this Document

This section describes the status of this document at the timeof 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 theW3C technical reports index at http://www.w3.org/TR/.

This is theW3C Recommendation of the Semantic Annotations for WSDL and XML Schema specification. It has been produced by theSAWSDL Working Group, which is part of theW3C Web Services Activity.

Feedback on this document is welcome on the public mailing listpublic-ws-semann-comments@w3.org (public archive).

The Working Group released animplementation report and atest suite. Adiff-marked version against the previous version of this document is available.

This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

This document was produced by a group operating under the5 February 2004 W3C Patent Policy. W3C maintains apublic 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 containsEssential Claim(s) must disclose the information in accordance withsection 6 of the W3C Patent Policy.

Table of Contents

Appendices

1. Introduction

Semantic Annotations for WSDL and XML Schema (SAWSDL) defines how to add semanticannotations to various parts of a WSDL document such as input and output message structures, interfaces andoperations. The extension attributes defined in this specification fit within the WSDL 2.0 [WSDL 2.0],WSDL 1.1 [WSDL 1.1] and XML Schema [XMLSchema Part 1: Structures] extensibility frameworks. For example, this specification defines a way to annotate WSDL interfaces and operationswith categorization information that can be used to publish a Web service in a registry. The annotations on schema types canbe used during Web service discovery and composition. In addition, SAWSDL defines an annotation mechanismfor specifying the data mapping of XML Schema types to and from an ontology; such mappings could be used during invocation,particularly when mediation is required. To accomplish semantic annotation,SAWSDL defines extension attributes that can be applied both to WSDL elements and to XML Schema elements.

The semantic annotations reference a concept in an ontology or amapping document. The annotation mechanism is independent of theontology expression language and this specification requires and enforces noparticular ontology language. It is also independent of mappinglanguages and does not restrict the possible choices of suchlanguages.

The rest of the document describesthe SAWSDL extension attributes and provide examples as appropriate to illustrate their usage. For background and further examples,read theSemantic Annotations for WSDL and XML Schema — Usage Guide [SAWSDL Usage Guide].Additionally, the SAWSDL Working Group plans to keep itsWorking Group page up to date(at least during the lifetime of the WG) with links to known uses of SAWSDL,including SAWSDL-aware tools, and most importantly, specifications (from W3Cand outside) that define concrete semantic models for SAWSDL annotations, andhow annotations with these models can be used.

1.1 Terminology

The following are the basic definitions for the terminology used in this document.

Semantic Model
A semantic model is a set of machine-interpretable representations used to modelan area of knowledge or some part of the world, including software. Examples ofsuch models are ontologies that embody some community agreement, logic-basedrepresentations, etc. Depending upon the framework or language used formodelling, different terminologies exist for denoting the building blocks ofsemantic models.
Concept
A concept is an element of a semantic model. This specification makes no assumptions about the nature of concepts, except that they must be identifiable by URIs. A concept can for example be a classifier in some language, a predicate logic relation, the value of the property of an ontology instance, some object instance or set of related instances, an axiom, etc.
Semantic Annotation
A semantic annotation in a document is additional information that identifies or defines a concept in a semantic model in order to describe part of that document. In SAWSDL, semantic annotations are XML attributes added to a WSDL or associated XML Schema document, at the XML element they describe. Semantic annotations are of two kinds: explicit identifiers of concepts, or identifiers of mappings from WSDL to concepts or vice versa.
Semantics
Semantics in the scope of this specification refers to sets of concepts identified by annotations.

1.2 Notational Conventions

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

1.3 Namespaces

The XML namespace URIs [XML Namespaces]together with the prefixes as used by this specification are as follows:

PrefixNamespace name
sawsdlhttp://www.w3.org/ns/sawsdl
sawsdlrdfhttp://www.w3.org/ns/sawsdl#
wsdlhttp://www.w3.org/ns/wsdl
wsdl11http://schemas.xmlsoap.org/wsdl/
xshttp://www.w3.org/2001/XMLSchema

1.4 Example

In order to illustrate the concepts of SAWSDL, later sections will use a purchaseorder Web service interface. This imaginary Web service expects as input a customer account numberand a list of items to be ordered, each containing quantity information anda product identifier in form of a Universal Product Code (UPC). The service will return the status of the order, which canbe either reject, accept or pending. The WSDL including semantic annotations for this service is given below.

<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/ns/wsdl"  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:sawsdl="http://www.w3.org/ns/sawsdl">  <wsdl:types>    <xs:schema targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"      elementFormDefault="qualified">      <xs:element name="OrderRequest"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderRequest"          sawsdl:loweringSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/mapping/RDFOnt2Request.xml">        <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="UPC" type="xs:string" />        </xs:all>        <xs:attribute name="quantity" type="xs:integer" />      </xs:complexType>      <xs:element name="OrderResponse" type="confirmation" />      <xs:simpleType name="confirmation"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderConfirmation">        <xs:restriction base="xs:string">          <xs:enumeration value="Confirmed" />          <xs:enumeration value="Pending" />          <xs:enumeration value="Rejected" />        </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/ns/wsdl/in-out"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#RequestPurchaseOrder">      <wsdl:input element="OrderRequest" />      <wsdl:output element="OrderResponse" />    </wsdl:operation>  </wsdl:interface></wsdl:description>

The annotations in this example appear asmodelReference andloweringSchemaMappingattributes on schema and WSDL elements. EachmodelReference shown above identifies the concept in a semantic model that describes the element to which it isattached. For instance, theOrderRequest element is described by the "OrderRequest" concept in the ontology whose URI is"http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder." AloweringSchemaMapping is also attached to theOrderRequest elementto point to a mapping, in this case an XML document, which shows how the elements within theOrderRequest can be mapped fromsemantic data in the model.

Sections of this example annotated WSDL document will be used in subsequent parts of the specification where theseSAWSDL attributes are fully defined.

2. Annotation Mechanisms

This section introduces the two basic semantic annotation constructs that SAWSDL provides. Subsequent sections explain how they can be applied to WSDL and XML Schema documents.

Conceptually, WSDL 2.0 has the following components to representservice descriptions: Element Declaration, Type Definition, Interface,Binding and Service. Of these, the first three, namely ElementDeclaration, Type Definition and Interface deal with the abstractdefinition of a service while the latter two deal with serviceimplementation. This specification focuses on semantically annotatingthe abstract definition of a service to enable dynamic discovery,composition and invocation of services. This specification does notaddress the annotation of service implementations. It providesgeneric reference mechanisms that can be applied, for example, tothe aforementioned components. The references can point to conceptsdefined in semantic model or to mapping documents.

A summary of the extension attributes defined by SAWSDL is givenbelow:

SAWSDL allows multiple semantic annotations to be associated with WSDL elements.Both schema mappings and a model references can contain multiple pointers.Multiple schema mappings are interpreted as alternatives whereas multiple model referencesall apply. SAWSDL does not specify any other relationship between them.More details about this are presented in the sections that follow.

2.1 SAWSDL Model Reference

This section defines the extension attributemodelReference. Amodel reference may be used with every element within WSDL and XML schema. However, SAWSDLdefines its meaning only for wsdl:interface, wsdl:operation, wsdl:fault, xs:element,xs:complexType, xs:simpleType and xs:attribute.

The following XML schema excerpt defines themodelReferenceattribute.

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

The value of themodelReference attribute is a set of zero or more URIs, separated bywhitespaces, that identify concepts in a semantic model. Each URI is a pointer to a concept in a semantic model and isintended to provide semantic information about the WSDL or XML Schema component being annotated.

ThemodelReference attribute allows multiple annotations to be associated with a given WSDL or XML Schema component via a set of URIs.These URIs may identify concepts expressed in different semantic representation languages. When a component is annotated with amodelReference that includes multiple URIs, eachof them applies to the component, but no logical relationship between them is defined by this specification.

SAWSDL does not define any particular way to dereference modelreferences, i.e., it does not prescribe how a client processor can obtain thedocument in which the semantic model is defined. It is recommended that the URIused for pointing to a semantic concept resolve to a document containing itsdefinition. If the semantic model is expressed using XML, it could be placed directly within the WSDL document.

Sections3.1 through3.3 describe the use ofmodelReference for annotating WSDL documents, whereasSection 4.1 describes its use forannotating XML schema documents.

2.2 SAWSDL Schema Mapping

This section defines the extension attributesliftingSchemaMapping andloweringSchemaMapping.SAWSDL introduces schema mapping annotations to address post-discovery issues in using a Web service. Model referencescan be used to help determine if a service meets the requirements of a client, but there may still be mismatches between the semantic model andthe structure of the inputs and outputs. For example, a client may have a given name and last name among its data, and thesevalues need to be concatenated in the message to the Web service. A lowering schema mapping would take the client's semanticdata and turn it into XML, and in the process it would perform the necessary concatenation to produce the full name.In general, lifting schema mappingslift data from XML to a semanticmodel, whereas lowering schema mappingslower data from a semanticmodel into an XML structure.

In a more complex scenario, a client may use WSDL with semantic annotations to describe the service it expects. Again, if theXML structures expected by the client and by the service differ, schema mappings can translate the XML structures into thesemantic model where any mismatches can be understood and resolved.

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

The following schema excerpt defines theliftingSchemaMappingandloweringSchemaMapping attributes.

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

The usage of schema mapping attributes is further defined inSection 4.2.

2.3 Embedding Semantic Models

The semantic annotation mechanism defined by this specification does notrely on any particular semantic modeling language. It only requires that thesemantic concepts defined in it be identifiable via URI references. The URIstypically refer to concepts in a semantic model that is external to the WSDL document.However, the URIs can also refer to elements within the WSDL document ifsemantic information is included in the document via WSDL extension elementsas shown below on lines 3 to 14.

01   <wsdl:description … >0203     <rdf:RDF04       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"05       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"06       xmlns:owl="http://www.w3.org/2002/07/owl#"07       xml:base="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder">08       <owl:Class rdf:ID="OrderRequest"/>09       <owl:ObjectProperty rdf:ID="has_items">10         <rdfs:domain rdf:resource="#OrderRequest"/>11         <rdfs:range rdf:resource="#Item"/>12       </owl:ObjectProperty>13       <owl:Class rdf:ID="Item"/>14     </rdf:RDF>1516     <wsdl:types>17       <xs:element name="OrderRequest"18           sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderRequest">19           …20       </xs:element>21       …22     </wsdl:types>2324     <wsdl:interface name="Order">25       …26     </wsdl:interface>27   </wsdl:description>

SAWSDL does not define an additional container element for embeding semantic models, sinceWSDL already allows extension elements within awsdl:description element as illustrated above. In the example above thelanguage expressing the semantic model uses the RDF ID mechanism to define the resourcesreferenced, for instance line 8 defines "OrderRequest" in a semantic model.This identifier is then referenced usingmodelReference in line 18.

2.4 External Annotations (Non-Normative)

This specification defines annotations that are specified as attributes inthe annotated WSDL and XML Schema documents. There are scenarios, however,which call for annotating documents externally. For example, a WSDL documentcan import an external WSDL or XML Schema and wish to add annotations to it.Adding the annotations inside the imported document may not be possible dueto considerations like authority (the imported document comes from an externalorganization unwilling to add the annotations) or because the importeddocument is generated on the request from a dynamic source and the generatingprocess does not allow adding annotations.

Without creating new syntactic constructs for annotating external WSDL andXML Schema documents, we can suggest two approaches in which our semanticannotations can be applied externally: XSLT pre-processing, and using RDF.

XSLT Pre-processing: as both WSDL and XML Schema are XMLlanguages, it is natural to use XPath to identify the elements in theexternal document that should be annotated with SAWSDL (or other)annotations. Therefore, one can construct an XSLT stylesheet that mostlycopies its input to its output, only in specific places it would add theappropriate annotation attributes. The output of the XSLT stylesheet would bean annotated version of the external document, ready for being processed witha SAWSDL-aware processor.

Using RDF: the WSDL specification [WSDL2.0] containsAppendix C:IRI-References for WSDL 2.0 Components. This appendix defines unambiguousURIs for identifying WSDL components. TheXML Schema Working Group is workingon a component designators specification [XMLSchema:Component Designators] that will also provide URIs for XML Schemacomponents. SAWSDLSection 6 presents RDFproperties equivalent to the SAWSDL annotation mechanisms, therefore one canhave a WSDL document that imports an external WSDL or XML Schema document,and also contains an RDF graph embedded as an extension (see alsoSection 2.3 for an example of RDF embedded in a WSDLdocument). The embedded RDF graph will provide all the annotations forthe components imported from the external document.

There may be other mechanisms and we do not intend to mandate anyparticular way of capturing external annotations. Different mechanisms willhave different properties, for instance XSLT pre-processing for addingannotations may be fragile in face of changing input (especially if relyingon concrete element positions); this fragility may be mitigated somewhat inthe RDF approach as it identifies the components, independent of where in theimported document they are defined.

3. Annotating WSDL Documents

In terms of the WSDL 2.0 component model, a model reference is a newproperty. In particular, when used on an element that represents a WSDL2.0 Component (e.g. awsdl:interface element representinganInterfacecomponent, awsdl:operation element representing anInterfaceOperation component, a top-levelxs:elementrepresenting anElementDeclaration component, etc.), themodelReference extensionattribute with a non-empty value introduces an OPTIONAL property{model reference} whose value is the set of URIs taken fromthe value of the attribute. An empty model reference or no modelreference are both reflected by the absence of the {model reference}property on the given component.

ThemodelReference annotation on xs:element, xs:complexType, xs:simpleType and xs:attribute defines the semantics of theinput or output data of WSDL operations, as shown inSection 4.AmodelReference on a WSDL operation or fault gives semanticinformation about that operation, while amodelReference on a WSDL interface provides a classification or other semanticdescriptions of the interface.

3.1 Annotating Interfaces with Model Reference

This section defines how amodelReference can be used toannotateinterface elements, to categorize them according to some model,to specify behavioral aspects or other semantic definitions.AmodelReference on aWSDLinterface element provides a reference to a concept or concepts in a semantic model that describethe Interface. The example below illustrates a categorization annotation on aninterface element.

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

The modelReference in this example points to a category concept "electronics" in some semantic model. For taxonomies whose elements are not identifiable with a URI, themodelReference can point to a simple semantic model that contains the taxonomy referenceinformation. This specification does not define such a categorization semantic model, but includes a non-normative example inAppendix C. SAWSDL does not constrain the form of the semantic model for categorization or that of any other semanticmodel specified in amodelReference on an interface.

When an interface extends one or more interfaces, the model references of the extended interfacesdo not propagate to the new interface. In addition, annotationsapplied to other WSDL components, such as operations, are separate. SAWSDL defines no relationship between annotations.

In the WSDL component model, a non-empty modelReference on a WSDL interface is represented as {modelreference} property of the Interface component; the case of an emptymodelReference or no modelReference is represented with anInterface component that does not have a {model reference} property.

Appendix C further describes the use of categorization annotations including examples that show how to usethe taxonomies supported by Universal Description, Discovery and Integration (UDDI) to categorize an interface.

3.2 Annotating Operations with Model Reference

The example below shows the annotated WSDL with amodelReferenceattribute to annotate theoperation element. The annotation of theoperation element carries a referenceto a concept in a semantic model that provides a high level description of theoperation, specifies its behavioral aspects or includes other semantic definitions. In the purchase order example, theorder operation can beannotated using a class that represents a purchase order request operation. The annotation of theoperation using themodelReference attribute is shown below.

…<wsdl:operation name="order" pattern="http://www.w3.org/ns/wsdl/in-out"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#RequestPurchaseOrder">  <wsdl:input element="OrderRequest"/>  <wsdl:output element="OrderResponse"/></wsdl:operation>…

Although inputs and outputsprovide one way of capturing the semantics of an operation, a simplesemantic annotation indicating the intended behavior of a given operation as averb concept may be useful at certain times. During service discovery, this verbprovides a coarse indication of whether this service is a match for a givenrequest. This can act as way to reduce the number of services whose input and output must be checked.

Operations can also be annotated with category references. These are separate from any categorizations applied to other WSDLcomponents (e.g. the interface holding the operation) and SAWSDL defines no relationships between categorizations applied to them.

In the WSDL component model, a non-empty modelReference on a WSDL interface operation is representedas {model reference} property of the Interface Operation component; thecase of an empty modelReference or no modelReference at all isrepresented with an Interface Operation component that does not have a{model reference} property.

3.3 Annotating Faults with Model Reference

The annotation of thefault element carries a referenceto a concept in a semantic model that provides a high level description of thefault and can include other semantic definitions. Thefault annotation does not describe the fault message, which should be annotated in the XML schema.The example below illustrates how to use themodelReferenceattribute to annotate thefault element. A fault that could be associated withorder operation can beannotated using a class that represents the failure of a purchase order request operation due to the unavailability of the item.The annotation of afault using themodelReference attribute is shown below.

…<wsdl:interface name="Order">  <wsdl:fault name="ItemUnavailableFault" element="AvailabilityInformation"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#ItemUnavailable"/>  …</wsdl:interface>

This example identifies the "ItemUnavailable" concept in the referenced semantic model as a description of the fault "itemUnavailableFault."

In the WSDL component model a non-empty modelReference on a WSDL interface fault is represented as{model reference} property of the Interface Fault component; the case ofan empty modelReference or no modelReference at all is represented withan Interface Fault component that does not have a {model reference}property.

4. Annotating XML Schema Documents

In order to annotate XML schema documents, SAWSDL provides two constructs:model reference and schema mapping. The former provides a generic link froman XML structure to a semantic model. XML Schema model reference annotations can be used, for example, to help determineif a service meets the requirements of a client. The schema mapping addresses post-discoveryissues when using Web services, such as how to overcome structural mismatches between the semantic model and the service inputs and outputs.

4.1 Annotating XML Schema Documents with Model Reference

Model references defineadditional semantics for the annotated XML Schema components.

4.1.1 Annotating Simple Types with Model Reference

Simple types can be annotated by including amodelReference attribute on thexs:simpleType element. An example is shown belowfor the output of theorder operation in the example WSDL document presented inSection 1.4.

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

In this example, any element or attribute whose type isConfirmation is described by theOrderConfirmation concept inthe referenced semantic model.

In the XML Schema component model, a non-empty modelReference on a top-level simple type isrepresented as {model reference} property of the XML SchemaSimple Type Definition Schemacomponent; the case of an empty modelReference or no modelReference atall is represented with an XML Schema Simple Type Definition component that does not have a{model reference} property. {model reference} properties are propagated from a simple type definition schema component to allattribute and element declaration schema components that are defined with that simple type.

In the WSDL component model, a non-empty modelReference on a top-level simple type used in WSDL isrepresented as {model reference} property of the WSDLTypeDefinition component; the case of an empty modelReference or no modelReference atall is represented with a Type Definition component that does not have a{model reference} property. {model reference} properties are propagated from a type definition WSDL component to all element declaration WSDL components that are defined with that type.

4.1.2 Annotating Complex Types with Model Reference

There are two principal techniques for annotating complex types which can besummarized as follows:

In bottom level annotation, all the member elements and attributes in a complex typecan be annotated. In some cases, the members of a complex type will correspond withthe concepts in a semantic model. To accommodate this case, the member elements and attributes can be annotatedby adding a modelReference attribute to the relevant schema element or attribute.

…<xs:complexType>  <xs:sequence minOccurs="1" maxOccurs="unbounded">    <xs:element name="quantity" type="xs:integer"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#Quantity"/>    <xs:element name="UPC" type="xs:string"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#ProductCode"/>  </xs:sequence></xs:complexType>…

In thissequence, each bottom levelelement has an annotation since the semantic model contains concepts,namely "Quantity" and "ProductCode", that describe each of the components of the complex type.

Bottom level annotation uses the mechanisms described below in sections4.1.3 and4.1.4.

In top level annotation, the complex types themselves are annotated withmodel references. If multiple concepts describe the complex type, all of theirURIs can be included in the value of themodelReference attribute.Thissawsdl:modelReferenceattribute on a complex type annotates the type as a whole, but does notnecessarily make any specific statements about the elements or attributes within the complex type.

…<xs:complexTypesawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderRequest">  <xs:sequence minOccurs="1" maxOccurs="unbounded">    <xs:element name="quantity" type="xs:integer"    <xs:element name="UPC" type="xs:string"  </xs:sequence></xs:complexType>…

Here, thecomplexType as a whole has been annotated with a reference to theOrderRequest concept.OrderRequest describes a concept that groups "quantity" and "UPC" elements that make up the complex type.

A complex type can be annotated at both the top and bottom level. These annotations are independent of each other.

In the XML schema component model, a non-empty modelReference on atop-level complex type is represented as {model reference} property ofthe XML SchemaComplex Type Definition component; the case of an empty modelReference or no modelReference atall is represented with a type definition schema component that does not have a{model reference} property. {model reference} properties are propagatedfrom a complex type definition schema component to allelement declaration schema components that are defined with that complex type.

In the WSDL component model, a non-empty modelReference on a top-levelcomplex type used in WSDL is represented as {model reference} property of the WSDLType Definitioncomponent; the case of an empty modelReference or no modelReference atall is represented with a Type Definition component that does not have a{model reference} property. {model reference} properties are propagatedfrom a type definition component to allelement declaration components that are defined with that type.

4.1.3 Annotating Elements with Model Reference

An element declaration can be annotated by including amodelReference on thexs:element element.An example of annotating a globalelement using themodelReferenceattribute is shown below.

…<xs:element name="OrderRequest"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#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>…

In this example, the annotation indicates that theelement "OrderRequest" is described by theconcept "OrderRequest" in the referenced semantic model. This example is very similar to a top-levelcomplexType annotationin that theelement being annotated is defined in terms of acomplexType and the annotation describes the "OrderRequest" asa whole.

A non-empty modelReference on a top-level element declaration used inWSDL is represented as {model reference} property of the WSDLElementDeclaration componentor the XML SchemaElementDeclaration Component; the case of an empty modelReference or nomodelReference at all is represented with a WSDL or XML Schema Element Declarationcomponent that does not have a {model reference} property.Due to model reference propagation, element declaration {model reference} property also contains the values of the{model reference} property from the type definition component referenced by this element declaration.

4.1.4 Annotating Attributes with Model Reference

An attribute can be annotated by including amodelReference on thexs:attribute element. If the quantity element in theexample above were defined as an attribute, amodelReference could be applied to it as follows.

…<xs:attribute name="quantity" type="xs:integer"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#Quantity"/>…

This annotation indicates that theattribute "quantity" is described by the concept "Quantity" in the referencedsemantic model.

In the XML schema component model, a non-empty modelReference on atop-level attribute declaration is represented as {model reference}property of the XML SchemaAttributeDeclaration Schema component; the case of an empty modelReference or nomodelReference at all is represented with an Attribute Declaration Schemacomponent that does not have a {model reference} property.Due to model reference propagation, attribute declaration {model reference} property also contains the values of the{model reference} property from the simple type definition component referenced by this attribute declaration.

4.2 Annotating XML Schema Documents with Schema Mapping

The extension attributesliftingSchemaMapping andloweringSchemaMappingare used to associate a schema type or element with a mapping to anontology. Schema mappings may be added to global typedefinitions (complex or simple) as well as to global element declarations. It ispossible to specify either lowering or lifting information as well as both togetheron the same schema element.

The value of theliftingSchemaMapping attribute is a set of zero or more URIs that referencemapping definitions. A mapping referenced by this attributedefines how an XML instance document conforming to the element or type definedin a schema is transformed to data that conforms to some semantic model, i.e. theoutput of the transformation process will be semantic data. The input to thetransformation is the XML element on whose declaration the mapping is located; or anelement valid according to the type on whose definition the mapping is located.

The value of theloweringSchemaMapping attribute is a set of zero or more URIs thatreference mapping definitions. A mapping referenced by this attributedefines how data in a semantic model is transformed to XML instance data. Theinput will be some semantic data. The output of the process will be the XMLelement on whose declaration the mapping is located; or an element validaccording to the type on whose definition the mapping is located.

When multiple URIs are specified on liftingSchemaMapping or loweringSchemaMapping, the schemamappings they reference are to be treated as alternatives, i.e. the client processor should choose one of them to apply, and the choice isfully at the client processor's discretion. For example, a mapping can be selected based on what mapping language theprocessor supports (different alternatives can use different languages), based on the availability of the mapping document,or by other preferences.

This specification provides a mechanism for associating optional schemamapping functions with a global type definition or global element declaration without anyrestriction on the choice of the mapping language. Just as SAWSDL does not prescribeany particular ontology representation language for specifying modelReferences, it does not prescribeany particular mapping representation language.

The following excerptfrom the purchase order example shows how XSLT can be used as a schema mappinglanguage to specify mapping from XSD elements to concepts in a semanticmodel. Detailed examples showing schema mapping using XSLT [XSLT] andSPARQL [SPARQL] are shown inAppendix A. Other languages,such as XQuery [XQuery], can also be used.

…<xs:element name="OrderResponse" type="confirmation" /><xs:simpleType name="confirmation"    sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderConfirmation"sawsdl:liftingSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/mapping/Response2Ont.xslt">  <xs:restriction base="xs:string">    <xs:enumeration value="Confirmed" />    <xs:enumeration value="Pending" />    <xs:enumeration value="Rejected" />  </xs:restriction></xs:simpleType>…

In order to perform the lifting of the data contained in an XML message, a clientprocessor retrieves the transformation from the URI given inthe value of sawsdl:liftingSchemaMapping (or from a cache or registry etc.) and applies it to thoseelements where the schema mapping was specified. In the example abovehttp://www.w3.org/2002/ws/sawsdl/spec/mapping/Response2Ont.xsltwill be applied toOrderResponse elements. A mapping specifiedon a global type definition can be applied to any element that is of that type.

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

The following example illustrates this rule. The elementorderItem has aliftingSchemaMapping. The complex type oforderItem is defined later in the schema and thecomplex type itself has a schema mapping. In such a case, theliftingSchemaMapping specified on the element overrides the onespecified on the complex type. This means that only the schema mapping that is given with the URIhttp://example.org/mapping/OrderItem2Ont.xslt applies to the element orderItem.The mapping http://example.org/mapping/ItemType2Ont.xslt does not apply. The reason forspecifying such an override rule is to allow an element to indicate the type mapping does not apply.

…<xs:element name="orderItem" type="itemType"sawsdl:liftingSchemaMapping="http://example.org/mapping/OrderItem2Ont.xslt"/><xs:complexType name="itemType"sawsdl:liftingSchemaMapping="http://example.org/mapping/ItemType2Ont.xslt">  <xs:sequence>      <xs:element ref="partDesc" />  </xs:sequence>  <xs:attribute name="ItemID" type="xs:string"/></xs:complexType>…

When used on an element that represents a WSDL 2.0 Component (atop-levelxs:element element representing anElementDeclaration component, anxs:complexType element or anxs:simpleType element representing aTypeDefinition component), the loweringSchemaMapping andliftingSchemaMapping extension attributes introduce the properties{lowering schema mapping} and {lifting schema mapping}.

When used on an element that represents an XML SchemaComponent(a top-level Element Declaration Schema component element, a Complex Type Definition Schema component or aSimple Type Definition Schema component), the loweringSchemaMapping andliftingSchemaMapping extension attributes introduce properties{lowering schema mapping} and {lifting schema mapping}.

The value of either of these properties is a (possibly empty) set of URIs taken fromthe value of the respective attribute. If an element declaration does nothave a liftingSchemaMapping (or loweringSchemaMapping) attribute but its typedefinition does, the element declaration component acquires the {liftingschema mapping} (or {lowering schema mapping}) property from the typedefinition component.

5. WSDL 1.1 Support

The mechanism for semantic annotation described in this specification canalso be applied to WSDL 1.1 [WSDL 1.1] Webservice descriptions. All the XML attributes defined in thisspecification apply without modification to the WSDL 1.1 descriptions. However,in some cases they are applied to different elements in the WSDL documentstructure and a new element is introduced to facilitate operation annotations.

5.1 SAWSDL attrExtensions Element

TheWSDL 1.1 schema does not allow extension attributes on theoperation element, so this specification introduces a newextension element,attrExtensions, to support semantic annotation of WSDL 1.1 operations. The following XMLSchema excerpt defines theattrExtensions element.

…<xs:element name="attrExtensions">  <xs:complexType>    <xs:anyAttribute namespace="##any" processContents="lax" />  </xs:complexType></xs:element>…

TheattrExtensions element provides a general mechanism for adding extension attributes where attribute extensibilityis not allowed, but element extensibility is allowed.It SHOULD NOT be used where attribute extensibility is allowed.For SAWSDL it is used to add the sawsdl:modelReference attribute inWSDL 1.1 operations. It MUST NOT be used for SAWSDL annotations in WSDL 2.0. Attributes with the same namespacename and local name MUST NOT appear both on the attrExtensions element and on its parent element.

5.2 WSDL 1.1 Annotations

portTypes

AportType corresponds to a WSDL 2.0interface and is annotated in the same way.

Input and Output

Annotation of XML Schema types withmodelReference,liftingSchemaMapping orloweringSchemaMapping can be accomplished using the approachdescribed for annotating these elements in WSDL 2.0. In addition, aliftingSchemaMapping,loweringSchemaMappingormodelReference attribute may be added to apart element(under amessage element) to specify an input or output annotation thatapplies to the entire message part. Message parts are referenced from theportTypestructure in WSDL 1.1 that generally corresponds to the WSDL 2.0interfacestructure.

Faults

In WSDL 1.1, faults are specified as messages within operations.In contrast to WSDL 2.0, a WSDL 1.1 fault is defined identicallyto an input or output, i.e. as afault subelement of theoperation element. Annotation of the meaning of the fault needs to bedone on thefault element in each operation where it occurs.

Operations

Because operation in WSDL 1.1 does not allow attribute extensibility, anoperation is annotated by adding anattrExtensions element as a child of theoperation element.ThemodelReference attribute ofattrExtensions specifies the operation annotation. An example of such anannotation is shown below.

…<wsdl11:operation name="order">    <sawsdl:attrExtensions        sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#RequestPurchaseOrder">    <wsdl11:input message="OrderRequestMessage"/>    <wsdl11:output message="OrderResponseMessage"/></wsdl11:operation>…

5.3 Example in WSDL 1.1

The same example as shown inSection 1.4 is shown here in its WSDL 1.1form. An important difference is the way messages are defined:

The other difference is the inclusion ofattrExtensions to annotate the operation.

<wsdl11:definitions  targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"  xmlns="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"  xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/"  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:sawsdl="http://www.w3.org/ns/sawsdl"  name="OrderService">  <wsdl11:types>    <xs:schema      targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"      xmlns="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/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/Response2Ont.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="UPC" type="xs:string" />        </xs:all>        <xs:attribute name="quantity" type="xs:integer" />      </xs:complexType>      <xs:simpleType name="Confirmation">        <xs:restriction base="xs:string">          <xs:enumeration value="Confirmed"/>          <xs:enumeration value="Pending"/>          <xs:enumeration value="Rejected"/>        </xs:restriction>      </xs:simpleType>    </xs:schema>  </wsdl11:types>  <wsdl11:message name="OrderRequestMessage">    <wsdl11:part name="OrderRequest" element="OrderRequest" />  </wsdl11:message>  <wsdl11:message name="OrderResponseMessage">    <wsdl11:part name="OrderResponse" type="Confirmation"sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#OrderConfirmation"/>  </wsdl11:message>  <wsdl11:portType name="Order">    <wsdl11:operation name="order">      <sawsdl:attrExtensionssawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#RequestPurchaseOrder"/>      <wsdl11:input message="OrderRequestMessage" />      <wsdl11:output message="OrderResponseMessage" />    </wsdl11:operation>  </wsdl11:portType></wsdl11:definitions>

This example is available as a separate file athttp://www.w3.org/2002/ws/sawsdl/spec/wsdl/order11.

6. Mapping SAWSDL into RDF

This section describes how the WSDL extensions introduced in this documentare mapped into an RDF form compatible with the WSDL 2.0 RDF Mapping [WSDL 2.0 RDF]. This specification introduces theproperties {model reference}, {lifting schema mapping} and {lowering schemamapping}, and this section describes the equivalent RDF properties. However,since the WSDL 2.0 RDF mapping does not provide an RDF form for theelement declaration and type definition components, the schema mappingproperties (i.e. {lifting schema mapping} and {lowering schema mapping})potentially present in SAWSDL documents, are currently not represented in theRDF form of WSDL documents. Only {model reference} properties are mapped.

The {model reference} property on any WSDL component(esp. Interface, Interface Operation, and Interface Fault components, as described earlier inthis document) is represented in the RDF form using a property with theidentifiersawsdlrdf:modelReference (the full URI of the property is then"http://www.w3.org/ns/sawsdl#modelReference"), as shown intable 6-1. As the value of {model reference} is a set of URIs,an RDF triple is introduced for each of the URIs.

Table 6-1. Mapping modelReference property to RDF
PropertyRDF Form
 (componentId of the parent component generated perIRI-References for WSDL 2.0 Components)
{model reference}(for each URI <uri> in the value of {model reference})
<componentId> sawsdlrdf:modelReference <uri> .

Similarly, the {lifting schema mapping} and {lowering schema mapping}properties can be represented in RDF (within a hypothetical RDF mapping ofXML Schema) using the properties sawsdlrdf:liftingSchemaMapping andsawsdlrdf:loweringSchemaMapping (the full URIs of the properties are then"http://www.w3.org/ns/sawsdl#liftingSchemaMapping" and"http://www.w3.org/ns/sawsdl#loweringSchemaMapping"). As the values of both{lifting schema mapping} and {lowering schema mapping} aresets of URIs, appropriate RDF triples are introduced for each of the URIs.

The following listing defines the three properties in RDF:

 <http://www.w3.org/ns/sawsdl#modelReference> rdf:type rdf:Property . <http://www.w3.org/ns/sawsdl#liftingSchemaMapping> rdf:type rdf:Property . <http://www.w3.org/ns/sawsdl#loweringSchemaMapping> rdf:type rdf:Property .

7. References

7.1 Normative References

[RFC2119]
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.
[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.
[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, 23 May 2007. 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/2007/PR-wsdl20-20070523. Thelatest 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. Thelatest version of Namespaces in XML is available at http://www.w3.org/TR/REC-xml-names.
[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. Thelatest version of XML Schema Part 1 is available at http://www.w3.org/TR/xmlschema-1.

7.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.
[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/.
[SAWSDL Usage Guide]
Semantic Annotations for WSDL and XML Schema - Usage Guide, Rama Akkiraju and Brahmananda Sapkota, Editors. W3C Working Group Note, 28 August 2007, http://www.w3.org/TR/2007/NOTE-sawsdl-guide-20070828/.
Latest version available at http://www.w3.org/TR/sawsdl-guide/.
[SPARQL]
SPARQL Query Language for RDF, Eric Prud'hommeaux and Andy Seaborne, Editors. World Wide Web Consortium, 14 June 2007. This version is http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/. Thelatest version is available at http://www.w3.org/TR/rdf-sparql-query/.
[UDDI]
UDDI Version 3.0.2, Luc Clement, Andrew Hately, Claus von Riegen, and Tony Rogers, Editors. Organization for the Advancement of Structured Information Standards (OASIS). Available at http://uddi.org/pubs/uddi_v3.htm.
[UNSPSC]
The United Nations Standard Products and Services Code. United Nations Development Programme. Available at http://www.unspsc.org/.
[WSDL 2.0 RDF]
Web Services Description Language (WSDL) Version 2.0: RDF Mapping, J. Kopecky, B. Parsia, Editors. World Wide Web Consortium, 23 May 2007. This version of the "Web Services Description Language (WSDL) Version 2.0: RDF Mapping" Specification is available at http://www.w3.org/TR/2007/WD-wsdl20-rdf-20070523/. Thelatest version of "Web Services Description Language (WSDL) Version 2.0: RDF Mapping" is available at http://www.w3.org/TR/wsdl20-rdf/.
[XMLSchema: Component Designators]
XML Schema: Component Designator, M. Holstege and A.S. Vedamuth, Editors. World Wide Web Consortium, 29 March 2005. This version of the XML Schema: Component Designators Working Draft is http://www.w3.org/TR/2005/WD-xmlschema-ref-20050329/. Thelatest version of XML Schema: Component Designators is available at http://www.w3.org/TR/xmlschema-ref/.
[XQuery]
XQuery 1.0: An XML Query Language, Scott Boag, Don Chamberlin, Mary F. Fernández, Daniela Florescu, Jonathan Robie, Jérôme Siméon, Editors. World Wide Web Consortium, 23 January 2007. This version is http://www.w3.org/TR/2007/REC-xquery-20070123/. Thelatest version is available at http://www.w3.org/TR/xquery/.
[XSLT]
XSL Transformations (XSLT) Version 2.0, Michael Kay, Editor. World Wide Web Consortium, 23 January 2007. This version is http://www.w3.org/TR/2007/REC-xslt20-20070123/. Thelatest version is available at http://www.w3.org/TR/xslt20/.

A. An Example (Non-Normative)

In this appendix we present the accompanyingsemantic descriptions and mappings to the example WSDL documentpresented inSection 1.4. We alsoprovide examples on what the documents, pointed to by the schema mapping,might look like.

The files used in this example are:

The following subsections illustrate the two directions of the schema mapping:lifting and lowering. Lifting schema mapping transforms XML data into instances of asemantic model, and lowering schema mapping does the opposite, it transformssemantic model instances into XML data.

Since SAWSDL does not constrain the language of the semantic model northe mapping language, the following can only be viewed as non-normative examples.In our setting we have chosen to base the examples on languages standardized by the W3C.For example, an RDF-based semantic Web service client may wish to invoke anoperation that it earlier discovered. The client would have some RDF datathat it intends to pass to the operation as the request XML message, loweringfrom RDF to XML. When the service replies with the response XML message, theclient will need to lift the data back to RDF in order to process it.When using other languages to express the semantic model, mappingsmay be expressed using those languages.

A.1 Specifying Lowering Schema Mapping

When expressing the semantic model using RDF/XML, lowering schema mappingsare potentially complex, because of the flexible nature ofRDF/XML. RDF/XML is an XML serialization of the graph-of-triples model of RDFdata. In essence, RDF data is always an unordered set of triples consistingof a subject, a predicate and an object. The XML serialization puts thevalues of these parts of the triples alternatively into namespace-qualifiedXML element and attribute names, and into character values of elements orattributes. Languages like XSLT or XQuery rely on XPath to find and selectdata in XML structures. XPath is geared towards more fixed XML structures, soit takes different XPath expressions for instance to select predicates, whichcan be encoded as elements or attributes in many places within an RDF/XMLdocument. XPath (and by extension XSLT and XQuery) does not provide means ofignoring the purely syntactical differences in the various possible RDF/XMLserializations of otherwise equal RDF graphs, therefore all alternatives haveto be accounted for in the XSLT stylesheet or XQuery query.

Practice has shown that it is a very hard task to create XSLT or XQuerytransformations that take arbitrary RDF/XML as input. Instead, we can imaginethat lowering schema mappings (for RDF-based semantic models) will use RDFquery languages either to construct the final XML, or to construct a stricterform of XML that can then be input to XSLT or XQuery to produce the final XMLstructure. In our examples, we combine SPARQL to query the RDF data andproduce an XML table of variable bindings, and XSLT that transforms this XMLtable into the required XML.

To conclude, if we use RDF as the base for our semantic model, we can easilyuse XML transformation technologies like XSLT or XQuery for lifting schemamappings, but for lowering schema mappings we use the XMLtechnologies combined with an RDF query language like SPARQL to preprocessthe RDF data.

In the following we present an XML file that captures the informationnecessary to perform the mapping from an RDF graph to XML data requiredby the Web service. Thelowering element in this file containstwo child elements. The first elementsparqlQuery includes a SPARQL query to extractthe data in form of a variable binding table; the second element is the root elementof an XSLT transformation.

<lowering>  <sparqlQuery>    PREFIX po: <http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#>    SELECT ?qty ?UPC ?CustomerNo    WHERE {      ?order po:hasCustomer ?customer .        ?customer po:hasCustomerID ?id .          ?id po:hasLexicalRespresentation ?CustomerNo .      ?order po:hasLineItems ?item .        ?item po:hasQuantity ?qtyClass .          ?qtyClass po:hasAmount ?qty .        ?item po:hasProduct ?product .          ?product po:hasProductCode ?code .            ?code po:hasLexicalRespresentation ?UPC }  </sparqlQuery>  <xsl:transform version="2.0"    xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    xmlns:sp="http://www.w3.org/2005/sparql-results#">    <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes" />    <xsl:template match="/sp:sparql">      <po:OrderRequest>        <po:customerNo>          <xsl:value-of            select="sp:results/sp:result[position()=1]/sp:binding[@name='CustomerNo']/sp:literal" />        </po:customerNo>        <xsl:apply-templates select="sp:results/sp:result" />      </po:OrderRequest>    </xsl:template>    <xsl:template match="sp:result">      <po:orderItem>        <xsl:attribute name="quantity">          <xsl:value-of select="sp:binding[@name='qty']/sp:literal" />        </xsl:attribute>        <po:UPC>          <xsl:value-of select="sp:binding[@name='UPC']/sp:literal" />        </po:UPC>      </po:orderItem>    </xsl:template>  </xsl:transform></lowering>

We assume that some agent has semantic data as an RDF graph that isintended to be used for a Web service invocation. Such data could look likein the listing below, which shows an instance of the OrderRequest conceptaccording to the purchase order ontology introduced earlier.

<!DOCTYPE rdf:RDF[    <!ENTITY xs  "http://www.w3.org/2001/XMLSchema#" >]> <rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:owl="http://www.w3.org/2002/07/owl#"  xmlns="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#"  xml:base="http://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#">  <owl:Ontology />  <OrderRequest>    <hasLineItems>      <LineItem>        <hasProduct>          <Product>            <hasProductCode>              <UPCCode>                <hasLexicalRespresentation>348290187318</hasLexicalRespresentation>              </UPCCode>            </hasProductCode>          </Product>        </hasProduct>        <hasQuantity rdf:datatype="&xs;float">12</hasQuantity>      </LineItem>    </hasLineItems>    <hasLineItems>      <LineItem>        <hasProduct>          <Product>            <hasProductCode>              <UPCCode>                <hasLexicalRespresentation>998212387318</hasLexicalRespresentation>              </UPCCode>            </hasProductCode>          </Product>        </hasProduct>        <hasQuantity>          <Quantity>            <hasAmount rdf:datatype="&xs;float">4</hasAmount>            <hasUnit rdf:resource="#Piece"/>          </Quantity>        </hasQuantity>      </LineItem>    </hasLineItems>    <hasCustomer>      <Customer>        <hasCustomerID>          <CustomerID>            <hasLexicalRespresentation>007</hasLexicalRespresentation>          </CustomerID>        </hasCustomerID>      </Customer>    </hasCustomer>  </OrderRequest></rdf:RDF>

When the SPARQL is applied to the RDF graph above, the following XML will be generatedas query answer.

<sparqlxmlns="http://www.w3.org/2005/sparql-results#">  <head>    <variable name="qty" />    <variable name="UPC" />    <variable name="CustomerNo" />  </head>  <results>    <result>      <binding name="qty">        <literal>12</literal>      </binding>      <binding name="UPC">        <literal>348290187318</literal>      </binding>      <binding name="CustomerNo">        <literal>007</literal>      </binding>    </result>    <result>      <binding name="qty">        <literal>4</literal>      </binding>      <binding name="UPC">        <literal>998212387318</literal>      </binding>      <binding name="CustomerNo">        <literal>007</literal>      </binding>    </result>  </results></sparql>

When the XSLT is applied to the output of the SPARQL query,the following XML data is generated. This data corresponds to the elementthat has been annotated with theloweringSchemaMapping and can be used by someagent to invoke the purchase order Web service.

<ex:OrderRequestxmlns:POOntology="http://example.org/ontologies/purchaseorder#"  xmlns:sp="http://www.w3.org/2005/sparql-results#"  xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"  xmlns:ex="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order# ../wsdl/SchemaOnly.xsd ">  <ex:customerNo>007</ex:customerNo>  <ex:orderItem quantity="12">    <ex:UPC>348290187318</ex:UPC>  </ex:orderItem>  <ex:orderItem quantity="4">    <ex:UPC>998212387318</ex:UPC>  </ex:orderItem></ex:OrderRequest>

A.2 Specifying Lifting Schema Mapping

Our examples show lifting schema mappings using XSLT and XQuery, either onewill take the XML data (e.g. coming from the Web service) and produce RDFdata in the RDF/XML syntax. This is rather straightforward.The mapping specification that is referenced using aliftingSchemaMappingtakes as input XML data and produces semantic data as output.Within the purchase order example we have annotated the responsetype, i.e.OrderResponse. The XML data corresponding tothe type can be transformed using XSLT or XQuery in order to obtaindata processable by a semantic agent.

A possible response of the purchase order Web service is thefollowing XML data.

<OrderResponse  xmlns="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#"  >Confirmed</OrderResponse>

The XSLT specification below describes how to convert the XML datato an RDF graph corresponding to the purchase ontology.

<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://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#">  <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes" />  <xsl:template match="/">    <rdf:RDF>      <POOntology:OrderConfirmation>        <hasStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#string">          <xsl:value-of select="po:OrderResponse" />        </hasStatus>      </POOntology:OrderConfirmation>    </rdf:RDF>  </xsl:template></xsl:transform>

When the above XSLT sample is applied to the example response the following RDF instancewill be produced as output.

<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://www.w3.org/2002/ws/sawsdl/spec/ontology/purchaseorder#">   <POOntology:OrderConfirmation>      <hasStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Confirmed</hasStatus>   </POOntology:OrderConfirmation></rdf:RDF>

Equally the mapping can be specified by using XQuery. If both mappings arepresent, a processor can choose the one it is designed to interpret.

xquery version "1.0";declare namespace po="http://www.w3.org/2002/ws/sawsdl/spec/wsdl/order#" ;declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";declare namespace owl="http://www.w3.org/2002/07/owl#" ;<rdf:RDF>  <po:OrderConfirmation>    <po:hasStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#string">{ fn:string(/) }</po:hasStatus>  </po:OrderConfirmation></rdf:RDF>

B. Categorization Examples (Non-Normative)

One purpose for annotating services at the interface level is to help enabledynamic discovery. This is possible when services are published, catalogued andannotated with semantics. ThemodelReference mechanism adds categorizationinformation to interfaces which could be used while publishing services inregistries such as UDDI [UDDI]. Users can choose any categorization of their choice,such as NAICS [NAICS], UNSPSC [UNSPSC]and GICS [GICS]. This aids in service discovery by narrowingthe range of candidate services. The categorization can be used as input whenthe service is published in a UDDI registry since taxonomies supported by UDDI can be specified via asemantic model.

Service categorization is also aimed at supporting specialized taxonomies ofmiddleware or utility services such as mediators. The categorizationmodelReference is used to ensurethat there is basic and high-level categorization information about a service.

In this example, the interface categorizationmodelReference fromSection 3.1 points to an RDF instancethat gives two pieces of information: the taxonomy value (category code) ofthe category and the URI of the taxonomy.

<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="http://example.org/categorization/products/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>

Using this simple model, it is possible to create categorizationsusing the registered taxonomies in UDDI. This information can then bereused when the service is published in the UDDI registry. In thefollowing example we use the NAICS taxonomy identifier registered in UDDI, asopposed to identifying the taxonomy with the URI of the NAICS Association Website, as shown above.

<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="http://example.org/categorization/products/electronics"    if:hasValue="443112"    if:usesTaxonomy="uddi:uddi.org:ubr:categorization:naics:2002"/></rdf:RDF>

When publishing in UDDI V3, the category bag created to classify the service would be built from this information. This is the UDDIcategoryBag structure that would derive from this categorization.

<categoryBag>         <keyedReference         tModelKey="uddi:uddi.org:ubr:categorization:naics:2002"         keyName="Electronics"         keyValue="443112"/></categoryBag>

The other UDDI taxonomies would also be referenced via their registered URIs.

C. XML Schema for Semantic Annotations for WSDL and XML Schema

The SAWSDL schema is also available as a separate file atsawsdl.xsd.

<xs:schema  targetNamespace="http://www.w3.org/ns/sawsdl"  xmlns="http://www.w3.org/ns/sawsdl"  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:wsdl="http://www.w3.org/ns/wsdl">  <xs:simpleType name="listOfAnyURI">    <xs:list itemType="xs:anyURI"/>  </xs:simpleType>  <xs:attribute name="modelReference" type="listOfAnyURI" />  <xs:attribute name="liftingSchemaMapping" type="listOfAnyURI" />  <xs:attribute name="loweringSchemaMapping" type="listOfAnyURI" />  <xs:element name="attrExtensions">    <xs:complexType>      <xs:annotation>        <xs:documentation>This element is for use in WSDL 1.1 only. It does not apply to WSDL 2.0 documents.  Use in        WSDL 2.0 documents is invalid.</xs:documentation>      </xs:annotation>      <xs:anyAttribute namespace="##any" processContents="lax" />    </xs:complexType>  </xs:element></xs:schema>

D. Acknowledgements (Non-Normative)

This document is the work of theW3C Semantic Annotations for WebService Description Language Working Group.

Members of the Working Group are (at the time of writing, and inalphabetical 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.), Mathias Kleiner (ILOG, S.A.), Jacek Kopecký (DERI Innsbruckat the Leopold-Franzens-Universität Innsbruck, Austria), Holger Lausen(DERI Innsbruck at the Leopold-Franzens-Universität Innsbruck, Austria), Peter Matthews (CA), Antony Miguel (Scapa Technologies Limited), John Miller(University of Georgia Research Foundation, Inc (UGARF))Carlos Pedrinaci (The Open University),Eric Prud'hommeaux (W3C), Brahmananda Sapkota (DERI Galway at the NationalUniversity of Ireland, Galway, Ireland), Amit Sheth (Wright State University), Claudio Venezia (Telecom Italia SpA),Tomas Vitvar (DERI Galway at the National University of Ireland, Galway, Ireland).


[8]ページ先頭

©2009-2025 Movatter.jp