You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2515 lines
126 KiB
2515 lines
126 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD
|
|
XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
<title>Semantic Annotations for WSDL and XML Schema — Usage Guide</title>
|
|
<style type="text/css">
|
|
/*<![CDATA[*/ pre {
|
|
background:#D5DEE3;
|
|
margin-left: 0!important;
|
|
} div.body dt {
|
|
font-weight: normal;
|
|
padding-top: 1ex;
|
|
} /*
|
|
*/
|
|
]]>
|
|
</style>
|
|
<link rel="stylesheet" type="text/css"
|
|
href="http://www.w3.org/StyleSheets/TR/W3C-WG-NOTE.css" />
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="head">
|
|
<p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72"/></a></p>
|
|
|
|
<h1><a id="title" name="title">Semantic Annotations for WSDL and XML Schema
|
|
— Usage Guide</a></h1>
|
|
|
|
<h2><a id="w3c-doctype" name="w3c-doctype">W3C Working Group Note 28 August 2007</a></h2>
|
|
|
|
<dl>
|
|
<dt>This version:</dt>
|
|
<dd><a
|
|
href="http://www.w3.org/TR/2007/NOTE-sawsdl-guide-20070828/">http://www.w3.org/TR/2007/NOTE-sawsdl-guide-20070828/</a></dd>
|
|
<dt>Latest version:</dt>
|
|
<dd><a
|
|
href="http://www.w3.org/TR/sawsdl-guide/">http://www.w3.org/TR/sawsdl-guide/</a></dd>
|
|
<dt>Previous version:</dt>
|
|
<dd><a href="http://www.w3.org/TR/2007/WD-sawsdl-guide-20070126/">http://www.w3.org/TR/2007/WD-sawsdl-guide-20070126/</a></dd>
|
|
<dt>Editors:</dt>
|
|
<dd>Rama Akkiraju, IBM Research, New York</dd>
|
|
<dd>Brahmananda Sapkota, DERI Galway</dd>
|
|
</dl>
|
|
|
|
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2007 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
|
|
</div>
|
|
<hr />
|
|
|
|
<h2><a name="abstract" id="abstract">Abstract</a></h2>
|
|
|
|
<p>Web services provide a standards-based foundation for exchanging
|
|
information between distributed software systems. The W3C Recommendation Web
|
|
Services Description Language (WSDL) specifies a standard way to describe the
|
|
interfaces of a Web Service at a syntactic level and how to invoke it. While
|
|
the syntactic descriptions provide information about the structure of input
|
|
and output messages of an interface and about how to invoke the service, semantics are
|
|
needed to describe what a Web service actual does. These semantics, when
|
|
expressed in formal languages, disambiguate the description of Web services
|
|
interfaces, paving the way for automatic discovery, composition and
|
|
integration of software components. WSDL does not explicitly provide
|
|
mechanisms to specify the semantics of a Web service. Semantic Annotations
|
|
for WSDL and XML Schema (SAWSDL) defines mechanisms by
|
|
which semantic annotations can be added to WSDL components. This usage guide is an accompanying document to SAWSDL specification. It
|
|
presents examples illustrating how to associate semantic annotations with a
|
|
Web service. These annotations could be used for classifying, discovering, matching,
|
|
composing, and invoking Web services.</p>
|
|
|
|
<p>Some of the examples illustrated in this document use RDF and OWL Web Ontology Language
|
|
for representing ontologies. Some knowledge of RDF and OWL is useful for
|
|
understanding this document, but not essential.</p>
|
|
|
|
<h2><a name="status" id="status">Status of this Document</a></h2>
|
|
|
|
<p><em>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 <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
|
|
|
|
<p>This is a <a href= "http://www.w3.org/2005/10/Process-20051014/tr.html#WGNote">W3C Working Group Note</a> of Semantic Annotations for WSDL and XML Schema — Usage Guide.
|
|
It has been produced by the <a href="http://www.w3.org/2002/ws/sawsdl/">Semantic Annotations for WSDL Working Group</a>, which is part of the <a href="http://www.w3.org/2002/ws/Activity">W3C Web Services Activity</a>. This Working group Note reflects the consensus of the Working Group, who produces it for the convenience of the community.</p>
|
|
|
|
<p>Please send comments about this document to the public <a href="mailto:public-ws-semann-comments@w3.org">public-ws-semann-comments@w3.org</a> mailing list (<a href="http://lists.w3.org/Archives/Public/public-ws-semann-comments/">public archive</a>).</p>
|
|
|
|
|
|
<p>A <a href="sawsdl-guide-diff.html">diff-marked version against the previous version of this document</a> is available.</p>
|
|
|
|
<p> This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a rel="disclosure" href="http://www.w3.org/2004/01/pp-impl/39001/status">public list of any patent disclosures</a> 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 <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
|
|
|
|
|
|
<p>Publication as a Working Group Note does not imply endorsement
|
|
by the W3C Membership. This is a draft document and may be updated, replaced or
|
|
obsoleted by other documents at any time. It is inappropriate to cite this
|
|
document as other than work in progress.</p>
|
|
|
|
<p>A list of current <a href="http://www.w3.org/TR/">W3C Recommendations and
|
|
other technical reports</a> can be found at <a href="http://www.w3.org/TR">http://www.w3.org/TR</a>.</p>
|
|
|
|
|
|
<div class="toc" id="toc">
|
|
<h2><a name="contents" id="contents">Table of Contents</a></h2>
|
|
<ul class="toc">
|
|
<li><a href="#introduction">1. Introduction</a>
|
|
<ul class="toc">
|
|
<li><a href="#namespace">1.1 Namespaces</a></li>
|
|
<li><a href="#examples">1.2 Running Examples</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#registries">2. Defining Annotations to Publish a Web
|
|
Service</a>
|
|
<ul class="toc">
|
|
<li><a href="#PredefinedTaxonomy">2.1 Adding Categorization Information
|
|
with Category URIs</a></li>
|
|
<li><a href="#UserdefinedTaxonomy">2.2 Adding Categorization
|
|
Information with Category Identifiers</a></li>
|
|
<li><a href="#UDDI">2.3 Using Categorization Annotations to Publish a
|
|
Service in a UDDI Registry</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#matchmaking">3. Defining Annotations for Use in Matching
|
|
and Composing Web services</a>
|
|
<ul class="toc">
|
|
<li><a href="#sharedOnt">3.1 Matching Web Service Interfaces using a
|
|
Shared Ontology</a></li>
|
|
<li><a href="#ontMediation">3.2 Matching Web Service Interfaces with
|
|
Ontology Mediation</a></li>
|
|
<li><a href="#composition">3.3 Composing Web Services - A Simple
|
|
Example</a></li>
|
|
<li><a href="#reasoning">3.4 Composing Web Services using Ontology
|
|
Reasoning</a></li>
|
|
<li><a href="#multiple">3.5 Matching Using Multiple Annotations</a></li>
|
|
<li><a href="#complex">3.6 Matching Using Complex Type
|
|
Annotations</a></li>
|
|
<li><a href="#conditions">3.7 Representing Conditions</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#invocation">4. Defining Schema Mappings to Enable Web Service
|
|
Invocation</a>
|
|
<ul class="toc">
|
|
<li><a href="#lifting">4.1 Lifting Schema Mapping</a></li>
|
|
<li><a href="#lowering">4.2 Lowering Schema Mapping</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#conclusions">5. Conclusions</a></li>
|
|
<li><a href="#references">6. References</a></li>
|
|
</ul>
|
|
|
|
<h3 id="Appendices"><a name="appendix" id="appendix">Appendices</a></h3>
|
|
<ul class="toc">
|
|
<li><a href="#conditionlistings">A. Condition Expression Listings</a></li>
|
|
<li><a href="#acknowledgements">B. Acknowledgements</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="body">
|
|
<h2 id="Introduction"><a name="introduction" id="introduction"></a>1.
|
|
Introduction</h2>
|
|
|
|
<p>As the set of available Web Services expands, it becomes increasingly
|
|
important to have automated tools to help identify services that match a
|
|
requester's requirements. Finding suitable Web services automatically depends
|
|
on the facilities available for service providers to describe the
|
|
capabilities of their services and for service requesters to describe their
|
|
requirements in an unambiguous and ideally, machine-interpretable form.
|
|
Adding semantics to represent the requirements and capabilities of Web
|
|
services is essential for achieving this clarity and
|
|
machine-interpretability.</p>
|
|
|
|
<p>Semantics play an important role in all aspects of the lifecycle of Web
|
|
services. During development, a service provider can explicate the intended
|
|
semantics by annotating the appropriate parts of the Web service with
|
|
concepts from a richer semantic model. Since semantic models provide
|
|
agreement on the terms and intended use of terms, and may provide formal and
|
|
informal definitions of the entities, there will be less ambiguity in the
|
|
intended semantics of the provider. During discovery, a service requestor can
|
|
describe the service requirements using terms from the semantic model.
|
|
Reasoning techniques can be used to find service descriptions that match the
|
|
request. During composition, these annotations can be used to aggregate the
|
|
functionality of multiple services to create useful service compositions.
|
|
Also, semantics based schema mappings can facilitate data transformations
|
|
from which mediation code can be generated to enable Web services invocation.
|
|
Therefore, once represented, semantics can be leveraged by tools to automate
|
|
service discovery, mediation, composition and monitoring.</p>
|
|
|
|
<p>The W3C Recommendation Web Services Description
|
|
Language (WSDL) specifies a standard way to describe the interfaces of a Web
|
|
Service at a syntactic level and how to invoke it. However, WSDL does not
|
|
explicitly provide mechanisms to specify the semantics of a Web service.
|
|
Semantic Annotations for WSDL and XML Schema (<a href="#SAWSDL">SAWSDL</a>)
|
|
defines mechanisms by which semantic annotations can be added to WSDL
|
|
components. This usage guide is an accompanying document to SAWSDL
|
|
specification. Many of the
|
|
concepts in SAWSDL are based on an earlier effort WSDL-S [<a
|
|
href="#WSDL-S">WSDL-S</a>], a W3C submission. It presents examples illustrating how to associate semantic
|
|
annotations with a Web service. These annotations could be used for classifying,
|
|
discovering, matching, composing, and invoking Web services.</p>
|
|
|
|
<p>The sections in this document are organized to show how to associate
|
|
semantic annotations with a WSDL document for use in service classification,
|
|
discovery, matching, composition and invocation in that order.</p>
|
|
|
|
<h3 id="Namespaces"><a name="namespace" id="namespace"></a>1.1 Namespaces</h3>
|
|
|
|
<p>The XML namespace name <!-- [<a href="#XMLNamespace">XMLNamespace</a>] -->
|
|
URIs <!-- [<a href="#URI">URI</a>] -->
|
|
used by this specification are as follows:</p>
|
|
|
|
<table border="1" cellpadding="5">
|
|
<thead>
|
|
<tr>
|
|
<th>Prefix</th>
|
|
<th>Namespace name</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>xs</td>
|
|
<td><a
|
|
href="http://www.w3.org/2001/XMLSchema#">http://www.w3.org/2001/XMLSchema#</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>xsd</td>
|
|
<td><a
|
|
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>sawsdl</td>
|
|
<td><a
|
|
href="http://www.w3.org/ns/sawsdl">http://www.w3.org/ns/sawsdl</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>wsdl</td>
|
|
<td><a
|
|
href="http://www.w3.org/ns/wsdl">http://www.w3.org/ns/wsdl</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>rdf</td>
|
|
<td><a
|
|
href="http://www.w3.org/1999/02/22-rdf-syntax-ns">http://www.w3.org/1999/02/22-rdf-syntax-ns</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>rdfs</td>
|
|
<td><a
|
|
href="http://www.w3.org/2000/01/rdf-schema">http://www.w3.org/2000/01/rdf-schema</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>owl</td>
|
|
<td><a
|
|
href="http://www.w3.org/2002/07/owl#">http://www.w3.org/2002/07/owl</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3><a name="examples" id="examples"></a>1.2 Running Examples</h3>
|
|
|
|
<p>Throughout this document, we use two Web services and several variations
|
|
on these Web services to illustrate how semantic annotations on a WSDL can be
|
|
used to do Web service interface matching and composition. One of these two
|
|
Web services is presented as a request of a desirable Web service while the
|
|
other is used as an advertisement or a service being offered by a service
|
|
provider. Some readers may be new to the concept of representing the
|
|
requirements of a client as a Web service - WSDL. While there may be
|
|
different ways of representing the requirements of a client, in this
|
|
document, for illustrative purposes we adopted the notion of a request WSDL
|
|
where the requirements of a client are modeled as a Web service - WSDL. The
|
|
inputs and outputs of this request WSDL codify the available inputs that a
|
|
client can provide and the expected outputs from a service respectively. We
|
|
then use the concepts of annotating a request similar to the way that one can
|
|
annotate a service provider's WSDL and illustrate how a request WSDL
|
|
interface can be matched, composed and transformed to invoke a service
|
|
provider's advertised service.</p>
|
|
|
|
<p>We present these two Web services here so as to allow the reader to get
|
|
familiarized with the examples used in the rest of the document. These are
|
|
'vanilla' WSDL files with no semantic annotations. In the following sections,
|
|
these WSDLs are shown with suitable semantic annotations that suit the
|
|
specific illustration. First a WSDL representation of a request WSDL is given
|
|
followed by a service provider's advertisement WSDL.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService">
|
|
<xsd:element name="CheckAvailabilityRequestServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="itemCode" type="xsd:string"/>
|
|
<xsd:element name="date" type="xsd:string"/>
|
|
<xsd:element name="qty" type="xsd:float"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckAvailabilityRequestServiceResponse" type="itemConfirmation"/>
|
|
<xsd:simpleType name="itemConfirmation"> <strong></strong>
|
|
<xsd:restriction base="xsd:boolean"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckAvailabilityRequestService">
|
|
<wsdl:operation name="CheckAvailabilityRequestOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckAvailabilityRequestServiceRequest"/>
|
|
<wsdl:output element="CheckAvailabilityRequestServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 1.2-1</strong>: A WSDL sample for CheckAvailabilityRequest
|
|
service. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckAvailabilityRequestService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckAvailabilityRequestService.wsdl</a>.</p>
|
|
|
|
<p></p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org2.example.com/wsdl/CheckInventoryService/"
|
|
xmlns="http://org2.example.com/wsdl/CheckInventoryService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org2.example.com/wsdl/CheckInventoryService">
|
|
<xsd:element name="CheckInventoryServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="SKU" type="xsd:string"/>
|
|
<xsd:element name="deliveryDate" type="xsd:string"/>
|
|
<xsd:element name="numBundles" type="xsd:float"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckInventoryServiceResponse">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="conf" type="xsd:boolean"/>
|
|
<xsd:element name="numBundles_available" type="xsd:string"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckInventoryService">
|
|
<wsdl:operation name="checkInventoryService" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckInventoryServiceRequest"/>
|
|
<wsdl:output element="CheckInventoryServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 1.2-2</strong>: A WSDL sample for CheckInventoryService.
|
|
This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckInventoryService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckInventoryService.wsdl</a>.</p>
|
|
|
|
<h2 id="Registries11"><a name="registries" id="registries">2. Defining
|
|
Annotations to Publish a Web Service</a></h2>
|
|
|
|
<p>A Web service can be semantically annotated to carry categorization
|
|
information that could be used to publish it for instance in a service
|
|
registry. The SAWSDL extension mechanism <em>modelReference</em> can be used to
|
|
add this categorization information to Web services. This categorization
|
|
information could be used when automatically publishing services in
|
|
registries such as UDDI [<a href="#UDDI1">UDDI</a>]. Below, we illustrate a
|
|
couple of ways in which categorization information can be associated with a
|
|
Web service.</p>
|
|
|
|
<h3><a name="PredefinedTaxonomy" id="PredefinedTaxonomy">2.1 Adding
|
|
Categorization Information with Category URIs</a></h3>
|
|
|
|
<p>If a categorization semantic model already exists (for example a
|
|
taxonomy), then a <em>modelReference</em> element could be defined either on
|
|
an interface or on an operation of a Web service to point to a particular
|
|
category in the taxonomy. For example, if a purchase order taxonomy was
|
|
created as shown in Listing 2.1-1 below (shown in RDF Turtle [<a
|
|
href="#RDFTurtle">Turtle]</a> format for readability), then the interface of
|
|
an item availability check Web service (introduced in Listing 1.2-1) could be
|
|
annotated with taxonomy information as shown in Listing 2.1-2.</p>
|
|
<pre>@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
@prefix : <http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/POServiceClassification#> .
|
|
|
|
<http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/POServiceClassification#> rdf:type owl:Ontology .
|
|
:PurchaseOrderServices rdf:type owl:Class .
|
|
:OrderModification rdf:type owl:Class;
|
|
rdfs:subClassOf :PurchaseOrderServices .
|
|
:ItemAvailabilityCheck rdf:type owl:Class;
|
|
rdfs:subClassOf :PurchaseOrderServices .
|
|
:OrderPlacement rdf:type owl:Class;
|
|
rdfs:subClassOf :PurchaseOrderServices .
|
|
:ProductInfoInquiry rdf:type owl:Class;
|
|
rdfs:subClassOf :PurchaseOrderServices .
|
|
:OrderTracking rdf:type owl:Class;
|
|
rdfs:subClassOf :PurchaseOrderServices .</pre>
|
|
|
|
<p><strong>Listing 2.1-1</strong>: A taxonomy to organize Web services
|
|
related to checking, placing, and tracking purchase orders. This taxonomy is
|
|
also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/POServiceClassification.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/POServiceClassification.n3</a>.</p>
|
|
<pre> ...
|
|
<wsdl:interface name="CheckItemAvailabilityRequestService"
|
|
<strong>sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/POServiceClassification#ItemAvailabilityCheck"</strong>>
|
|
...
|
|
</wsdl:interface>
|
|
...</pre>
|
|
|
|
<p><strong>Listing 2.1-2</strong>: Shows how a WSDL interface could be
|
|
annotated with categorization information that could be used in publishing a
|
|
Web service (for example, into a service registry)</p>
|
|
|
|
<h3><a name="UserdefinedTaxonomy" id="UserdefinedTaxonomy">2.2 Adding
|
|
Categorization Information with Category Identifiers</a></h3>
|
|
|
|
<p>Some taxonomies may not provide direct URIs for their categories and may
|
|
require multiple pieces of information to identify the categories.In such a
|
|
case, users can define such information as per the requirements and associate
|
|
a <em>modelReference</em> to point to such user-defined taxonomic
|
|
information. For example, if a particular taxonomy specifies two pieces of
|
|
information namely, an identifier of the taxonomy
|
|
and a unique non-URI code for every specific category in that taxonomy, then it can be defined as
|
|
follows.</p>
|
|
<pre>@prefix categorization: <http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
|
|
categorization:Category rdf:type rdfs:Class .
|
|
categorization:hasValue rdf:type rdf:Property;
|
|
rdfs:domain categorization:Category;
|
|
rdf:range rdfs:Literal .
|
|
categorization:usesTaxonomy rdf:type rdfs:Property;
|
|
rdfs:domain categorization:Category;
|
|
rdf:range rdfs:Resource .</pre>
|
|
|
|
<p><strong>Listing 2.2-1</strong>: Schema for defining a taxonomy with
|
|
specific properties. This schema is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization.n3</a>.</p>
|
|
|
|
<p>Then, an instance such as the one below in Listing 2.2-2 that adheres to
|
|
the above schema in Listing 2.2-1 can be defined and either imported or
|
|
inserted into the WSDL file whose interface (or operation) is to be
|
|
annotated.</p>
|
|
<pre>@prefix categorization: <http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.org/Categorization#> .
|
|
|
|
ex:Electronics rdf:type categorization:Category ;
|
|
categorization:hasValue "443112" ;
|
|
categorization:usesTaxonomy <http://naics.com/> .</pre>
|
|
|
|
<p><strong>Listing 2.2-2</strong>: An instance of a taxonomy defined using
|
|
the schema defined in Listing 2.2-1.</p>
|
|
|
|
<p>The annotation can be associated with the interface of a Web service as
|
|
follows.</p>
|
|
<pre><wsdl:interface name="CheckAvailabilityRequestService"
|
|
<strong>sawsdl:modelReference="http://example.org/Categorization#Electronics"</strong>>
|
|
...
|
|
</wsdl:interface></pre>
|
|
|
|
<p><strong>Listing 2.2-3</strong>: A WSDL sample showing how a
|
|
<em>wsdl:interface</em> could be annotated with taxonomy information
|
|
defined in Listing 2.2-2.</p>
|
|
|
|
<p>Using similar <em>modelReference</em> annotation operations within an
|
|
interface can also be annotated. SAWSDL does not specify any relationship
|
|
between the categorization information specified at the level of an interface
|
|
and the one that is specified on an operation that is contained within that
|
|
interface. The example in Listing 2.2-4 below shows how an operation within a
|
|
Web service interface could be annotated using the same 'categorization'
|
|
scheme.</p>
|
|
<pre><wsdl:operation name="CheckAvailabilityRequestOperation"
|
|
<strong>sawsdl:modelReference="http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization#Electronics"</strong>
|
|
...
|
|
</wsdl:operation></pre>
|
|
|
|
<p><strong>Listing 2.2-4</strong>: A WSDL sample showing how a
|
|
<em>wsdl:operation</em> could be annotated with taxonomy information from Listing 2.2-2.</p>
|
|
|
|
<h3><a name="UDDI" id="UDDI">2.3 Using Categorization Annotations to Publish
|
|
a Service in a UDDI Registry</a></h3>
|
|
|
|
<p>In this subsection, we discuss how one can use the categorization
|
|
annotation information defined by using the mechanisms described in Section 2
|
|
to publish Web services in a UDDI registry. This is provided as an example
|
|
for illustrative purpose. One can use similar mechanisms to publish the Web
|
|
services in registries or repositories other than UDDI.</p>
|
|
|
|
<p>Following the example in Listing 2.2-2, one can define taxonomy references
|
|
to point to a specific category, for example, defined in NAICS [<a
|
|
href="#NAICS">NAICS</a>] taxonomy that is registered in a UDDI registry as
|
|
shown in Listing 2.3-1. This information can then be reused when a service
|
|
(such as the CheckItemAvailability Service whose interface definition is
|
|
shown in Listing 2.2-3) is published in the UDDI registry. In the following
|
|
example we use the NAICS taxonomy registered in UDDI.</p>
|
|
<pre>@prefix categorization: <http://www.w3.org/2002/ws/sawsdl/spec/examples/taxonomy/Categorization#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
|
|
ex:Electronics rdf:type categorization:Category ;
|
|
categorization:hasValue "443112" ;
|
|
categorization:usesTaxonomy <uddi:uddi.org:ubr:categorization:naics:2002> .</pre>
|
|
|
|
<p><strong>Listing 2.3-1</strong>: An instance of a taxonomy defined using
|
|
the schema defined in Listing 2.2-1 that refers to NAICS taxonomy registered
|
|
in UDDI registry.</p>
|
|
|
|
<p>To publish a Web service that is represented in SAWSDL in a UDDI registry,
|
|
an automatic Web service publishing engine can dereference the taxonomy
|
|
information from its interface and use that information to determine the correct
|
|
category of a related taxonomy in the registry to publish the service to. For
|
|
example, when publishing the service in UDDI V3, a category bag can be
|
|
created to classify the service using this information. Listing 2.3-2 below
|
|
shows the UDDI categoryBag structure that could be created from the
|
|
categorization information in Listing 2.3-1.</p>
|
|
<pre><categoryBag>
|
|
<keyedReference
|
|
tModelKey="uddi:uddi.org:ubr:categorization:naics:2002"
|
|
keyName="Electronics"
|
|
keyValue="443112"/>
|
|
</categoryBag></pre>
|
|
|
|
<p><strong>Listing 2.3-2:</strong> UDDI Category bag structure derived from
|
|
the taxonomy instance in Listing 2.3-1.</p>
|
|
|
|
<p>In this section we have discussed the usage of <em>modelReference</em>
|
|
concepts on an interface and operation for associating categorization
|
|
relation information for illustrative purposes. Users may choose to use
|
|
<em>modelReferences</em> on interfaces and operations for associating other, for instance behavioral,
|
|
aspects with a service.</p>
|
|
|
|
<h2 id="Matchmaking"><a name="matchmaking" id="matchmaking">3. Defining
|
|
Annotations for use in Matching and Composing Web services</a></h2>
|
|
|
|
<p>One of the main motivations for SAWSDL specification is to provide
|
|
mechanisms using which semantic annotations can be added to WSDL documents so
|
|
that these semantics can be used to help automate the matching and
|
|
composition of Web services. In this section we present some examples to show
|
|
how to add such annotations for use during Web service interface matching and
|
|
composition. First we present an example to illustrate the use of annotations
|
|
in Web service interface matching.</p>
|
|
|
|
<h3><a name="sharedOnt" id="sharedOnt">3.1 Matching Web Service Interfaces
|
|
using a Shared Ontology</a></h3>
|
|
|
|
<p>Consider the the following scenario. A requestor
|
|
submits a request to verify the availability of an item from a preferred
|
|
supplier. This request is represented as a CheckAvailabilityRequest
|
|
WSDL (introduced in Listing 1.2-1). A service provider has
|
|
a service to offer that enables the requesters to check for the availability
|
|
of items it offers. This is called CheckInventoryService and is also
|
|
represented as WSDL with the same name (also introduced in Listing 1.2-2).
|
|
The <a href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckAvailability-req-sem.wsdl">request
|
|
WSDL</a> codifies the inputs it can supply and the outputs it expects of an
|
|
item availability check service by the service provider. The <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/CheckInventory-sem.wsdl">service WSDL</a> specifies the interface
|
|
of a service that allows requesters to check for the availability of an
|
|
inventory item by exposing the inputs it requires in order to provide item
|
|
availability confirmation. At a high level the service offered by the service
|
|
provider should match the request. However, the differences in the vocabulary
|
|
used by the two services to represent their interfaces may prevent
|
|
making a match. For example, the term <em>itemCode</em> used by the requester
|
|
and the term <em>SKU</em> (Stock Keeping Unit) used by the provider are
|
|
meant to uniquely identify the item in question. Also, the requester term <em>qty</em>
|
|
and the provider term <em>numBundles</em> in this context may refer to the number of items (for the requester, it is the
|
|
number of items being requested and for the provider, it is the number of
|
|
items being offered). A matching engine may not have sufficient
|
|
information to identify them as related terms unless explicitly specified.
|
|
Semantic annotations, in cases such as these, could be significant. A
|
|
simple case, if there were to be a common semantic model that can be used to
|
|
annotate the WSDLs of the requester and the service provider as shown below
|
|
(in Listings 3.1-1 and 3.1-2), then a semantic engine could use this
|
|
information to match the two Web services. In this example, annotation is
|
|
done using <em>modelReference</em> extensibility attribute defined in
|
|
SAWSDL.</p>
|
|
|
|
<p>The WSDL sample shown below in Listing 3.1-1 represents one of the ways
|
|
of semantically annotating WSDL document of the request for checking item
|
|
availability.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:sawsdl="http://www.w3.org/ns/sawsdl">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService">
|
|
<xsd:element name="CheckAvailabilityRequestServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="itemCode" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#PartNumber"</strong>/>
|
|
<xsd:element name="date" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#DueDate"</strong>/>
|
|
<xsd:element name="qty" type="xsd:float"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#Quantity"</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckAvailabilityRequestServiceResponse" type="itemConfirmation"/>
|
|
<xsd:simpleType name="itemConfirmation"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#AvailabilityConfirmation"</strong>>
|
|
<xsd:restriction base="xsd:boolean"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckAvailabilityRequestService">
|
|
<wsdl:operation name="checkAvailabilityRequestOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckAvailabilityRequestServiceRequest"/>
|
|
<wsdl:output element="CheckAvailabilityRequestServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.1-1</strong>: A WSDL sample of a semantically annotated
|
|
service request that shows the usage of <em>modelReference</em>. This WSDL sample is
|
|
also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckAvailabilityRequestService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckAvailabilityRequestService.wsdl</a>.</p>
|
|
|
|
<p>The WSDL sample in Listing 3.1-2 represents a way of semantically
|
|
annotating the WSDL document of the service offered by the service provider
|
|
for checking item availability.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org2.example.com/wsdl/CheckInventoryService/"
|
|
xmlns="http://org2.example.com/wsdl/CheckInventoryService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:sawsdl="http://www.w3.org/ns/sawsdl">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org2.example.com/wsdl/CheckInventoryService">
|
|
<xsd:element name="CheckInventoryServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="SKU" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#SKU"</strong>/>
|
|
<xsd:element name="deliveryDate" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#DueDate"</strong>/>
|
|
<xsd:element name="numBundles" type="xsd:float"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#Quantity"</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckInventoryServiceResponse">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="conf" type="xsd:boolean"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#AvailabilityConfirmation"</strong>/>
|
|
<xsd:element name="numBundles_available" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntology#Quantity"</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckInventoryService">
|
|
<wsdl:operation name="checkInventoryOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckInventoryServiceRequest"/>
|
|
<wsdl:output element="CheckInventoryServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.1-2</strong>: A WSDL sample of a semantically annotated
|
|
service (advertisement) that shows the usage of <em>modelReference</em>. This
|
|
WSDL sample is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService.wsdl</a>.</p>
|
|
|
|
<p>In this example both WSDL documents are
|
|
annotated with concepts from the same semantic model <em>SampleOntology</em>
|
|
(shown in Listing 3.1-3). The ontology contains the
|
|
relationship between the concepts PartNumber and SKU i.e., a SKU Code is a
|
|
subClassOf PartNumber. A semantic engine can use this relationship during
|
|
Web service interface matching by parsing and reasoning over this semantic
|
|
model. Therefore, the WSDL elements 'itemCode' in the request WSDL and the
|
|
'SKU' in the service WSDL match with one another. In the case of the other
|
|
input elements namely 'qty' vs 'numBundles' and 'date' vs 'deliveryDate',
|
|
since both these sets of elements are annotated with shared semantic concepts
|
|
namely 'Quantity' and 'DueDate' respectively the semantic ambiguity can be
|
|
resolved by direct matching of semantic annotations. The same applies to
|
|
matching outputs as well. The ontology that represents the subClassOf
|
|
relationship between the two concepts PartNumber and SKU can be modeled in
|
|
OWL as follows.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org1.example.com/ontologies/SampleOntology#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org1.example.com/ontologies/SampleOntology#> rdf:type owl:Ontology .
|
|
|
|
:PartNumber rdf:type owl:Class .
|
|
:SKU rdf:type owl:Class;
|
|
rdfs:subClassOf :PartNumber .
|
|
:Quantity rdf:type owl:Class .
|
|
:DueDate rdf:type owl:Class .
|
|
:AvailabilityConfirmation rdf:type owl:Class .</pre>
|
|
|
|
<p><strong>Listing 3.1-3</strong>: A simple SampleOntology that captures the
|
|
subClassOf relationship between PartNumber and SKU concepts. This sample
|
|
ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntology.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntology.n3</a>.</p>
|
|
|
|
<h3><a name="ontMediation" id="ontMediation">3.2 Matching Web Service
|
|
Interfaces with Ontology Mediation</a></h3>
|
|
|
|
<p>In Section 3.1 we made a shared ontology assumption between the requester
|
|
and service provider domains. This assumption may not always hold good. The
|
|
vocabulary differences may result in two different ontologies one for each
|
|
side albeit for the same domain. In such a case one can create a mapping
|
|
ontology by capturing the relationships between the concepts used in the
|
|
different ontologies. Below we annotate the same two request and advertisement
|
|
WSDLs using concepts from different ontologies. When a mapping ontology such
|
|
as the one shown in Listing 3.2-5 is available, then the semantic annotations
|
|
extracted from the request and the advertisement WSDL can be matched using
|
|
such a mapping ontology.</p>
|
|
|
|
<p>The WSDL sample shown below in Listing 3.2-1 represents one of the ways
|
|
of semantically annotating WSDL document of the request for checking item
|
|
availability.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService/">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService">
|
|
<xsd:element name="CheckAvailabilityRequestServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="itemCode" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntologyOrg1#PartNumber"</strong>/>
|
|
<xsd:element name="date" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntologyOrg1#DueDate"</strong>/>
|
|
<xsd:element name="qty" type="xsd:float"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntologyOrg1#Quantity"</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckAvailabilityRequestServiceResponse type="itemConfirmation"/>
|
|
<xsd:simpleType name="itemConfirmation"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/ontologies/SampleOntologyOrg1#AvailabilityConfirmation"</strong>
|
|
<xsd:restriction base:"xsd:boolean"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckAvailabilityRequestService">
|
|
<wsdl:operation name="checkAvailabilityRequestOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckAvailabilityRequestServiceRequest"/>
|
|
<wsdl:output element="CheckAvailabilityRequestServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.2-1</strong>: A WSDL sample of a semantically annotated
|
|
service request that shows the usage of <em>modelReference</em>. This WSDL sample is
|
|
also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckAvailabilityRequestService2.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckAvailabilityRequestService2.wsdl</a>.</p>
|
|
|
|
<p>The WSDL sample shown below in Listing 3.2-2 represents a way of
|
|
semantically annotating the WSDL document of the service offered by the
|
|
service provider for checking item availability.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org2.example.com/wsdl/CheckInventoryService/">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org2.example.com/wsdl/CheckInventoryService">
|
|
<xsd:element name="CheckInventoryServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="SKU" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#SKU"</strong>/>
|
|
<xsd:element name="deliveryDate" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#DeliveryDate"</strong>/>
|
|
<xsd:element name="numBundles" type="xsd:float"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#NumBundles</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckInventoryServiceResponse">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="conf" type="xsd:boolean"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#AvailabilityConfirmation"</strong>/>
|
|
<xsd:element name="numBundles_available" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#NumBundles"</strong>/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckInventoryService">
|
|
<wsdl:operation name="checkInventoryOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckInventoryServiceRequest"/>
|
|
<wsdl:output element="CheckInventoryServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.2-2</strong>: A WSDL sample of a semantically annotated
|
|
service (advertisement) that shows the usage of <em>modelReference</em>. This
|
|
WSDL sample is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService2.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService2.wsdl</a>.</p>
|
|
|
|
<p>As noted, in this case the concepts originating from different ontologies
|
|
represented in the two WSDLs shown above are mapped in a mapping ontology
|
|
such as the one shown below in Listing 3.2-5. It contains relationships
|
|
between concepts such as Quantity & NumBundles and Due Date &
|
|
DeliveryDate and PartNumber & SKU. Just as in the example in Section 3.1,
|
|
a semantic matching engine can now be applied to reason over these
|
|
relationships during Web service interface matching. The relationships
|
|
between the concepts in this mapping ontology are shown pictorially in <a
|
|
href="#Figure1">Figure 1</a> below.</p>
|
|
|
|
<p>Below, we list the three ontologies that are used in matching the
|
|
checkAvailabilityRequest() request WSDL with the checkInventoryService()
|
|
advertisement WSDL. The first ontology shown in Listing 3.2-3 is the one used
|
|
by the requesting organization (referred to using the namespace
|
|
http://org1.example.com/ontologies/SampleOntology)
|
|
that defined the checkAvailabilityRequest() request WSDL. The second ontology
|
|
shown in Listing 3.2-4 is the one used by the service advertising
|
|
organization (referred to using the namespace http://org2.example.com/ontologies/SampleOntologyOrg2) that defined the
|
|
checkInventoryService() advertisement WSDL. The third one shown in Listing
|
|
3.2-5 is the mapping ontology defined by a third organization (could possibly
|
|
be defined by either of the first two organizations as well) that relates the
|
|
concepts from the two ontologies defined by org1 and org2.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org1.example.com/ontologies/SampleOntologyOrg1#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org1.example.com/ontologies/SampleOntologyOrg1#> rdf:type owl:Ontology .
|
|
|
|
:PartNumber rdf:type owl:Class .
|
|
:DueDate rdf:type owl:Class .
|
|
:Quantity rdf:type owl:Class .
|
|
:AvailabilityConfirmation rdf:type owl:Class .</pre>
|
|
|
|
<p><strong>Listing 3.2-3:</strong>Sample Ontology used
|
|
by the organization that defined checkAvailabilityRequest() request WSDL.
|
|
This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg1.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg1.n3</a>.</p>
|
|
|
|
<p></p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org2.example.com/ontologies/SampleOntologyOrg2#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org2.example.com/ontologies/SampleOntologyOrg2#> rdf:type owl:Ontology .
|
|
|
|
:SKU rdf:type owl:Class .
|
|
:DeliveryDate rdf:type owl:Class .
|
|
:NumBundles rdf:type owl:Class .
|
|
:AvailabilityConfirmation rdf:type owl:Class .
|
|
</pre>
|
|
|
|
<p><strong>Listing 3.2-4:</strong>Sample Ontology used by
|
|
the organization that defined checkInventoryService() advertisement WSDL.
|
|
This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg2.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg2.n3</a>.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org3.example.com/ontologies/MappingOntology#> .
|
|
@prefix Org1Ont: <http://org1.example.com/ontologies/SampleOntologyOrg1#> .
|
|
@prefix Org2Ont: <http://org2.example.com/ontologies/SampleOntologyOrg2#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org3.example.com/ontologies/MappingOntology#> rdf:type owl:Ontology .
|
|
|
|
Org2Ont:SKU rdfs:subClassOf Org1Ont:PartNumber .
|
|
Org2Ont:NumBundles owl:equivalentClass Org1Ont:Quantity .
|
|
Org2Ont:DeliveryDate owl:equivalentClass Org1Ont:DueDate .
|
|
Org2Ont:AvailabilityConfirmation owl:equivalentClass Org1Ont:AvailabilityConfirmation .</pre>
|
|
|
|
<p><strong>Listing 3.2-5</strong>: Sample Ontology showing the mapping
|
|
ontology mapping concepts from ontologies in Listings 3.2-3 and 3.2-4. This
|
|
mapping ontology is used to match the request WSDL in Listing 3.2-1 with the
|
|
advertisement WSDL in Listing 3.2-2. This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/MappingOntology.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/MappingOntology.n3</a>.</p>
|
|
|
|
<div id="Figure1" style="text-align: center">
|
|
<p><img src="img/sampleRetailOntology.png" alt="sampleRetailOntology"
|
|
title="Figure 1: A Simple Sample Ontology used to annotate item availability request WSDL"
|
|
/></p>
|
|
|
|
<p><strong>Figure 1</strong>: A pictorial representation of a sample mapping
|
|
ontology that can be used to match the request WSDL in Listing 3.2-1 with the
|
|
advertisement WSDL in Listing 3.2-2</p>
|
|
</div>
|
|
|
|
<p>It is to be noted that SAWSDL specifies mechanisms to annotate WSDLs but
|
|
does not say anything about how these annotations are generated. These
|
|
annotations can either be created manually or by tools that can infer
|
|
relationships between the terms used in the WSDLs and those that are given in
|
|
a semantic model. Also, SAWSDL does not say anything about how the semantic
|
|
models themselves are created. Just like the creation of annotations, these
|
|
semantic models can either be created manually by a human expert or generated
|
|
automatically using ontology learning tools or by a combination of both.</p>
|
|
|
|
<p>In the next section, we extend the above item availability check example
|
|
to show how semantic annotations added to a WSDL can be used to compose Web
|
|
services.</p>
|
|
|
|
<h3><a name="composition" id="composition">3.3 Composing Web Services - A
|
|
Simple Example</a></h3>
|
|
|
|
<p>This section illustrates how semantic annotations can be used to compose
|
|
Web services. The request and advertisement WSDLs to be considered in this
|
|
scenario are the same as the ones shown in Listings 3.2-1 and 3.2-2
|
|
respectively. However, we introduce a variation to the mapping ontology from
|
|
Section 3.2. Suppose that in the item availability checking scenario that we
|
|
have been discussing so far, the <em>subClassOf</em> relationship between the concepts
|
|
PartNumber and SKU is unspecified in the ontology. In this case, the request
|
|
checkAvailabilityRequest() would not match with the service
|
|
checkInventoryService() because there is no relationship between PartNumber
|
|
and SKU. Also, suppose that there is another Web service called
|
|
PartNumber2SKULookup() that can take a PartNumber as input and produce SKU
|
|
as output (Listing 3.3-1). Say that a matching engine would be able to find
|
|
this service in the appropriate category in a registry - in this case it
|
|
would be in 'Utilities/LookupServices' category (because the modelReference
|
|
on the operation of this service contains the categorization information.
|
|
Presumably a publishing agent/program would have placed this service in the
|
|
appropriate category that is referred to by the <em>modelReference</em> URI).
|
|
Also, a mapping ontology such as the one shown in Listing 3.3-2 is
|
|
available for the matching engine. The service PartNumber2SKULookup()
|
|
can be composed with checkInventoryService() to match the request
|
|
checkAvailabilityRequest() as shown in <a href="#Figure2">Figure 2</a>. This
|
|
can be achieved by simply extracting the semantic annotations from the
|
|
request, and all the advertisement WSDLs and using the relationships in the
|
|
mapping ontology to match the corresponding concepts. A simple Web service
|
|
composition using the semantics annotations on the request and advertisement
|
|
services is illustrated in <a href="#Figure2">Figure 2</a>.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org3.example.com/wsdl/PartNumber2SKULookupService/"
|
|
xmlns="http://org3.example.com/wsdl/PartNumber2SKULookupService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
xmlns:sawsdl="http://www.w3.org/ns/sawsdl">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org3.example.com/wsdl/PartNumber2SKULookupService">
|
|
<xsd:element name="PartNumber2SKULookupServiceRequest" type="partNum"/>
|
|
<xsd:simpleType name="partNum"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#PartNumber</strong>">
|
|
<xsd:restriction base="xsd:string"/>
|
|
</xsd:simpleType>
|
|
|
|
<xsd:element name="PartNumber2SKULookupServiceResponse" type="SKU"/>
|
|
<xsd:simpleType name="SKU"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#SKU</strong>">
|
|
<xsd:restriction base="xsd:string"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="PartNumber2SKULookupService">
|
|
<wsdl:operation name="PartNumber2SKULookupService" pattern="http://www.w3.org/ns/wsdl/in-out"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/taxonomies/Utilities#LookupServices</strong>">
|
|
<wsdl:input element="PartNumber2SKULookupServiceRequest"/>
|
|
<wsdl:output element="PartNumber2SKULookupServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.3-1</strong>: A WSDL sample representing
|
|
PartNumber2SKULookup service. This WSDL sample is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PartNumber2SKULookupService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PartNumber2SKULookupService.wsdl</a>.</p>
|
|
|
|
<p>Listing 3.3-2 below shows the variation on the mapping ontology discussed
|
|
in Section 3.2. As noted, this ontology does not contain any relationship
|
|
between PartNumber and SKU concepts. The additional differences from Listing
|
|
3.2-5 are shown below in bold font style. In this example, we assume that the
|
|
same organization that provides the PartNumber2SKULookupService() provides
|
|
the mapping ontology. In practice, this does not have to be the case. Any of
|
|
the three organizations (org1, org2, and org3 referred to in the namespaces)
|
|
or an entirely new organization (org4) can provide a mapping ontology. The
|
|
namespaces, in such a case, should reflect the change accordingly. The
|
|
ontologies that are used to annotate the request WSDL
|
|
checkAvailabilityRequest() and the advertisement WSDL checkInventoryService()
|
|
are unchanged from those presented in Listing 3.2-3 and 3.2-4.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org1.example.com/ontologies/MappingOntology#> .
|
|
@prefix Org1Ont: <http://org1.example.com/ontologies/SampleOntologyOrg1#> .
|
|
@prefix Org2Ont: <http://org2.example.com/ontologies/SampleOntologyOrg2#> .
|
|
@prefix Org3Ont: <http://org3.example.com/ontologies/SampleOntologyOrg3#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org3.example.com/ontologies/MappingOntology#> rdf:type owl:Ontology .
|
|
|
|
Org2Ont:NumBundles rdf:type owl:Class;
|
|
owl:equivalentClass Org1Ont:Quantity .
|
|
Org2Ont:DeliveryDate rdf:type owl:Class;
|
|
owl:equivalentClass Org1Ont:DueDate .
|
|
Org2Ont:AvailabilityConfirmation rdf:type owl:Class;
|
|
owl:equivalentClass Org1Ont:AvailabilityConfirmation .
|
|
|
|
<strong>Org3Ont:PartNumber rdf:type owl:Class;
|
|
owl:equivalentClass Org1Ont:PartNumber .
|
|
Org3Ont:SKU rdf:type owl:Class;
|
|
owl:equivalentClass Org2Ont:SKU .</strong>
|
|
</pre>
|
|
|
|
<p><strong>Listing 3.3-2</strong>: Revised Mapping Ontology that contains
|
|
relationships between concepts from three different ontologies. This ontology
|
|
is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/RevisedMappingOntology.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/RevisedMappingOntology.n3</a>.</p>
|
|
|
|
<div id="Figure2" style="text-align: center">
|
|
<p><img src="img/ontologyMediation-V2.png" alt="A Possible Composition Scenario"
|
|
title="Figure 2: A Possible Web Service Composition Scenario" /></p>
|
|
|
|
<p><strong>Figure 2</strong>. Simple Web service composition using the
|
|
semantic annotations on the request and advertisement services.</p>
|
|
</div>
|
|
|
|
<h3><a name="reasoning" id="reasoning">3.4 Composing Web Services using
|
|
Ontology Reasoning</a></h3>
|
|
|
|
<p>We introduce three variations to our item availability checking scenario
|
|
in this section to illustrate how one can use semantic annotations to compose
|
|
Web services with ontology reasoning. First, suppose that we have a
|
|
checkInventoryService() that takes an UPC as input inplace of SKU (as
|
|
introduced in Listing 1.2-2 but with semantic annotations as in Listing 3.4-1
|
|
below). This service will not match the request
|
|
checkAvailabilityRequest() (unchanged from Listing 3.2-1) because there is no
|
|
relationship between the concepts PartNumber and UPC in the mapping ontology.
|
|
Even semantic annotations will not be able to help in matching the
|
|
request checkAvailabilityRequest() and the advertisement
|
|
checkInventoryService(). Second, say that there is another Web service
|
|
<em>called SKU2UPCLookup</em>() that can take an <em>SKU</em> as input and
|
|
produce <em>UPC</em> (Universal Product Code) as output (Listing 3.4-2).
|
|
Third, the original mapping ontology introduced in Listing 3.2-3 has an
|
|
addition of UPC concept. But it is to be noted that the ontology does not
|
|
specify any relationship between SKU and UPC codes. <a href="#Figure3">Figure
|
|
3</a> summarizes the relationships between the concepts PartNumber, SKU, and
|
|
UPC in SampleOntology. Now with these three variations, we have enough
|
|
information to see how a semantic engine can compose Web services to match
|
|
the request checkAvailabilityRequest() with checkInventoryService().</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org2.example.com/wsdl/CheckInventoryService/">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org2.example.com/wsdl/CheckInventoryService">
|
|
<xsd:element name="CheckInventoryServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="UPC" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#UPC</strong>"/>
|
|
<xsd:element name="deliveryDate" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#DeliveryDate</strong>"/>
|
|
<xsd:element name="numBundles" type="xsd:float"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#NumBundles</strong>"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckInventoryServiceResponse">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="conf" type="xsd:boolean"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#AvailabilityConfirmation</strong>"/>
|
|
<xsd:element name="numBundles_available" type="xsd:string"
|
|
<strong>sawsdl:modelReference="http://org2.example.com/ontologies/SampleOntologyOrg2#NumBundles</strong>"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckInventoryService">
|
|
<wsdl:operation name="checkInventoryOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckInventoryServiceRequest"/>
|
|
<wsdl:output element="CheckInventoryServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.4-1</strong>: CheckInventoryService() WSDL sample with
|
|
a variation where the input SKU is replaced by UPC for the purpose of
|
|
illustrating Web service composition with ontology reasoning. This WSDL sample is
|
|
also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService2.V2.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SemannCheckInventoryService2.V2.wsdl</a>.</p>
|
|
|
|
<p>A WSDL sample of SKU2UPCLookupService() is shown below.</p>
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org3.example/com/wsdl/SKU2UPCLookupService/">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace="http://org3.example.com/wsdl/SKU2UPCLookupService">
|
|
<xsd:element name="SKU2UPCLookupServiceRequest" type="SKU"/>
|
|
<xsd:simpleType name="SKU">
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#SKU</strong>">
|
|
<xsd:restriction base="xsd:string"/>
|
|
</xsd:simpleType>
|
|
|
|
<xsd:element name="SKU2UPCLookupServiceResponse" type="UPC"/>
|
|
<xsd:simpleType name="UPC">
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#UPC</strong>">
|
|
<xsd:restriction base="xsd:string"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="SKU2UPCLookupService">
|
|
<wsdl:operation name="SKU2UPCLookupService" pattern="http://www.w3.org/ns/wsdl/in-out"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/taxonomies/Utilities#LookupServices</strong>">
|
|
<wsdl:input element="SKU2UPCLookupServiceRequest"/>
|
|
<wsdl:output element="SKU2UPCLookupServiceResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p><strong>Listing 3.4-2</strong>: A WSDL sample representing SKU2UPCLookup
|
|
service. This WSDL is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SKU2UPCLookupService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/SKU2UPCLookupService.wsdl</a>.</p>
|
|
|
|
<p>Below, we list the three ontologies that are used in matching the
|
|
checkAvailabilityRequest() request WSDL with the checkInventoryService()
|
|
advertisement WSDL according to the scenario described in this section. The
|
|
first ontology shown in Listing 3.4-3 is the one used by the requesting
|
|
organization (referred to using the namespace
|
|
http://org1.example.com/ontologies/SampleOntologyOrg1)
|
|
that defined the checkAvailabilityRequest() request WSDL. Please note that
|
|
this differs from the Listing in 3.2-3 because this ontology contains the
|
|
'subClassOf' relationship between SKU and PartNumber concepts. The second
|
|
ontology shown in Listing 3.4-4 is the one used by the service advertising
|
|
organization (referred to using the namespace http://org2.example.com/ontologies/SampleOntologyOrg2) that defined the
|
|
checkInventoryService() advertisement WSDL. Please note that this differs
|
|
from the Listing in 3.2-4 because this contains the concept UPC instead of
|
|
SKU. The third one shown in Listing 3.2-5 is the mapping ontology defined by
|
|
a third organization (could possibly be defined by either of the first two
|
|
organizations as well) that relates the concepts from the two ontologies
|
|
defined by org1 and org2.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org1.example.com/ontologies/SampleOntologyOrg1.V2#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org1.example.com/ontologies/SampleOntologyOrg1.V2#> rdf:type owl:Ontology .
|
|
|
|
:PartNumber rdf:type owl:Class .
|
|
:SKU rdf:type owl:Class;
|
|
rdfs:subClassOf :PartNumber .
|
|
:DueDate rdf:type owl:Class .
|
|
:Quantity rdf:type owl:Class .
|
|
:AvailabilityConfirmation rdf:type owl:Class .</pre>
|
|
|
|
<p><strong>Listing 3.4-3:</strong>Sample Ontology used
|
|
by the organization that defined checkAvailabilityRequest() request WSDL.
|
|
This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg1.V2.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg1.V2.n3</a>.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org2.example.com/ontologies/SampleOntologyOrg2.V2#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org2.example.com/ontologies/SampleOntologyOrg2.V2#> rdf:type owl:Ontology .
|
|
|
|
:UPC rdf:type owl:Class;
|
|
:DeliveryDate rdf:type owl:Class .
|
|
:NumBundles rdf:type owl:Class .
|
|
:AvailabilityConfirmation rdf:type owl:Class .
|
|
</pre>
|
|
|
|
<p><strong>Listing 3.4-4</strong>: Sample Ontology used by
|
|
the organization that defined checkInventoryService() advertisement WSDL.
|
|
This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg2.V2.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/SampleOntologyOrg2.V2.n3</a>.</p>
|
|
|
|
<p>Listing 3.4-5 represents the updated sample ontology that enables
|
|
composition in this example. It relates the concepts in the ontologies shown
|
|
in Listings 3.4-3 and 3.4-4. Note that the ontology as such does not specify
|
|
any relationship between SKU and UPC. Given a SKU, its corresponding UPC
|
|
code is retrieved by the Web service SKU2UPCLookup(). Here also, we assume
|
|
that the organization that is providing the SKU2UPCLookupService() is
|
|
providing the mapping ontology as well. As mentioned earlier in Section 3.3,
|
|
this does not always have to be the case.</p>
|
|
<pre>@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix: <http://org1.example.com/ontologies/RevisedMappingOntology.V2#> .
|
|
@prefix Org1Ont: <http://org1.example.com/ontologies/SampleOntologyOrg1#> .
|
|
@prefix Org2Ont: <http://org2.example.com/ontologies/SampleOntologyOrg2#> .
|
|
@prefix Org3Ont: <http://org3.example.com/ontologies/SampleOntologyOrg3#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
|
|
<http://org3.example.com/ontologies/RevisedMappingOntology.V2#> rdf:type owl:Ontology .
|
|
|
|
Org2Ont:NumBundles owl:equivalentClass Org1Ont:Quantity .
|
|
Org2Ont:DeliveryDate owl:equivalentClass Org1Ont:DueDate .
|
|
Org2Ont:AvailabilityConfirmation owl:equivalentClass Org1Ont:AvailabilityConfirmation .
|
|
|
|
<strong>Org3Ont:SKU rdf:type owl:Class;
|
|
owl:equivalentClass Org1Ont:SKU .
|
|
Org3Ont:UPC rdf:type owl:Class;
|
|
owl:equivalentClass Org2Ont:UPC .</strong> </pre>
|
|
|
|
<p><strong>Listing 3.4-5</strong>: Revised Mapping Ontology that contains
|
|
relationships between concepts PartNumber, SKU, and UPC among other things
|
|
that is used in this section to illustrate Web service composition using
|
|
ontology reasoning. This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/RevisedMappingOntology.V2.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/RevisedMappingOntology.V2.n3</a>.</p>
|
|
|
|
<p>Figure 3 represents an altered version of the ontology that enables
|
|
composition in this example.</p>
|
|
|
|
<div id="Figure3" style="text-align: center">
|
|
<p><img src="img/sampleRetailOntology-Mediation.png"
|
|
alt="asampleRetailOntology-Mediation"
|
|
title="Figure 3: An altered version of the simple sample retail ontology that enables composition"
|
|
/></p>
|
|
|
|
<p><strong>Figure 3</strong>: An altered version of the simple sample retail
|
|
ontology that enables composition</p>
|
|
</div>
|
|
|
|
<p>Figure 4 shows how Web service composition can be achieved by using the
|
|
semantic annotations in the WSDL files discussed in this example. As can be
|
|
noted, in this scenario, a semantic engine retrieves the semantic annotations
|
|
from checkAvailabilityRequest() for element itemCode namely PartNumber and
|
|
for the element SKU in SKU2UPCLookup() service namely SKU. The annotation
|
|
PartNumber does not match lexically with the concept SKU. So, the semantic
|
|
engine could then consult the MappingOntology to see if there is any
|
|
relationship between PartNumber and SKU. The ontology reasoner can return the
|
|
existence of 'subClassOf' relationship between SKU and PartNumber. This
|
|
information can then be used in composing SKU2UPCLookup() with
|
|
CheckInventoryService() as shown in <a href="#Figure4">Figure 4</a> to match
|
|
the request CheckAvailabilityRequest(). Again, as mentioned earlier in
|
|
Section 3.3, a matching engine would be able to find a utility service such
|
|
as SKU2UPCLookup() in the appropriate category in a registry - in this case
|
|
it would be in 'Utilities/LookupServices' category because the modelReference
|
|
on the operation of this service contains the categorization information. So,
|
|
presumably a publishing agent/program would have placed this service in the
|
|
appropriate category that is referred to by the <em>modelReference</em>
|
|
URI.</p>
|
|
|
|
<div id="Figure4" style="text-align: center">
|
|
<p><img src="img/ItemAvailabilityComposition.png"
|
|
alt="sampleRetailOntology-Mediation"
|
|
title="Figure 4: A Web Service Composition Scenario with Possible Ontology Reasoning"
|
|
/></p>
|
|
|
|
<p><strong>Figure 4</strong>: A Web Service Composition Scenario with
|
|
Ontology Reasoning</p>
|
|
</div>
|
|
|
|
<p>The example presented in this section was a variation of the one discussed
|
|
in Section 3.4. It illustrated how Web service composition can be achieved
|
|
using the relationships between concepts in an ontology even when the semantic
|
|
annotations on the services don't match directly.</p>
|
|
|
|
<h3><a name="multiple" id="multiple">3.5 Matching Using Multiple
|
|
Annotations</a></h3>
|
|
|
|
<p>SAWSDL allows multiple annotations to be associated with those WSDL
|
|
elements that can have a <em>modelReference</em> extension. These annotations
|
|
could be pointing to different concepts from the same semantic model or from
|
|
different models altogether. For example, a WSDL element with the name
|
|
<em>itemCode</em> can be associated with <em>SampleOntology#PartNumber</em>
|
|
and <em>SampleOntology#SKU</em> concepts. SAWSDL does not specify any
|
|
relationship between these multiple annotations other than saying that they
|
|
all apply. It is up to the consumers of these annotated WSDLs to use the ones
|
|
that are relevant to them or to figure out the relationship between the
|
|
concepts, if they so choose, by consulting the ontology that defines them.
|
|
The following example in Listing 3.5-1 shows the annotation of
|
|
<em>itemCode</em> with multiple annotations. If a requesting WSDL is
|
|
annotated with multiple concepts like shown in Listing 3.5-1, this increases
|
|
the likelihood of matching this request with other advertisement/service
|
|
WSDLs. Similarly, if a service WSDL is annotated with multiple concepts,
|
|
possibly more request WSDLs will match it.</p>
|
|
<pre> ...
|
|
<xsd:simpleType name="itemCode"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#PartNumber
|
|
http://org3.example.com/ontologies/SampleOntologyOrg3#SKU"</strong>/>
|
|
<xsd:restriction base="xsd:string"/>
|
|
</xsd:simpleType>
|
|
...</pre>
|
|
|
|
<p><strong>Listing 3.5-1</strong>: A WSDL sample showing multiple
|
|
annotations to a simple type</p>
|
|
|
|
<p>The example given in this section so far illustrated multiple annotations
|
|
that come from the same ontology. It is possible for elements to be annotated
|
|
with concepts from different ontologies as well. The mechanism for doing so
|
|
is exactly the same as the one employed in Listing 3.5-1 except in the latter
|
|
case, the namespaces for the concepts coming from different ontolgies would
|
|
be different.</p>
|
|
|
|
<h3><a name="complex" id="complex">3.6 Matching Using Complex Type
|
|
Annotations</a></h3>
|
|
|
|
<p>In the examples that we discussed so far, all annotations are added at the
|
|
member element levels of a complex type. SAWSDL allows annotations to be
|
|
added either at the complex type level (top level) or at the member element
|
|
level (bottom level) or both. In cases where both complex type and the member
|
|
elements have annotations, SAWSDL does not specify any relationship between
|
|
the <em>modelReferences</em> on a complex type and those on the elements
|
|
contained within a complex type. The listing below (Listing 3.6-1)
|
|
illustrates the usage of <em>modelReference</em> for annotating the complex
|
|
type 'ItemRequest' as well as the member elements.</p>
|
|
<pre><wsdl:types>
|
|
...
|
|
<xsd:element name="ItemRequest"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#OrderItem"</strong>>
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="itemCode" type="xsd:string"/>
|
|
<xsd:element name="date" type="xsd:string"/>
|
|
<xsd:element name="qty" type="xsd:string"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
...
|
|
</wsdl:types></pre>
|
|
|
|
<p><strong>Listing 3.6-1</strong>: A WSDL sample from
|
|
CheckAvailabilityRequest() showing the annotation of a
|
|
<em>complexType</em>.</p>
|
|
|
|
<p>Here is one possible way in which the annotation on a complex type can be
|
|
used. The annotation on the complex type 'itemRequest' such as the one in
|
|
Listing 3.6-1 which is part of checkAvailabilityRequest() can be used to
|
|
match another complex type such as the one in checkInventoryService() shown
|
|
in Listing 3.6-2 below. The annotation on a complex type can be used a first
|
|
level of matching in structure matching i.e., a semantic matching engine
|
|
could use these annotations to see if two complex types have any relationship
|
|
at all. If they do, perhaps spending more time on matching the member
|
|
elements of complex types may be worth the time. If not, perhaps there is no
|
|
need to do detailed matching of complex structures. Therefore, the
|
|
annotations on complex types can be used for first level of structure
|
|
matching.</p>
|
|
<pre> <wsdl:types>
|
|
...
|
|
<xsd:element name="Item"
|
|
<strong>sawsdl:modelReference="http://org3.example.com/ontologies/SampleOntologyOrg3#OrderItem"</strong>>
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="SKU" type="xsd:string"/>
|
|
<xsd:element name="deliveryDate" type="xsd:string"/>
|
|
<xsd:element name="numBundles" type="xsd:float"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
...
|
|
</wsdl:types></pre>
|
|
|
|
<p><strong>Listing 3.6-2</strong>: A WSDL sample from CheckInventoryService()
|
|
showing the annotation of a compex type.</p>
|
|
|
|
<h3><a name="conditions" id="conditions">3.7 Representing Conditions</a></h3>
|
|
|
|
<p>The <em>modelReference</em> attribute can be used to represent behavioral
|
|
constraints related with services. For example, in the purchase order
|
|
scenario, if we were to add the following "inputRule" constraints related to shipping
|
|
details, they can be represented in SAWSDL using <em>modelReferences</em> as
|
|
shown in Listing 3.7-1.</p>
|
|
<ul>
|
|
<li>Only packages weighing 50 lbs or less can be shipped</li>
|
|
<li>Shipping is possible only in North America, and Europe.</li>
|
|
<li>Delivery is possible only between 7am and 8pm.</li>
|
|
<li>Delivery has to be ordered at least 2 working days in advance.</li>
|
|
</ul>
|
|
|
|
<p>We would like to represent the following effects on the outputs of a purchase order service.</p>
|
|
<ul>
|
|
<li>If more than 50lbs was ordered, order is taken only for 50lbs
|
|
("outputRule1").</li>
|
|
<li>ItemConfirmation # can be tracked only for 30 days after the order was
|
|
placed ("outputRule2").</li>
|
|
<li>If the order does not arrive the shipping location within the required
|
|
date, no charge will be made to the account ("outputRule3").</li>
|
|
</ul>
|
|
|
|
<p><a href="#conditionlistings">Appendix A</a> contains listings that attempt
|
|
to formalize these rules.</p>
|
|
|
|
<pre><wsdl:description
|
|
targetNamespace="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns="http://org1.example.com/wsdl/CheckAvailabilityRequestService/"
|
|
xmlns:wsdl="http://www.w3.org/ns/wsdl"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
|
|
<wsdl:types>
|
|
<xsd:schema targetNamespace=http://org1.example.com/wsdl/CheckAvailabilityRequestService">
|
|
<xsd:element name="CheckAvailabilityRequestServiceRequest">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="itemCode" type="xsd:string"/>
|
|
<xsd:element name="date" type="xsd:string"/>
|
|
<xsd:element name="qty" type="xsd:float"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
<xsd:element name="CheckAvailabilityRequestServiceResponse" type="itemConfirmation"/>
|
|
<xsd:simpleType name="itemConfirmation">
|
|
<xsd:restriction base="xsd:boolean"/>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="CheckAvailabilityRequestService">
|
|
<wsdl:operation name="CheckAvailabilityRequestOperation" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="CheckAvailabilityRequestServiceRequest"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/rules#inputRule"</strong>/>
|
|
<wsdl:output element="CheckAvailabilityRequestServiceResponse"
|
|
<strong>sawsdl:modelReference="http://org1.example.com/rules#outputRule1
|
|
http://org1.example.com/rules#outputRule2
|
|
http://org1.example.com/rules#outputRule3"</strong>/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description></pre>
|
|
|
|
<p>Listing 3.7-1: An example showing the usage of modelReference to represent conditions</p>
|
|
|
|
<p>We have discussed how to annotate WSDL documents with semantic
|
|
concepts for use in Web service discovery, matching and composition.These
|
|
annotations that can be added to a WSDL using modelReferences are meant to
|
|
add semantic clarity to WSDL elements by pointing to concepts in a semantic
|
|
model that describes the larger context. They help understand whether a
|
|
service matches clients' requests at a semantic level. However, there may
|
|
still be mismatches at the data level that would need to be addressed and
|
|
captured to enable the invocation of a Web service. In the following section,
|
|
we discuss the mechanisms defined in SAWSDL to capture such data
|
|
transformation maps (known as schema mappings) to enable Web service
|
|
invocation.</p>
|
|
|
|
<h2><a name="invocation" id="invocation">4. Defining Schema Mappings to
|
|
Enable Web Service Invocation</a></h2>
|
|
|
|
<p>Consider the example where a client/requester may have a 'first name' and
|
|
'last name' among its data as shown in Listing 4-1 and the advertisement
|
|
service requires a 'full name' as shown in Listing 4-2. In this case, when
|
|
the client invokes the Web service of the service provider, the data values
|
|
of <em>firstName</em> and <em>lastName</em> need to be concatenated in the
|
|
message to the advertisement Web service to pass the correct values for the
|
|
<em>Name</em> element.</p>
|
|
<pre>..
|
|
<xsd:element name="firstName" type="xsd:string"/>
|
|
<xsd:element name="lastName" type="xsd:string"/>
|
|
..</pre>
|
|
|
|
<p><strong>Listing 4-1</strong>: An XML sample showing two elements
|
|
<em>firstName</em> and <em>lastName</em>.</p>
|
|
<pre>..
|
|
<xsd:element name="Name" type="xsd:string"/>
|
|
..</pre>
|
|
|
|
<p><a name="OrderRequest"></a><strong>Listing 4-2</strong>: An XML sample showing an element
|
|
<em>Name</em>.</p>
|
|
|
|
<p>To facilitate the association of such types of data transformations with
|
|
Web services, SAWSDL provides a mechanism called <em>Schema mapping</em>. A
|
|
<em>Schema mapping</em> allows the specification of
|
|
transformation functions on the WSDL elements to map instance data defined by
|
|
that XML schema document to the semantic data of the concepts in a semantic
|
|
model. It also allows the specification of transformation functions
|
|
that map the semantic data of ontological concepts to the instance data
|
|
values that adhere to the XML schema document that is being annotated. In
|
|
the former case, the transformation functions are referred to using the
|
|
extensibility attribute <em>liftingSchemaMapping</em> and in the latter case
|
|
it is called <em>loweringSchemaMapping</em>. These kinds of mappings are
|
|
useful in general when the structure of the XML instance data does not correspond
|
|
directly to the organization of the semantic data. Also, these types of
|
|
mappings can be used to generate mediation code to support invocation of a
|
|
Web service.</p>
|
|
|
|
<p>In the remaining part of this section, we illustrate these lifting and
|
|
lowering schema mappings in the context of a purchase order scenario. We use
|
|
XSLT [XSLT] as the mapping language for illustrative purposes. SAWSDL
|
|
specification by itself does not prescribe any specific mapping language.
|
|
Users can choose a mapping language of their choice. The purchase order
|
|
scenario is very similar to the check availability scenario we have been
|
|
discussing throughout this document so far.</p>
|
|
|
|
<h2><a name="lifting" id="lifting">4.1 Lifting Schema Mapping</a></h2>
|
|
|
|
<p>A liftingSchemaMapping takes as input XML data (that adheres to a given
|
|
XML schema) and produces semantic data (that adheres to a semantic model, in our case an RDF ontology) as
|
|
output. Let us consider purchase order scenario. Listing 4.1-1 shows samples
|
|
of a WSDL that has OrderRequest, item and OrderResponse complex types. Say
|
|
that we would like to specify a lifting schema mapping notion on OrderRequest
|
|
complex type so that an XML instance of an OrderRequest complex type can be
|
|
mapped with the semantic data in the RDF graph shown in Listing 4.1-2. Then,
|
|
we would specify OrderRequest2Ont.xslt as a lifting schema mapping notion on
|
|
OrderRequest concept as shown in Listing 4.1-1 below.</p>
|
|
<pre><wsdl:description>
|
|
...
|
|
<wsdl:types>
|
|
<xsd:schema
|
|
targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#" elementFormDefault="qualified">
|
|
|
|
<xsd:element name="OrderRequest">
|
|
<xsd:complexType <strong>sawsdl:liftingSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/OrderRequest2Ont.xslt"</strong>>
|
|
<xsd:sequence>
|
|
<xsd:element name="firstName" type="xsd:string"/>
|
|
<xsd:element name="lastName" type="xsd:string"/>
|
|
<xsd:element name="item" type="item" minOccurs="1" maxOccurs="unbounded" />
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
|
|
<xsd:complexType name="item">
|
|
<xsd:all>
|
|
<xsd:element name="itemCode" type="xsd:string"/>
|
|
<xsd:element name="quantity" type="xsd:float"/>
|
|
<xsd:element name="dueDate" type="xsd:string"/>
|
|
<xsd:element name="billingInfo" type="xsd:POBilling"/>
|
|
</xsd:all>
|
|
</xsd:complexType>
|
|
|
|
<xsd:element name="OrderResponse" type="Confirmation"/>
|
|
<xsd:simpleType name="Confirmation">
|
|
<xsd:restriction base="xsd:string">
|
|
<xsd:enumeration value="Confirmed"/>
|
|
<xsd:enumeration value="Pending"/>
|
|
<xsd:enumeration value="Rejected"/>
|
|
</xsd:restriction>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="Order">
|
|
<wsdl:operation name="order" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="OrderRequest"/>
|
|
<wsdl:output element="OrderResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description>
|
|
...</pre>
|
|
|
|
<p><strong>Listing 4.1-1</strong>: A WSDL sample showing
|
|
<em>liftingSchemaMapping</em> notion. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService.wsdl</a>.</p>
|
|
|
|
<p>Listing 4.1-1 refers to
|
|
http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/OrderRequest2Ont.xslt.
|
|
This XSLT maps the elements of OrderRequest complex type with the
|
|
corresponding ones in the ontology shown in 4.1-2.</p>
|
|
<pre>@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
@prefix : <http://org1.example.com/ontologies/PurchaseOrder#> .
|
|
|
|
<http://org1.example.com/ontologies/PurchaseOrder#> rdf:type owl:Ontology .
|
|
|
|
:OrderRequest rdf:type owl:Class .
|
|
:hasLineItems rdf:type owl:ObjectProperty ;
|
|
rdfs:domain :OrderRequest ;
|
|
rdfs:range :LineItem .
|
|
:LineItem rdf:type owl:Class .
|
|
:hasPart rdf:type owl:ObjectProperty , owl:FunctionalProperty ;
|
|
rdfs:domain :LineItem ;
|
|
rdfs:range :Part .
|
|
:Part rdf:type owl:Class .
|
|
:hasPartCode rdf:type owl:ObjectProperty ;
|
|
rdfs:domain :Part ;
|
|
rdfs:range :PartNum .
|
|
:PartNum rdf:type owl:Class .
|
|
:hasLexicalRespresentation rdf:type owl:DatatypeProperty , owl:FunctionalProperty ;
|
|
rdfs:domain
|
|
[ rdf:type owl:Class ;
|
|
owl:unionOf (:Name :PartNum :Date)
|
|
] ;
|
|
rdfs:range xs:string .
|
|
:hasDueDate rdf:type owl:ObjectProperty ;
|
|
rdfs:domain :LineItem ;
|
|
rdfs:range :Date .
|
|
:Date rdf:type owl:Class .
|
|
:hasQuantity rdf:type owl:DatatypeProperty ;
|
|
rdfs:domain :LineItem ;
|
|
rdfs:range xs:float .
|
|
:hasBillingInfo rdf:type owl:DatatypeProperty ;
|
|
rdfs:domain :LineItem ;
|
|
rdfs:range xs:billingInfo .
|
|
:hasCustomer rdf:type owl:ObjectProperty , owl:FunctionalProperty ;
|
|
rdfs:domain :OrderRequest ;
|
|
rdfs:range :Customer .
|
|
:Customer rdf:type owl:Class .
|
|
:hasCustomerName rdf:type owl:ObjectProperty ;
|
|
rdfs:domain :Customer ;
|
|
rdfs:range :Name .
|
|
:Name rdf:type owl:Class .</pre>
|
|
|
|
<p><strong>Listing 4.1-2</strong>: A PurchaseOrder ontology. This ontology is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/PurchaseOrder.n3">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/PurchaseOrder.n3</a>.</p>
|
|
|
|
<p>Given a OrderRequest message (as shown in Listing 4.1-3) which corresponds
|
|
to the schema in Listing 4.1-1, the part where an XSLT would be of most value
|
|
in this example is where the values of firstName and lastName are
|
|
concatenated to match with the semantic data of the concept 'Name' in the
|
|
PurchaseOrder Ontology. A sample of such a transformation in XSLT is shown
|
|
in Listing 4.1-4 below.</p>
|
|
<pre><OrderRequest
|
|
xmlns="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#">
|
|
|
|
<firstName>John</firstName>
|
|
<lastName>Smith</lastName>
|
|
<item>
|
|
<itemCode>052053811</itemCode>
|
|
<quantity>12.0</quantity>
|
|
<dueDate>20061114</dueDate>
|
|
<billingInfo>88 Park Road, Lower Dangan, Galway, Ireland</billingInfo>
|
|
</item>
|
|
<item>
|
|
<itemCode>45001113</itemCode>
|
|
<quantity>10.0</quantity>
|
|
<dueDate>20061224</dueDate>
|
|
<billingInfo>70 Sandyhill Road, Shalthill, Galway, Ireland</billingInfo>
|
|
</item>
|
|
</OrderRequest></pre>
|
|
|
|
<p><strong>Listing 4.1-3</strong>: A sample XML data that adheres to
|
|
the WSDL in Listing 4.1-1. </p>
|
|
|
|
<pre><!DOCTYPE rdf:RDF
|
|
[<!ENTITY xs "http://www.w3.org/2001/XMLSchema#">
|
|
]
|
|
>
|
|
|
|
<xsl:transform version="2.0"
|
|
xmlns:order="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#"
|
|
xmlns:po="http://org1.example.com/ontologies/PurchaseOrder#"
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
xmlns:owl="http://www.w3.org/2002/07/owl#">
|
|
|
|
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes" />
|
|
<xsl:template match="/order:OrderRequest">
|
|
<rdf:RDF>
|
|
<owl:Ontology/>
|
|
<po:OrderRequest>
|
|
<po:hasCustomer>
|
|
<po:Customer>
|
|
<po:hasCustomerName>
|
|
<po:Name>
|
|
<po:hasLexicalRepresentation>
|
|
<xsl:value-of select="concat(
|
|
order:firstName,
|
|
' ',
|
|
order:lastName)"/>
|
|
</po:hasLexicalRepresentation>
|
|
</po:Name>
|
|
</po:hasCustomerName>
|
|
</po:Customer>
|
|
</po:hasCustomer>
|
|
<po:hasLineItems>
|
|
<po:LineItem>
|
|
<po:hasPart>
|
|
<po:Part>
|
|
<po:hasPartCode>
|
|
<po:PartNum>
|
|
<po:hasLexicalRepresentation>
|
|
<xsl:value-of select="order:item/order:itemCode"/>
|
|
</po:hasLexicalRepresentation>
|
|
</po:PartNum>
|
|
</po:hasPartCode>
|
|
</po:Part>
|
|
</po:hasPart>
|
|
<po:hasDueDate>
|
|
<po:Date>
|
|
<po:hasLexicalRepresentation>
|
|
<xsl:value-of select="order:item/order:dueDate"/>
|
|
</po:hasLexicalRepresentation>
|
|
</po:Date>
|
|
</po:hasDueDate>
|
|
<po:hasQuantity rdf:datatype="&xs;float">
|
|
<xsl:value-of select="order:item/order:quantity"/>
|
|
</po:hasQuantity>
|
|
<po:hasBillingInfo rdf:datatype="&xs;POBilling">
|
|
<xsl:value-of select="order:item/order:billingInfo"/>
|
|
</po:hasBillingInfo>
|
|
</po:LineItem>
|
|
<xsl:apply-templates select="order:OrderRequest" />
|
|
</po:hasLineItems>
|
|
</po:OrderRequest>
|
|
</rdf:RDF>
|
|
</xsl:template>
|
|
</xsl:transform> </pre>
|
|
|
|
<p><strong>Listing 4.1-4</strong>: An XSLT sample that concatenates the
|
|
values of firstName and lastName elements to form the semantic data of the
|
|
concept Name in the ontology. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/OrderRequest2Ont.xslt">http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/OrderRequest2Ont.xslt</a>.</p>
|
|
|
|
<p>A sample semantic data that is obtained by applying XSLT in Listing 4.1-4
|
|
to WSDL in Listing 4.1-3 is shown in Listing 4.1-5.</p>
|
|
<pre><!DOCTYPE rdf:RDF[
|
|
<!ENTITY xs "http://www.w3.org/2001/XMLSchema#" >
|
|
]
|
|
> <rdf:RDF
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
xmlns:owl="http://www.w3.org/2002/07/owl#"
|
|
xmlns="http://org1.example.com/ontologies/PurchaseOrder#"
|
|
xml:base="http://org1.example.com/ontologies/PurchaseOrder#">
|
|
|
|
<owl:Ontology />
|
|
<OrderRequest>
|
|
<hasLineItems>
|
|
<LineItem>
|
|
<hasPart>
|
|
<part>
|
|
<hasPartCode>
|
|
<partNum>
|
|
<hasLexicalRespresentation>052053811</hasLexicalRespresentation>
|
|
</partNum>
|
|
</hasPartCode>
|
|
</part>
|
|
</hasPart>
|
|
<hasDueDate>
|
|
<date>
|
|
<hasLexicalRespresentation>20061114</hasLexicalRespresentation>
|
|
</date>
|
|
</hasDueDate>
|
|
<hasQuantity rdf:datatype="&xs;float">12.0</hasQuantity>
|
|
<hasBillingInfo rdf:datatype="&xs;POBilling">88 Park Road, Lower Dangan, Galway, Ireland</hasBillingInfo>
|
|
</LineItem>
|
|
</hasLineItems>
|
|
<hasCustomer>
|
|
<Customer>
|
|
<hasCustomerName>
|
|
<Name>
|
|
<hasLexicalRespresentation>John Smith</hasLexicalRespresentation>
|
|
</Name>
|
|
</hasCustomerName>
|
|
</Customer>
|
|
</hasCustomer>
|
|
</OrderRequest>
|
|
</rdf:RDF> </pre>
|
|
|
|
<p><strong>Listing 4.1-5</strong>: A result semantic data that adheres
|
|
to the PurchaseOrder ontology. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/OrderRequest.rdf">http://www.w3.org/2002/ws/sawsdl/spec/examples/ontologies/OrderRequest.rdf</a>.</p>
|
|
</div>
|
|
|
|
<p>In this section, we have discussed how we can specify a
|
|
liftingSchemaMapping notion for the OrderRequest schema in Listing 4.1-1 to
|
|
generate an RDF instance as shown in 4.1-5. We can specify a
|
|
loweringSchemaMapping notion for the same OrderRequest schema as well. One
|
|
may want to specify both lifting and lowering schema mappings on a given
|
|
schema to ensure that the same schema can be used to represent both
|
|
requirements as well as capabilities. For example if the WSDL in 4.1-1 is
|
|
used to represent a clients' requirements, then a lifting schema mapping can
|
|
help translate the XML instances that correspond to OrderRequest schema into
|
|
the RDF data in Listing 4.1-2. Where as if the WSDL in 4.1-1 is used as an
|
|
advertisement, a lowering schema mapping would be useful because it can
|
|
enable a client (that has already translated its XML instance into the common
|
|
RDF semantic data using a liftingSchemaMapping) to map to its XML data.
|
|
Below, we illustrate two scenarios:</p>
|
|
<ul>
|
|
<li><strong>Roundtripping scenario</strong>: A scenario where both lifting
|
|
and lowering schema mappings are specified on the same WSDL schema (we
|
|
use Listing 4.1-1 for this)</li>
|
|
<li><strong>Web Service Invocation scenario</strong>: Second, where we
|
|
assume the WSDL in Listing 4.1-1 is that of a client/requester and
|
|
demonstrate how a loweringSchemaMapping when specified on another service
|
|
(advertisement) that shares the same ontology as the client could help
|
|
the client in Listing 4.1-1 to invoke this service.</li>
|
|
</ul>
|
|
|
|
<h2><a name="lowering" id="lowering">4.2 Lowering Schema Mapping</a></h2>
|
|
|
|
<p>As discussed, lowering schema mapping notion is used to map from RDF data
|
|
to XML data. First, we present adding loweringSchemaMapping to the same
|
|
OrderRequest XML schema discussed in Listing 4.1-1 (roundtripping scenario).
|
|
Sample of Listing 4.1-1 is shown below with an addition of
|
|
<em>loweringSchemaMapping</em>.</p>
|
|
<pre><xsd:element name="OrderRequest">
|
|
<xsd:complexType <strong>sawsdl:liftingSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/OrderRequest2Ont.xslt
|
|
sawsdl:loweringSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2OrderRequest.lowering"</strong>>
|
|
<xsd:sequence>
|
|
<xsd:element name="firstName" type="xsd:integer">John</xsd:element>
|
|
<xsd:element name="lastName" type="xsd:integer">Smith</xsd:element>
|
|
<xsd:element name="item" type="item" minOccurs="1" maxOccurs="unbounded" />
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element></pre>
|
|
|
|
<p><strong>Listing 4.2-1</strong>: A sample of OrderRequest complex type
|
|
from Listing 4.1-1 with loweringSchemaMapping added.</p>
|
|
|
|
<p>Below, we discuss what such a lowering schema mapping would look like. But
|
|
before that we have to introduce one more concept.</p>
|
|
|
|
<p>When specifying a <em>liftingSchemaMapping</em>, an XSLT transform can
|
|
create a specific XML that can be treated as the representation of semantic
|
|
data for an RDF/OWL ontology. While specifying
|
|
<em>loweringSchemaMapping</em>, on the other hand, it may not be clear what
|
|
format the semantic data of the ontology is expressed in (since there are
|
|
many variations of RDF semantic data representations in RDF/XML). To overcome this, one could use SPARQL language to query the
|
|
semantic data of the ontology to obtain a specific XML format for the
|
|
semantic data of the ontology so that it can then be used to formulate an
|
|
XSLT transform to obtain an XML that could correspond with the instance of a
|
|
Web service. A sample SPARQL query that could be used in
|
|
loweringSchemaMapping is shown in Listing 4.2-2 below.</p>
|
|
<pre><lowering>
|
|
<sparqlQuery>
|
|
PREFIX po: <http://org1.example.com/ontologies/PurchaseOrder#>
|
|
SELECT ?name ?partNum ?quantity ?dueDate ?billingInfo
|
|
WHERE {
|
|
?order po:hasCustomer ?customer .
|
|
?customer po:hasCustomerName ?custName .
|
|
?custName po:hasLexicalRespresentation ?name .
|
|
?order po:hasLineItems ?item .
|
|
?item po:hasQuantity ?quantity .
|
|
?item po:hasBillingInfo ?billingInfo .
|
|
?item po:hasDueDate ?Date .
|
|
?date po:hasLexicalRepresentation ?dueDate .
|
|
?item po:hasPart ?part .
|
|
?part po:hasPartCode ?code .
|
|
?code po:hasLexicalRespresentation ?partNum }
|
|
</sparqlQuery> </pre>
|
|
|
|
<p><strong>Listing 4.2-2</strong>: A SPARQL query on the semantic data (of an
|
|
ontology) to obtain an XML that could be used to specify XSLT transform in
|
|
loweringSchemaMapping</p>
|
|
|
|
<p>When SPARQL [<a href="#SPARQL">SPARQL</a>] is applied to the RDF graph in
|
|
Listing 4.1-5, the following XML will be generated as query answer.</p>
|
|
<pre><sparql xmlns="http://www.w3.org/2005/sparql-results#">
|
|
<head>
|
|
<variable name="quantity" />
|
|
<variable name="partNum" />
|
|
<variable name="name" />
|
|
<variable name="dueDate" />
|
|
<variable name="billingInfo" />
|
|
</head>
|
|
|
|
<results>
|
|
<result>
|
|
<binding name="quantity">
|
|
<literal>12.0</literal>
|
|
</binding>
|
|
|
|
<binding name="partNum">
|
|
<literal>052053811</literal>
|
|
</binding>
|
|
|
|
<binding name="name">
|
|
<literal>John Smith</literal>
|
|
</binding>
|
|
|
|
<binding name="billingInfo">
|
|
<literal>88 Park Road, Lower Dangan, Galway, Ireland</literal>
|
|
</binding>
|
|
|
|
<binding name="dueDate">
|
|
<literal>20061114</literal>
|
|
</binding>
|
|
|
|
</result>
|
|
</results>
|
|
</sparql></pre>
|
|
|
|
<p><strong>Listing 4.2-3</strong>: Result of applying SPARQL from Listing
|
|
4.2-2 to RDF in Listing 4.1-5.</p>
|
|
|
|
<p>Once an XML is obtained from SPARQL query an XSLT transform can be
|
|
created. Listing 4.2-4 shows such an XSLT transform.</p>
|
|
<pre> <xsl:transform version="2.0"
|
|
xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
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>
|
|
<xsl:variable name="fullName">
|
|
<xsl:value-of select="sp:results/sp:result[position()=1]/sp:binding[@name='name']/sp:literal"/>
|
|
</xsl:variable>
|
|
<po:firstName>
|
|
<xsl:value-of select="substring-before($fullName,' ')" />
|
|
</po:firstName>
|
|
<po:lastName>
|
|
<xsl:value-of select="substring-after($fullName,' ')" />
|
|
</po:lastName>
|
|
<xsl:apply-templates select="sp:results/sp:result" />
|
|
</po:OrderRequest>
|
|
</xsl:template>
|
|
<xsl:template match="sp:result">
|
|
<po:"item">
|
|
<po:itemCode>
|
|
<xsl:value-of select="sp:binding[@name='partNum']/sp:literal" />
|
|
</po:itemCode>
|
|
<po:quantity>
|
|
<xsl:value-of select="sp:binding[@name='quantity']/sp:literal" />
|
|
</po:quantity>
|
|
<po:dueDate>
|
|
<xsl:value-of select="sp:binding[@name='dueDate']/sp:literal" />
|
|
</po:dueDate>
|
|
<po:billingInfo>
|
|
<xsl:value-of select="sp:binding[@name='billingInfo']/sp:literal" />
|
|
</po:billingInfo>
|
|
</po:item>
|
|
</xsl:template>
|
|
</xsl:transform>
|
|
</lowering></pre>
|
|
|
|
<p><strong>Listing 4.2-4</strong>: An XSLT sample that shows
|
|
loweringSchemaMapping notion. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2OrderRequest.lowering">http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2OrderRequest.lowering</a>.</p>
|
|
|
|
<p>The result of executing the above XSLT (in Listing 4.2-4) is shown below
|
|
in Listing 4.2-5. As can be noted, this XML corresponds to the OrderRequest
|
|
complex type schema. With this, we have completed a full cycle of lifting and
|
|
lowering on the same schema to and from an RDF data.</p>
|
|
<pre><po:OrderRequest
|
|
xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#"
|
|
xmlns:sp="http://www.w3.org/2005/sparql-results#"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
|
|
<po:firstName>John</po:firstName>
|
|
<po:lastName>Smith</po:lastName>
|
|
<po:item>
|
|
<po:itemCode>052053811</po:itemCode>
|
|
<po:quantity>12.0</po:quantity>
|
|
<po:dueDate>20061114</po:dueDate>
|
|
<po:billingInfo>88 Park Road, Lower Dangan, Galway, Ireland</po:billingInfo>
|
|
</po:item>
|
|
</po:OrderRequest> </pre>
|
|
|
|
<p><strong>Listing 4.2-5</strong>: Result of applying XSLT from Listing 4.2-4
|
|
to SPARQL result of Listing 4.2-3.</p>
|
|
|
|
<p>In the remaining part of this section, we will illustrate the second
|
|
scenario (Web service invocation scenario). In this scenario, we will use
|
|
another service/WSDL as the advertised service that the client in Listing
|
|
4.1-1 is trying to invoke. Such an advertisement service is shown below in
|
|
Listing 4.2-6. As you can notice, the difference between this service and the
|
|
client in Listing 4.1-1 is that in this service in MyOrderRequest schema, the
|
|
format for the names is different from the one provided by the client. The
|
|
client can supply a 'firstName' and 'lastName' where as this advertisement
|
|
service only requires an initial for firstName and a last name- which
|
|
requires an additional level of data translation/manipulation.</p>
|
|
<pre><wsdl:description>
|
|
...
|
|
<wsdl:types>
|
|
<xsd:schema
|
|
targetNamespace="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/MyPurchaseOrder#" elementFormDefault="qualified">
|
|
|
|
<xsd:element name="MyOrderRequest">
|
|
<xsd:complexType
|
|
<strong>sawsdl:loweringSchemaMapping="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2MyOrderRequest.lowering"</strong>>
|
|
<xsd:sequence>
|
|
<xsd:element name="firstinitial" type="xsd:string"/>
|
|
<xsd:element name="lastName" type="xsd:string"/>
|
|
<xsd:element name="item" type="item" minOccurs="1" maxOccurs="unbounded" />
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
|
|
<xsd:complexType name="item">
|
|
<xsd:all>
|
|
<xsd:element name="itemCode" type="xsd:string"/>
|
|
<xsd:element name="quantity" type="xsd:float"/>
|
|
<xsd:element name="dueDate" type="xsd:string"/>
|
|
<xsd:element name="billingInfo" type="xsd:POBilling"/>
|
|
</xsd:all>
|
|
</xsd:complexType>
|
|
|
|
<xsd:element name="OrderResponse" type="Confirmation"/>
|
|
<xsd:simpleType name="Confirmation">
|
|
<xsd:restriction base="xsd:string">
|
|
<xsd:enumeration value="Confirmed"/>
|
|
<xsd:enumeration value="Pending"/>
|
|
<xsd:enumeration value="Rejected"/>
|
|
</xsd:restriction>
|
|
</xsd:simpleType>
|
|
</xsd:schema>
|
|
</wsdl:types>
|
|
|
|
<wsdl:interface name="Order">
|
|
<wsdl:operation name="order" pattern="http://www.w3.org/ns/wsdl/in-out">
|
|
<wsdl:input element="MyOrderRequest"/>
|
|
<wsdl:output element="OrderResponse"/>
|
|
</wsdl:operation>
|
|
</wsdl:interface>
|
|
</wsdl:description>
|
|
...</pre>
|
|
|
|
<p><strong>Listing 4.2-6</strong>: A WSDL sample of an advertisement service
|
|
with loweringSchemaMapping notion. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/MyPurchaseOrder.wsdl">http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/MyPurchaseOrder.wsdl</a>.</p>
|
|
|
|
<p>To specify the lowering schema mapping for the schema in Listing 4.2-6 we
|
|
could use the same SPARQL query as presented in Listing 4.2-2 to obtain the
|
|
same result as in Listing 4.2-3. However, we need to supply a slightly
|
|
altered version of a XSLT transform to extract only the first initial from
|
|
the firstName. The modified XSLT transform for Ont2MyOrderRequest.xslt is
|
|
shown below in Listing 4.2-7.</p>
|
|
<pre> <xsl:transform version="2.0"
|
|
xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
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>
|
|
<xsl:variable name="fullName">
|
|
<xsl:value-of select="sp:results/sp:result[position()=1]/sp:binding[@name='name']/sp:literal"/>
|
|
</xsl:variable>
|
|
<po:firstinitial>
|
|
<xsl:value-of select="substring(substring-before($fullName,' '),1,1)" />
|
|
</po:firstinitial>
|
|
<po:lastName>
|
|
<xsl:value-of select="substring-after($fullName,' ')" />
|
|
</po:lastName>
|
|
<xsl:apply-templates select="sp:results/sp:result" />
|
|
</po:OrderRequest>
|
|
</xsl:template>
|
|
<xsl:template match="sp:result">
|
|
<po:item>
|
|
<po:itemCode>
|
|
<xsl:value-of select="sp:binding[@name='partNum']/sp:literal" />
|
|
</po:itemCode>
|
|
<po:quantity>
|
|
<xsl:value-of select="sp:binding[@name='quantity']/sp:literal" />
|
|
</po:quantity>
|
|
<po:dueDate>
|
|
<xsl:value-of select="sp:binding[@name='dueDate']/sp:literal" />
|
|
</po:dueDate>
|
|
<po:billingInfo>
|
|
<xsl:value-of select="sp:binding[@name='billingInfo']/sp:literal" />
|
|
</po:billingInfo>
|
|
</po:item>
|
|
</xsl:template>
|
|
</xsl:transform>
|
|
</lowering></pre>
|
|
|
|
<p><strong>Listing 4.2-7</strong>: An XSLT sample that shows
|
|
loweringSchemaMapping notion for an XML instance that adheres to
|
|
MyOrderRequest schema in Listing 4.2-6. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2MyOrderRequest.xslt">http://www.w3.org/2002/ws/sawsdl/spec/examples/mapping/Ont2MyOrderRequest.xslt</a>.</p>
|
|
|
|
<p>The corresponding XML data that can be obtained by executing the transform
|
|
in Listing 4.2-7 is shown in Listing 4.2-8.</p>
|
|
<pre><po:OrderRequest
|
|
xmlns:po="http://www.w3.org/2002/ws/sawsdl/spec/examples/wsdl/PurchaseOrderService#"
|
|
xmlns:sp="http://www.w3.org/2005/sparql-results#"
|
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
|
|
<po:firstinitial>J</po:firstinitial>
|
|
<po:lastName>Smith</po:lastName>
|
|
|
|
<po:item>
|
|
<po:itemCode>052053811</po:itemCode>
|
|
<po:quantity>12.0</po:quantity>
|
|
<po:dueDate>20061114</po:dueDate>
|
|
<po:billingInfo>88 Park Road, Lower Dangan, Galway, Ireland</po:billingInfo>
|
|
</po:item>
|
|
</po:OrderRequest> </pre>
|
|
|
|
<p><strong>Listing 4.2-8</strong>: Result of applying XSLT from Listing 4.2-7
|
|
to SPARQL result of Listing 4.2-3.</p>
|
|
|
|
<p>In summary, the lifting and lower schema mapping notions together enable
|
|
the transformation of data between Web services which can be an important
|
|
part of enabling the invocation of Web services.</p>
|
|
|
|
<p>Just as multiple annotations can be associated using modelReference
|
|
concept, multiple schema mappings can be associated with elements as well.
|
|
When multiple URIs are specified on liftingSchemaMapping or
|
|
loweringSchemaMapping, SAWSDL specifies that the schema mappings they
|
|
reference are to be treated as alternatives, i.e. the client processor should
|
|
choose one of them to apply, and the choice is fully at the client
|
|
processor's discretion. For example, a mapping can be selected based on what
|
|
mapping language the processor supports (different alternatives can use
|
|
different languages), based on the availability of the mapping document, or
|
|
by other preferences.Just as SAWSDL does not prescribe any particular
|
|
ontology representation language for specifying modelReferences, it does not
|
|
prescribe any particular schema mapping representation language. In this user
|
|
guide XSLT and SPARQL are used for illustrative purposes. Users are welcome to use
|
|
transformation language of their choice to specify lifting and lowering
|
|
schema mappings. Appendix B presents another example of such a language and
|
|
additional examples using that language.</p>
|
|
|
|
<h2><a name="conclusions" id="conclusions">5. Conclusions</a></h2>
|
|
|
|
<p>The SAWSDL Usage Guide is an accompanying document to <a
|
|
href="http://www.w3.org/TR/sawsdl/">SAWSDL</a> specification. This guide
|
|
presented examples to illustrate how to associate semantic annotations to a
|
|
Web service (represented in SAWSDL format) and how to use these annotations
|
|
for classifying, discovering, matching, composing, and invoking Web services.
|
|
Arguably, this usage guide presents only some of the ways in which the
|
|
annotations that can be associated with a WSDL document can be used.</p>
|
|
|
|
<h2><a name="references" id="references">6. References</a></h2>
|
|
<dl>
|
|
<dt>[<a name="NAICS" id="NAICS">NAICS</a>]</dt>
|
|
<dd><a href="http://www.census.gov/epcd/www/naics.html"><cite>North
|
|
American Industry Classification System.</cite></a> Available at
|
|
http://www.census.gov/epcd/www/naics.html.</dd>
|
|
<dt><a name="OWL" id="OWL">[OWL]</a></dt>
|
|
<dd><a href="http://www.w3.org/TR/2004/REC-owl-ref-20040210/"><cite>OWL
|
|
Web Ontology Language Reference</cite></a>, Mike Dean and Guus
|
|
Schreiber, Editors. W3C Recommendation, 10 February
|
|
2004,http://www.w3.org/TR/2004/REC-owl-ref-20040210/.<br />
|
|
<a href="http://www.w3.org/TR/owl-ref/">Latest version</a> available at
|
|
http://www.w3.org/TR/owl-ref/.</dd>
|
|
<dt>[<a name="RDF" id="RDF">RDF</a>]</dt>
|
|
<dd><a href="http://www.w3.org/TR/rdf-syntax-grammar/"><cite>Resource
|
|
Description Framework</cite></a>, Dave Beckett, Editor. World Wide Web
|
|
Consortium, 10th February 2004. This version is
|
|
http://www.w3.org/TR/rdf-syntax-grammar/</dd>
|
|
<dt>[<a name="RDFTurtle" id="RDFTurtle">RDF Turtle</a>]</dt>
|
|
<dd><a href="http://www.dajobe.org/2004/01/turtle/"><cite>Terse RDF
|
|
Triple Language</cite></a>, Dave Beckett, Editor. World Wide Web
|
|
Consortium, 4th April 2004. This version is
|
|
http://www.dajobe.org/2004/01/turtle/</dd>
|
|
<dt>[<a name="SAWSDL" id="SAWSDL">SAWSDL</a>]</dt>
|
|
<dd><a
|
|
href="http://www.w3.org/TR/2006/WD-sawsdl-20060928/"><cite>Semantic
|
|
Annotations for WSDL</cite></a>, Joel Farrell and Holger Lauson,
|
|
Editors. World Wide Web Consortium, 28th Sept 2006. This version is
|
|
http://www.w3.org/TR/2006/WD-sawsdl-20060928/.</dd>
|
|
<dt>[<a name="SPARQL" id="SPARQL">SPARQL</a>]</dt>
|
|
<dd><a href="http://www.w3.org/TR/rdf-sparql-query/"><cite>SPARQL Query
|
|
Language for RDF</cite></a>, Eric Prud'hommeaux and Andy Seaborne,
|
|
Editors. World Wide Web Consortium, 6 April 2006. This version is
|
|
http://www.w3.org/TR/2006/CR-rdf-sparql-query-20060406/. The <a
|
|
href="http://www.w3.org/TR/rdf-sparql-query/">latest version</a> is
|
|
available at http://www.w3.org/TR/rdf-sparql-query/.</dd>
|
|
<dt>[<a name="SWRL" id="SWRL">SWRL</a>]</dt>
|
|
<dd><a href="http://www.w3.org/Submission/SWRL/"><cite>SWRL: A Semantic Web Rule Language Combining OWL and RuleML</cite></a>, Ian Horrocks, Peter F. Patel-Schneider, Harold Boley, Said Tabet, Benjamin Grosof, Mike Dean, Authors. World Wide Web Consortium, 21 May 2004. This version is http://www.w3.org/Submission/SWRL/.</dd>
|
|
<dt>[<a name="UDDI1" id="UDDI1">UDDI</a>]</dt>
|
|
<dd><a href="http://uddi.org/pubs/uddi_v3.htm"><cite>UDDI Version
|
|
3.0.2</cite></a>, 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.</dd>
|
|
<dt>[<a name="WSDL2" id="WSDL2">WSDL 2.0</a>]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/2006/CR-wsdl20-20060327/">Web
|
|
Services Description Language (WSDL) Version 2.0 Part 1: Core
|
|
Language</a></cite>, 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 <a
|
|
href="http://www.w3.org/TR/wsdl20/">latest version of "Web Services
|
|
Description Language (WSDL) Version 2.0 Part 1: Core Language"</a> is
|
|
available at http://www.w3.org/TR/wsdl20.</dd>
|
|
<dt>[<a name="WSDL-S" id="WSDL-S">WSDL-S</a>]</dt>
|
|
<dd><cite><a href="http://www.w3.org/Submission/WSDL-S/">Web Service Semantics - WSDL-S</a></cite>, Rama Akkiraju,
|
|
Joel Farrell, John Miller, Meenakshi Nagarajan, Marc-Thomas Schmidt,
|
|
Amit Sheth, and Kunal Verma, Authors. World Wide Web Consortium, 7
|
|
November 2005. This version is http://www.w3.org/Submission/WSDL-S/.</dd>
|
|
<dt>[<a name="WSML" id="WSML">WSML</a>]</dt>
|
|
<dd><a href="http://www.w3.org/Submission/WSML/"><cite>Web Service Modeling Language (WSML)</cite></a>, Jos de Bruijn, Holger Lausen, Editors. World Wide Web Consortium, 3 June 2005. This version is http://www.w3.org/Submission/WSML/.</dd>
|
|
<dt>[<a name="XSLT" id="XSLT">XSLT</a>]</dt>
|
|
<dd><a href="http://www.w3.org/TR/xslt20/"><cite>XSL Transformations
|
|
(XSLT) Version 2.0</cite></a>, Michael Kay, Editor. World Wide Web
|
|
Consortium, 3 Nov 2005. This version is
|
|
http://www.w3.org/TR/2005/CR-xslt20-20051103/. The <a
|
|
href="http://www.w3.org/TR/xslt20/">latest version</a> is available at
|
|
http://www.w3.org/TR/xslt20/.</dd>
|
|
</dl>
|
|
|
|
<h2><a name="conditionlistings" id="conditionlistings">A. Condition
|
|
Expression Listings</a></h2>
|
|
|
|
<p>This appendix contains listings that formalize the rules from <a
|
|
href="#conditions">Section 3.7</a>. However, we do not guarantee validity or
|
|
correctness of these particular listings; they are provided here only for
|
|
illustration.</p>
|
|
|
|
<p> Listing A-1 captures the shipment conditions ("inputRule") in <a href="#SWRL">SWRL</a>
|
|
abstract syntax. Listing A-2 presents the same rule in human-readable syntax
|
|
and Listing A-3 encodes it, together with the output rules, in XML concrete syntax. The listing also
|
|
contains an OWL ontology which represents the concepts such as 'shipment',
|
|
'deliveryContinent', 'country' etc. that are used in the rule. Listing A-4 presents
|
|
the same input rule in <a href="#WSML">WSML</a> syntax. Finally listings A-5 and
|
|
A-6 capture the output rules in SWRL abstract syntax and in a human-readable
|
|
syntax.</p>
|
|
|
|
<pre>
|
|
; rule inputRule
|
|
|
|
Implies (
|
|
Antecedent
|
|
(
|
|
swrlb:subtractDayTimeDurations(D-variable(orderedSince) D-variable(deliveryDay) D-variable(orderDay))
|
|
swrlb:greaterThanOrEqual(D-variable(orderedSince) 2)
|
|
swrlb:greaterThanOrEqual(D-variable(deliveryHour) 7)
|
|
swrlb:lessThanOrEqual(D-variable(deliveryHour) 20)
|
|
swrlb:member(I-variable(deliveryContinent) (http://en.wikipedia.org/wiki/North_america http://en.wikipedia.org/wiki/Europe))
|
|
swrlb:lessThanOrEqual(D-variable(packageWeight) 50)
|
|
)
|
|
Consequent(shipment(I-variable(package))))
|
|
</pre>
|
|
|
|
<p>Listing A-1: A SWRL abstract syntax representation of the inputRule. This example is also available at: <a href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRuleAbstract.swrlx">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRuleAbstract.swrlx</a>.
|
|
</p>
|
|
<pre>
|
|
; rule inputRule
|
|
|
|
(swrlb:subtractDayTimeDurations(?orderedSince, ?deliveryDay, ?orderDay) ^
|
|
swrlb:greaterThanOrEqual(?orderedSince, 2) ^
|
|
swrlb:greaterThanOrEqual(?deliveryHour, 7) ^
|
|
swrlb:lessThanOrEqual(?deliveryHour, 20) ^
|
|
swrlb:member(?deliveryContinent, (http://en.wikipedia.org/wiki/North_america http://en.wikipedia.org/wiki/Europe)) ^
|
|
swrlb:lessThanOrEqual(?packageWeight, 50)) => shippment(?package)
|
|
</pre>
|
|
|
|
<p>Listing A-2: A SWRL human-readable syntax representation of the rule as described above. This example is also available at: <a href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRuleHR.swrlx">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRuleHR.swrlx</a>.
|
|
</p>
|
|
|
|
<pre>
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- <i>background knowledge about shipment </i> -->
|
|
|
|
<rdf:RDF>
|
|
|
|
<owl:Class rdf:ID="shipment"/>
|
|
<owl:Class rdf:ID="order"/>
|
|
<owl:Class rdf:ID="package"/>
|
|
<owl:Class rdf:ID="deliveryContinent"/>
|
|
<owl:Class rdf:ID="memberCountries">
|
|
<rdfs:subClassOf rdf:resource="#deliveryContinent">
|
|
</owl:Class>
|
|
|
|
<owl:DatatypeProperty rdf:ID="orderDay">
|
|
<rdfs:domain rdf:resource="#shipment"/>
|
|
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#date"/>
|
|
</owl:DatatypeProperty>
|
|
|
|
<owl:DatatypeProperty rdf:ID="deliveryDay">
|
|
<rdfs:domain rdf:resource="#shipment"/>
|
|
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#date"/>
|
|
</owl:DatatypeProperty>
|
|
|
|
<owl:DatatypeProperty rdf:ID="packageWeight">
|
|
<rdfs:domain rdf:resource="#shipment"/>
|
|
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int"/>
|
|
</owl:DatatypeProperty>
|
|
|
|
<owl:DatatypeProperty rdf:ID="deliveryHour">
|
|
<rdfs:domain rdf:resource="#shipment"/>
|
|
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
|
|
</owl:DatatypeProperty>
|
|
|
|
<owl:ObjectProperty rdf:ID="deliveryContinent">
|
|
<rdfs:domain rdf:resource="#shipment"/>
|
|
<rdfs:range rdf:resource="#country"/>
|
|
</owl:ObjectProperty>
|
|
|
|
<owl:ObjectProperty rdf:ID="hasOrder">
|
|
<rdfs:domain rdf:resource="#package"/>
|
|
<rdfs:range rdf:resource="#order"/>
|
|
</owl:ObjectProperty>
|
|
|
|
<ruleml:imp rdf:ID="inputRule">
|
|
<ruleml:_rlab ruleml:href="#inputRule"/>
|
|
<owlx:Annotation>
|
|
<owlx:Documentation>
|
|
Only packages weighing 50 lbs or less can be shipped.
|
|
Shipping is possible only in North America, and Europe.
|
|
Delivery is possible only between 7am and 8pm.
|
|
Delivery has to be ordered at least 2 working days in advance.
|
|
</owlx:Documentation>
|
|
</owlx:Annotation>
|
|
<ruleml:_body>
|
|
<!-- <i>compute waiting time: diff of deliveryDate and orderDate</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:subtractDates">
|
|
<ruleml:var>orderedSince</ruleml:var>
|
|
<ruleml:var>deliveryDay</ruleml:var>
|
|
<ruleml:var>orderDay</ruleml:var>
|
|
</swrlx:builtinAtom>
|
|
|
|
<!-- <i>waiting time should be greater-than 2</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:greaterThanOrEqual">
|
|
<ruleml:var>orderedSince</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:int">2</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
|
|
<!-- <i>only delivery between 07:00-20:00</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:greaterThanOrEqual">
|
|
<ruleml:var>deliveryHour</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:time">T7H</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:lessThanOrEqual">
|
|
<ruleml:var>deliveryHour</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:time">T20H</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
|
|
<!-- <i>only deliver things below 50 pounds</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:lessThanOrEqual">
|
|
<ruleml:var>packageWeight</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:int">50</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
|
|
<!-- <i>compute places where package can be delivered</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:listConcate">
|
|
<ruleml:var>memberCountries</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="rdf:list">http://en.wikipedia.org/wiki/North_america</owlx:DataValue>
|
|
<owlx:DataValue owlx:datatype="rdf:list">http://en.wikipedia.org/wiki/Europe</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
|
|
<!-- <i>only delivery to Europe or NorthAmerica</i> -->
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:member">
|
|
<ruleml:var>deliveryContinent</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="rdf:list">memberCountries</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
</ruleml:_body>
|
|
</ruleml:imp>
|
|
|
|
<ruleml:imp>
|
|
<ruleml:_rlab ruleml:href="#outputRule1"/>
|
|
<owlx:Annotation>
|
|
<owlx:Documentation>
|
|
If more than 50lbs was ordered, order is taken only for 50lbs
|
|
</owlx:Documentation>
|
|
</owlx:Annotation>
|
|
<ruleml:_body>
|
|
<swrlx:individualPropertyAtom swrlx:property="hasOrder">
|
|
<ruleml:var>order</ruleml:var>
|
|
<ruleml:var>packageWeight</ruleml:var>
|
|
</swrlx:individualPropertyAtom>
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:greaterThan">
|
|
<ruleml:var>packageWeight</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:int">50</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
</ruleml:_body>
|
|
<ruleml:_head>
|
|
<swrlx:individualPropertyAtom swrlx:property="hasOrder">
|
|
<ruleml:var>order</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:int">50</owlx:DataValue>
|
|
</swrlx:individualPropertyAtom>
|
|
</ruleml:_head>
|
|
</ruleml:imp>
|
|
|
|
<ruleml:imp>
|
|
<ruleml:_rlab ruleml:href="#outputRule2"/>
|
|
<owlx:Annotation>
|
|
<owlx:Documentation>
|
|
ItemConfirmation # can be tracked only for 30 days after the order was placed
|
|
</owlx:Documentation>
|
|
</owlx:Annotation>
|
|
<ruleml:_body>
|
|
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:subtractDates">
|
|
<ruleml:var>trackingTime</ruleml:var>
|
|
<ruleml:var>orderDay</ruleml:var>
|
|
<ruleml:var>today</ruleml:var>
|
|
</swrlx:builtinAtom>
|
|
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:greaterThanOrEqual">
|
|
<ruleml:var>trackingTime</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:time">T30H</owlx:DataValue>
|
|
</swrlx:builtinAtom>
|
|
</ruleml:_body>
|
|
<ruleml:_head>
|
|
<swrlx:individualPropertyAtom swrlx:property="itemConfirmationNo">
|
|
<ruleml:var>order</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:String">null</owlx:DataValue>
|
|
</swrlx:individualPropertyAtom>
|
|
</ruleml:_head>
|
|
</ruleml:imp>
|
|
|
|
<ruleml:imp>
|
|
<ruleml:_rlab ruleml:href="#outputRule3"/>
|
|
<owlx:Annotation>
|
|
<owlx:Documentation>
|
|
If the order does not arrive the shipping location within the required date,
|
|
no charge will be made to the account.
|
|
</owlx:Documentation>
|
|
</owlx:Annotation>
|
|
<ruleml:_body>
|
|
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:subtractDates">
|
|
<ruleml:var>arrivalDay</ruleml:var>
|
|
<ruleml:var>deliveryDay</ruleml:var>
|
|
<ruleml:var>today</ruleml:var>
|
|
</swrlx:builtinAtom>
|
|
|
|
<swrlx:builtinAtom swrlx:builtin="swrlb:greaterThan">
|
|
<ruleml:var>arrivalDay</ruleml:var>
|
|
<ruleml:var>deliveryDay</ruleml:var>
|
|
</swrlx:builtinAtom>
|
|
</ruleml:_body>
|
|
<ruleml:_head>
|
|
<swrlx:individualPropertyAtom swrlx:property="payment">
|
|
<ruleml:var>order</ruleml:var>
|
|
<owlx:DataValue owlx:datatype="xsd:boolean">false</owlx:DataValue>
|
|
</swrlx:individualPropertyAtom>
|
|
</ruleml:_head>
|
|
</ruleml:imp>
|
|
</rdf:RDF>
|
|
</pre>
|
|
|
|
<p>Listing A-3: A SWRL XML represention of the rules. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRule.swrlx">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRule.swrlx</a>.
|
|
</p>
|
|
<pre>
|
|
wsmlVariant _"http://www.wsmo.org/wsml/wsml-syntax/wsml-full"
|
|
|
|
namespace { _"http://example.org#",
|
|
dc _"http://purl.org/dc/elements/1.1#",
|
|
onto _"http://example.org/ontology#",
|
|
wsml _"http://www.wsmo.org/wsml/#"
|
|
}
|
|
|
|
ontology _"http://www.example.org/ontologies/example"
|
|
|
|
axiom inputRule definedBy
|
|
?p[packageWeight hasValue ?w, address hasValue ?a] memberOf onto#package
|
|
and
|
|
wsml#lessEqual(?w,50)
|
|
and
|
|
?a[deliveryContinent hasValue ?c] memberOf onto#address
|
|
and
|
|
(wsml#equal(?c, "Europe") or wsml#equal(?c, "North America"))
|
|
and
|
|
?d[date hasValue ?dt] memberOf onto#delivery
|
|
and
|
|
?dt[deliveryHour hasValue ?h, day hasValue ?deliveryDay] memberOf onto#date
|
|
and
|
|
wsml#greaterEqual(?h,"07:00")
|
|
and
|
|
wsml#lessEqual(?h,"20:00")
|
|
and
|
|
?order[day hasValue ?orderDay] memberOf onto#order
|
|
and
|
|
numericGreaterThan(wsml#subtract\-dateTimes\-yielding\-day(?deliveryDay, ?orderDay),2).
|
|
</pre>
|
|
<p>Listing A-4: A WSML represention of the rule as described above. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRule.wsml">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentRule.wsml</a>.
|
|
</p>
|
|
<pre>
|
|
; rule outputRule1
|
|
Implies (
|
|
Antecedent
|
|
(
|
|
order(I-variable(order))
|
|
swrlb:greaterThan(D-variable(packageWeight) 50)
|
|
)
|
|
Consequent(swrlb:equal(D-variable(packageWeight), 50))
|
|
|
|
; rule outputRule2
|
|
Implies (
|
|
Antecedent
|
|
(
|
|
order(I-variable(order))
|
|
hasItemConformation(I-variable(order) I-variable(itemConformationNo))
|
|
swrlb:lessThanOrEqual(D-variable(orderDay), 30)
|
|
)
|
|
Consequent(tracking(I-variable(itemConfirmationNo) false))
|
|
|
|
; rule outputRule3
|
|
Implies (
|
|
Antecedent
|
|
(
|
|
order(I-variable(order))
|
|
hasItemConformation(I-variable(order) I-variable(itemConformationNo))
|
|
hasAccount(I-variable(customer) I-variable(account)))
|
|
delivery(I-variable(package), null)
|
|
)
|
|
Consequent(charge(I-variable(account), nil))
|
|
</pre>
|
|
<p>Listing A-5: A SWRL abstract syntax representing the output rules. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentEffectRuleAbstract.swrlx">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentEffectRuleAbstract.swrlx</a>.
|
|
</p>
|
|
|
|
<pre>
|
|
; rule outputRule1
|
|
(order(?order)
|
|
^ swrlb:greaterThan(D-variable(packageWeight) 50))
|
|
=> swrlb:equal(D-variable(packageWeight), 50)
|
|
|
|
; rule outputRule2
|
|
(order(?order)
|
|
^ hasItemContirmation(?order, ?itemConfirmationNo)
|
|
^ swrlb:lessThanOrEqual(?orderDay, 30))
|
|
=> tracking(?itemConfirmationNo, false)
|
|
|
|
; rule outputRule3
|
|
(order(?order)
|
|
^hasItemConfirmation(?order, ?itemConfrimationNo)
|
|
^hasAccount(?customer, ?account)
|
|
^delivery(?package, null))
|
|
=> charge(?account, nil)
|
|
</pre>
|
|
|
|
<p>Listing A-6: A SWRL human-readable syntax representing the output rules as described above. This example is also available at: <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentEffectRuleHR.swrlx">http://www.w3.org/2002/ws/sawsdl/spec/examples/rule/shipmentEffectRuleHR.swrlx</a>.
|
|
</p>
|
|
|
|
<h2><a name="acknowledgements" id="acknowledgements">B. Acknowledgements</a></h2>
|
|
|
|
<p>This document is the work of the <a
|
|
href="http://www.w3.org/2002/ws/sawsdl/">W3C Semantic Annotations for Web
|
|
Service Description Language Working Group</a>.</p>
|
|
|
|
<p>Members of the Working Group are (at the time of writing, and in
|
|
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.), 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), 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 National
|
|
University 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).</p>
|
|
|
|
</body>
|
|
</html>
|