AI Planning For Automating Web Service Composition in Tourism Domain
AI Planning For Automating Web Service Composition in Tourism Domain
AI Planning For Automating Web Service Composition in Tourism Domain
Automating
Web Service Composition
in Tourism Domain
Husniza Husni
Web services are changing the way how online business operates, especially in
tourism domain. Typically, existing Web services are built individually as atomic
services. The rapid growth of Web services has created the need for Web service
composition so that clients can compose atomic services to achieve more complex
tasks. Thus, to ease the process, automation is important. Automation means
that the service composition is done with less or no user interference. Hence,
we propose a framework to automatically compose Web services using SHOP2
planner. SHOP2 is a planner that implements AI planning technique, called Hi-
erarchical Task Network (HTN). We propose and implement a framework to com-
pose services available from the Australian Tourism Data Warehouse (ATDW)
and present the example execution results. We also outline some drawbacks of
our approach, identify open problems, and suggest future work to improve the
framework.
ii
Acknowledgements
iii
Contents
Abstract ii
Acknowledgements iii
1 Introduction 1
1.1 Problem Definition and Motivation . . . . . . . . . . . . . . . . . 1
1.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
iv
3.3 Case Study: Visiting Perth . . . . . . . . . . . . . . . . . . . . . . 22
3.4 The Design of the Framework . . . . . . . . . . . . . . . . . . . . 22
3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 The Implementation 25
4.1 WSDL Description of ATDW . . . . . . . . . . . . . . . . . . . . 25
4.2 Inside SHOP2: The HTN Planning . . . . . . . . . . . . . . . . . 28
4.3 The Implementation in Details . . . . . . . . . . . . . . . . . . . . 31
4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
v
A.4 Research Timeline . . . . . . . . . . . . . . . . . . . . . . . . . . 49
B Glossary 50
vi
List of Figures
vii
CHAPTER 1
Introduction
1
hotel reservation, road map, car rental, etc. These atomic Web services could be
composed together to improve the process of planning and arranging for holidays.
Of course, composing Web services is not as easy and simple as it may seems.
This is due to the complexities in the Web services domain. The complexities
lie in describing the Web services so that they are composable, specifying the
flow, i.e. the plan, for composition, and coping with the dynamic changes of
Web services through time. So far, there are two approaches for Web service
composition—the industry approach and the semantic Web approach [32]. The
industry describes Web services in Web Service Description Language (WSDL)1
and uses flow control languages to specify the flow of Web service composition.
Example of such languages are like WSFL, XLANG and BPEL4WS [31, 32] for
normal Web services. Whilst semantic Web services are described by languages
such as DAML-OIL [37] and OWL-S [16] as discussed more in Chapter 2. The se-
mantic Web community resorted in using AI planning for generating composition
plans to achieve the automation of plan generation. Automation here means that
there is less, or perhaps no user interference in generating plans for composition.
Unfortunately, a large amount of current available Web services are described in
WSDL. Semantic Web services are still yet to come. So far, they are still under
research and development and have not yet been deployed, in a reasonable scale,
in real-world.
Recent works in Web service composition only proposed how AI planning can
be used for semantic Web service composition. No work on the actual implemen-
tation has been reported. This is largely to do with the lack of available semantic
Web services. Works detailing the pros and cons of using AI planning for service
composition are also scarce. On the other hand, normal Web services are rela-
tively widely available, especially with the support from the Australian Tourism
Data Warehouse (ATDW). We can test out the AI planning ideas on normal
Web services. So far, there is no reported work on implementing automated
service composition using AI planning with normal, WSDL-based Web services.
Therefore, our aim is to use AI planning to compose normal Web services. In
this project, we use normal Web services offered by the ATDW. These Web ser-
vices are called Australian Tourism Web Services (ATWS). We propose a general
framework which automatically generates composition plans using AI planning
for composing services described in WSDL. Services offered by ATDW (ATWS)
are used as examples in the case study. This framework uses an AI planner
called Simple Hierarchical Ordered Planner (SHOP2) to generate the composi-
tion plan. A prototype is developed to show the feasibility of such framework.
Lessons learned from applying AI planning in Web service composition are also
1
Many acronyms are used in the Web Service domain, so in order to ensure the clarity of
this document, a glossary is provided in Appendix B.
2
presented and discussed.
1.2 Overview
Some previous works in Web service composition including the tools are reviewed
in Chapter 2. In Chapter 3, we introduce the building blocks of the framework.
These include the ATWS, as well as SHOP2. We also provide a case study
to illustrate the Web service composition process. The framework design and
implementation are discussed in depth in Chapter 4. The example execution
results are presented in Chapter 5. Finally, to conclude our work, we identify the
limitations and open problems in using AI Planning techniques for Web service
composition. Suggestions for future works are also presented in Chapter 6.
3
CHAPTER 2
Web service is the current trend of doing business online. It supports e-Business,
e-Commerce, and a variety of service-oriented applications that are available on
the Web for clients to consume. Simple examples of Web services include Ama-
zon Web services at Amazon.com and the search and spelling checking services
provided by Google. Most of the services available are atomic services. They
provide a single, stand-alone service for clients. However, the need for more com-
plex services is increasing in order to accomplish more complex tasks. Therefore,
it is important to reuse the atomic services by combining or composing them
together to meet the demand. In this chapter, we will look at what Web service
composition is and its supporting technologies.
4
Figure 2.1: The Web service architecture adapted from Gottschalk [14].
by the World Wide Web Consortium (the W3C) for Web service applications. In
short, these standards can be defined as [2]:
The primary reason for the standardization is to realize the main goal of
Web services, i.e. interoperability [28]. This was fundamentally supported by
the key technology shared by the standards, which is the Extensible Markup
Language (XML) that enables message exchange among any applications [2].
Different organizations may build their Web services using different programming
languages and the services may run on different platforms too. Hence, it is
crucial to have an architecture that provides a standard means of interoperating
between those applications [9]. This important property allows Web services to
be developed using any programming language and deployed on any platform
thus giving Web services an advantage over other Web-based applications.
5
2.2 Web Service with Semantics
The previous section introduced Web service and its architecture. A Web service
description is given in WSDL, which syntactically describes the service interface.
The description of Semantic Web services, however, is described semantically.
According to Harmelen and Horrocks [37], the aim of the Semantic Web is to
introduce a Web with which both humans and machines can communicate. Hu-
mans are good at inferring different senses a syntactical word represents based on
its current context. However, a computer program needs extra information for
disambiguating one word sense from another. It requires a way of representing in-
formation so that its meaning will be machine-processable or machine-accessible.
Basically, ‘semantically’ means representing information in such a way that
a machine can understand its meaning, which then allow users to search for ser-
vices that meets their needs and requirements. To make this vision a reality,
Semantic Web needs languages to define ontologies. Ontology is to define the
relationship between concepts not words. For example, ‘fly’ could means a flying
verb or an insect. ‘Hotel’ and ‘motel’ is different but they both represent the
concept of ‘accommodation’. Languages such as Resource Description Frame-
work (RDF), Resource Description Framework Schema (RSDF) [18], Ontologies
Inference Layer (OIL) [37], and DARPA Agent Markup Language (DAML) [16]
family of languages such as DAML-S (currently called OWL-S) and DAML+OIL
are being used. These languages handle ontologies to describe semantics to the
Web. They have a well-defined semantics and that enable the markup and ma-
nipulation of complex taxonomic and logical relations between entities on the
Internet [20]. Semantic allows the description of the domain concepts and the
relationships between concepts and services such as the previous fly and hotel-
motel examples. While WSDL provides a description of a Web service in terms
of its inputs, outputs, location of the service, and its operation, the Semantic
Web provides the description of the service in terms of its functional information
and models the pre-conditions and post-conditions of a particular service [32].
However, semantic Web services are not yet as widely available as the ‘normal’
Web services discussed previously, Semantic Web services are still under devel-
opment as much research is still going on in the area. Therefore, we focus on
the ‘normal’ Web services in our implementation of Web service composition. A
detailed discussion of the implementation is presented in Chapter 3 and Chapter
4.
6
Figure 2.2: Web service composition framework [24].
7
Figure 2.3: The modified Web service composition framework.
8
to determine what should be done [35]. Web Service Composition Languages
aim at combining Web services together in a process-oriented way [36]. These
languages use one or more WSDL services which are then combined together to
provide composite services. Hence, these languages provide the means to specify
a process model that describe the order of execution of the composite services.
The same way applies to Semantic Web services where services are described
semantically in DAML-S and more recently, OWL-S.
However, the composition tasks are complex and human are unable to deal
with this complexity manually for the following reasons [24]:
• Existing Web services can be updated and new Web services can be created
at run time. A service repository should be able to dynamically track and
cope with the changes as we want our decision on composing the services
based on the up-to-date information.
• Web services are developed by different organizations that use different lan-
guages to describe the services offered. There are no standard language for
this purpose and that creates the complexity for composing them together.
With the complexity that arises in Web service composition domain, it seems
impossible for humans to search for services, generate plans, and execute them
manually. Therefore, we need an automatic or semi-automatic composition tool
to assist us in composing the services.
9
According to Srivastava and Koehler [33], Web service composition workflows
are derived from business model. The composition in workflow can be divided
into two types—static and dynamic. Static Web service composition requires the
service requester to build a process model that consists of tasks and data depen-
dency before the planning composition starts. Hence, the services are chosen at
design time. Each task contains a query used to search atomic Web services. A
process model is commonly specified in a graph. Dynamic service composition,
however, generates the process model and selects the services automatically where
they are chosen at run-time. The service requester just specify some constraints
including the dependency of atomic services and his/her preferences [24].
10
Figure 2.4: An example of a composite service in eFlow’s process schema adapted
from [11].
the nodes in the process. A service node represents the invocation of a basic or
composite service. A service node specification includes the definition of data
that the node is allowed to read or modify, and the description of the service to
be invoked.
In figure 2.4, the rounded boxes represent invocations of single or composite
services. The black circle represent the starting and ending point of a process.
The horizontal lines represent parallel invocation of Web services and synchro-
nization after service executions. This lines are one of eFlow’s decision node
type. The definition of a service node contains a search information that is used
to query the service [24]. This gives the dynamic feature of eFlow which lies in
its ability to discover Web services dynamically. Other dynamic features offered
by eFlow are dynamic service node creation and dynamic service process modifi-
cation. eFlow also allows two ad-hoc changes—process schema modifications and
process instance state modifications which are explained in detail in [11]. Those
features give eFlow its dynamic and adaptive properties.
11
AI Planning techniques that could be implemented in service composition
include Situation Calculus, Graphplan, Constraint Satisfaction Problem (CSP),
and Constraint Programming [21]. The planning problem is viewed as generating
a sequence of operators that will transform the current state of the environment
into a goal state. Russel and Norvig [25] defined the problem of planning as one
type of problem solving where an agent uses its beliefs about available actions
and potential outcomes before it can identify a solution from an abstract view of
possible plans. What makes AI Planning possible for Web service composition is
the description of Web services in the DAML-S or OWL-S which describes the
services in a more machine friendly manner [21].
Even though AI Planning is seen to be more suitable for Semantic Web service
composition, it could also produce reasonable results for normal Web service with
the assumption that the component services share common terminologies. As for
our implementation, we will compose Web services described in WSDL and use
AI Planning technique for the generation of composition plans.
12
2.6.2 Hierarchical Task Network based Composition—SHOP2
Differs from the above tools, SHOP2 uses Hierarchical Task Network (HTN), an
AI Planning technique with OWL-S giving semantic to its application. HTN
planning generates plans by task decomposition (divide problems into subtasks).
Its objective is to create a sequence of actions that perform tasks for users. In
SHOP2, the plans are generated based on the order of execution of the tasks
given the knowledge about the domain. This means SHOP2 knows the current
state of the world at each step in the planning process. Having the knowledge
of the current state, SHOP2’s pre-condition-evaluation mechanism is able to in-
clude inferencing and reasoning power plus its ability to call external programs.
SHOP2’s knowledge base consists of operators and methods, which includes non-
action but related facts and axioms. An operator is an action that describes what
to be done to achieve a primitive task. A method contains ways to decompose
some tasks into partially ordered subtasks. Planning problem for SHOP2 is given
by (S, T, D) where S is the initial state, T is a task list, and D is the domain de-
scription. SHOP2 takes this as its input and returns a plan, P = (p1 p2 p3 ...pn ).
P consists of a sequence of operators that will achieve T from S in D.
The planning process involves encoding the OWL-S Web services descriptions
into SHOP2 planning domain (D). For that purpose, we have to translate the
OWL-S description into the domain (D). This requires a number of processes to
be carried out as explained in details in [27]. Hence, SHOP2 is a composition
tool for Semantic Web services. In the context of Semantic Web services, OWL-
S, originated from DAML-S [19], is used to describe the services and provide
language constructs to specify the flow of the services. In other words, OWL-
S provides descriptions in two folds, one is service description (corresponds to
WSDL used by normal Web services); the other is service control flow descrip-
tion (corresponds to BPEL4WS and WSFL in normal Web services). The SHOP2
planning process and the OWL-S description parsing and generation process are
not tightly coupled. The SHOP2 as a planner takes input operators generated by
parsing OWL-S service descriptions and produce composition plans that are in
turn translated into OWL-S description. Because of the relevant similar function-
ality between OWL-S and WSDL, based on the assumptions that unambiguous
descriptions are used WSDL, we can use SHOP2 to generate plans based on the
operations described by WSDL. Basically, SHOP2 is used as a plan generator
independent of the service description languages. These plans can be used to
specify the order of Web services execution.
13
2.7 Summary
As Web service proves essential in e-business, much work has been done to im-
prove the technology. It includes developing and improving its standards, adding
semantic to Web services through annotation, and developing tools to compose
Web services. Different approaches have been implemented in developing the
tools including rule-based approach, planning-based approach, and using flow
structure to derive the composition and execution plan of Web services. AI plan-
ning has the potential to be used as an automated process for generating plans
for Web service composition as it is viewed to be more intuitive and provide more
flexibility in composing Web services.
14
CHAPTER 3
As Web services emerge in many areas, tourism has shown an exponential growth
of Web services offering services like hotel reservation, flight booking, car rental
online, and many more. To have a real-world example of Web service composi-
tion using AI Planning technique, we will consider a simple example in tourism
domain for the case study. In this chapter, we will discuss in details about the
Web services offered by the Australian Tourism Data Warehouse (ATDW), the
technical side of SHOP2, and the design of how to compose Web services using
SHOP2. This will lay the foundation of future chapters.
15
3.1.1 ATWS Request
As mentioned previously, the ATDW stores other Web services known as the
Australian Tourism Web Services (ATWS). To consume a service, we have to
invoke ATWS. For that, we have to provide a SOAP request message as its
input. The SOAP used in this application is of version 1.1. The interface to the
ATWS is defined in WSDL. The functions exposed by WSDL are Query Set 1
and Query Set 2. However, Query Set 2 has become the dominant approach to
query the ATWS. In Query Set 2, the functions are not exposed individually.
They can be accessed by using a wrapper function called the CommandHandler.
The query functions of Query Set 2 are:
• QueryProducts
• QueryProductsNextPage
• GetProduct
• GetProductService
• GetCities
• GetSuburbs
• GetCountryStateArea
• GetDomesticRegionArea
• GetAttributesInLocation
• GetAttributeDefinitions
16
Figure 3.1: ATDW request and response as input and output.
17
<soap:Body xmlns:m="http://www.flight-bookings.com/prices">
<m:GetFlightPrice>
<m:FlightName>MAS</m:FlightName>
<m:FlightDestination>Kuala Lumpur</m:FlightDestination>
<m:FlightDate>15 July 2005</m:FlightDate>
</m:GetFlightPrice>
</soap:Body>
</soap:Envelope>
The above example shows a sample request and response messages expressed
in SOAP. It is simply requesting a price for a flight to Kuala Lumpur on 15th
July 2005. The response message then returns the price of a given flight name,
which is the Malaysian Airlines (MAS). Note that the actual message is within
the SOAP body element. They are called the application-specific elements and
they are not part of the SOAP standard. Different application may have different
XML namespace (xmlns) and XML tags.
Note that the above example is just to give us the flavour of how the re-
quest and response messages will look like in SOAP. Appendix C shows a sample
of SOAP request and response messages to ATDW. Even though SOAP is a
standard way of communicating with ATDW, we could also use other means
of communicating the messages over to ATDW via using either HTTP POST,
HTTP GET, or MIME. ATDW service interface are being described in WSDL
and is discussed in Chapter 4.
18
3.2 SHOP2: The Technical Details
SHOP2 is written in Lisp programming language. To use SHOP2, the available
services should be translated into operators and described in domain definition
file. The composition problem should be translated and described in a separate
problem definition file. Both files are then used with the SHOP2 engine to gener-
ate plans. To do so, we have to understand the technical components of SHOP2
terms, axioms, operators, and methods. In SHOP2, a term can be one of the
following:
• a variable
• a constant
• a number
• a list-term
• a call-term
• an eval-term
19
SHOP2 requires a planning domain and a single problem or a problem set as
its inputs. The planning domain consists of operators, methods, and axioms. In
SHOP2, an operator took the following form:
(:operator h pre del add [c])
where
• h is the operator’s head, a primitive task atom which normally begins with
an exclamation mark.
• del is a delete list for which its element could be any of the following:
– a logical atom
– a protection condition
– an expression
• add is an add list of logical atoms that has the same form as in del.
• Ti is called the method’s tail which is a task list. It can contain call-terms.
• ni is the name for Ci Ti pair. These names are optional and it can be
omitted. If so, a unique name will be assigned for the each pairs.
Tasks specified in the method’s head can be executed by executing the tasks
in one of its tails given that that particular task’s pre-condition is met. The
following example considers cutting a piece of paper either with scissors or a
blade:
(:method (cut-paper ?paper)
(have-scissors ?scissors)
((!cut-with-scissors ?paper ?scissors))
20
(have-blade ?blade)
((!cut-with-blade ?paper ?blade))
)
This method shows how the pre-condition affect the end result. If the pre-
condition (have-scissors ?scissors) is satisfied, then the task ((!cut-with-scissors
?paper ?scissors)) will be executed and likewise.
An axiom in SHOP2 is an expression of the form:
(:- a [name1 ] E1 [name2 ] E2 ...[namen ] En )
where a is the axiom’s head and all of the [namei ] Ei are its tail. [namei ] is the
name of the expression Ei and it is optional. Although these names does not have
any semantic meaning to SHOP2 but they could aid the debugging process by
the user. The meaning of the axiom is that a is true if one of the Ei is true when
others are false.
SHOP2 needs to know the domain of the problem before it could generate
some plans as output. To define the domain in SHOP2, we use the following
syntax:
(defdomain domain-name (i1 i2 ...in ))
where domain-name is a symbol which tells the name of that problem domain.
ii could be either an operator, a method, or an axiom.
The planning problem in SHOP2 is of the form:
(defproblem problem-name domain-name(a1 a2 ...an ) T)
where both problem-name and domain-name are symbols, ai is a logical atom,
and T is a task list. The problem is defined such that it could be solved by
addressing the tasks in T with the initial states which are defined by each of ai .
The planning problem could also be defined as multiple planning problem in
a planning problem set, which is written in the form:
(def-problem-set set-name (p1 p2 ...pn ))
where set-name is a symbol representing the problem set name and pi is the
name of a planning problem.
To execute SHOP2 planning process, we use either find-plans, which finds
plans for a single planning problem, or do-problems, which finds plans for a set
of planning problem. SHOP2 produces its output as a plan. A plan is a list of
the form:
(h1 c1 h2 c2 ...hn cn )
21