WSMO logo

D14v0.1. Choreography in WSMO

WSMO Working Draft 24 January 2005

This version:
http://www.wsmo.org/2005/d14/v0.1/20050124/
Latest version:
http://www.wsmo.org/2004/d14/v0.1/
Previous version:
http://www.wsmo.org/2004/d14/v0.1/20041210/
Editor:
Dumitru Roman
James Scicluna
Co-Authors:
Emilia Cimpian
Uwe Keller
Michael Stollberg
Dieter Fensel

This document is also available in non-normative PDF version.
Copyright © 2004 DERI®, All Rights Reserved. DERI liability, trademark, document use, and software licensing rules apply.



Table of contents


1. Introduction

Choreography in WSMO [Roman et al., 2004] is part of a service interface description; it describes the behavior of the service from a user point of view; this definition is in accordance to the following definition given by W3C Glossary [W3C Glossary, 2004]: Web Services Choreography concerns the interactions of services with their users. Any user of a Web service, automated or otherwise, is a client of that service. These users may, in turn, be other Web Services, applications or human beings.

The aim of this document is to provide a core conceptual model for describing choreographies in WSMO. The state-based mechanism for describing WSMO choreographies is based on the Abstract State Machines [Gurevich, 1995] methodology. The reason for choosing the ASMs as a basis for WSMO choreography is that ASMs provide a high flexibility in modelling systems, being at the same time scientifically well founded. For a detailed explanation on ASMs we refer the reader to [Börger, 1998].

Taking the ASMs methodology as starting point, a WSMO choreography is defined as follows:

Listing 1. WSMO choreography definition
Class wsmoChoreography
      hasStateSignature type stateSignature
      hasState type state
      hasGuardedTransitions type guardedTransition
State Signature
A state signature defines the invariant elements of the state description [1].
State
A state is described by a set of instances, either explicitly or by a link to an instance store [2].
Guarded transitions
Transition rules that express changes of states by changing the set of instances.

The rest of the document is organized as follows: Section 2 of the document describes what is the signature of a state, Section 3 describes the state, Section 4 the guarded transitions, Section 5 presents an example of how a choreography is modeled and Section 6 presents the conclusions and further directions.

2. State signature

The signature of the states is given by elements of the WSMO Ontology, and it remains unchanged for all the states of the choreography:

Listing 2. State signature definition in choreography
Class stateSigniture
      hasNonFunctionalProperty type nonFunctionalProperty
      hasImportedOntology type ontology
      hasUsedMediator type ooMediator
      hasConceptInChoreography type conceptInChoreography
      hasRelationInChoreography type relationInChoreography
      hasFunctionInChoreography type functionInChoreography
      hasAxiom type axiom
      hasIdentifiers type WSMOidentifiers
Non functional properties
Defined in WSMO, Section 4.1.
Imported ontologies
Defined in WSMO, Section 4.2.
Used mediators
Defined in WSMO, Section 4.3.
Concepts in choreography
Concepts in choreography are a sub-Class of concepts defined in WSMO, Section 4.4, having their non functional properties extended with the attribute mode, which can take one of the following values: static, controlled, in, shared, or out.
Relations in choreography
Relations in choreography are a sub-Class of relations defined in WSMO, Section 4.5, having their non functional properties extended with the attribute mode, as for concepts in choreography.
Functions in choreography
Functions in choreography are a sub-Class of functions as defined in WSMO, Section 4.6, having their non functional properties extended with the attribute mode, as for concepts in choreography.
Axioms
Defined in WSMO, Section 4.8.

When a concept, relation or function in a choreography is defined, the attribute mode of their non functional properties must be defined, and can take one of the following values:

3. State

A state is described by a set of explicitly defined instances and values of their attributes or through a link to an instance store.

4. Guarded transitions

Guarded Transitions are used to express changes of states by means of rules, expressible in the following form:

if Cond then Updates.

Cond is an arbitrary is an arbitrary WSML axiom, formulated in the given signature of the state. .

The Updates consist of arbitrary WSMO Ontology instance (see Section 4.7 of WSMO 1.1) statements..

5. Choreography description example

Our service makes reservations for trips, for which the starting and ending points are located in Austria or Germany. The service request route and credit card information. In case it can provide the requested service it will perform the booking for the client.

Listing 3 describes the Trip Reservation Ontology, containing concepts, relations and functions needed for making a trip reservation. This ontology uses concepts already defined in The Dublin Core Element Set v1.1, the OWL Person Ontology, (imported by using the owlPersonMediator), the XML Schema Namespace, and the Train Connection and Purchase ontologies, the last two being developed by WSMO working group.

Listing 3. Trip Reservation Ontology.
namespace <<http://www.wsmo.org/ontologies/tripReservationOntology#>>
    dc:<<http://purl.org/dc/elements/1.1#>>
    prs:<<http://www.wsmo.org/2004/d3/d3.3/v0.1/20041008/resources/owlPersonMediator.wsml>>
    xsd: <<http://www.w3.org/2001/XMLSchema#>>
    tc:<<http://www.wsmo.org/ontologies/trainConnection#>>   
    po: <<http://www.wsmo.org/ontologies/purchase#>>
    targetnamespace:<<http://www.wsmo.org/ontologies/tripReservationOntology#>>

ontology <<http://www.wsmo.org/ontologies/tripReservationOntology#>>

    nonFunctionalProperties 
        dc:title hasValue "Trip Reservation Ontology"
        dc:creator hasValue "DERI Innsbruck"
        dc:description hasValue "an ontology for describing trip 
            reservation related knowledge"
        dc:publisher hasValue "DERI International"
        dc:contributor hasValues "Titi"
        dc:date hasValue "2004-10-22"
        dc:type hasValue <<http://www.wsmo.org/2004/d2/#ontology>>
        dc:format hasValue "text/html"
        dc:language hasValue "en-us"
        dc:rights hasValue <<http://deri.at/privacy.html>>
        version hasValue "$Revision 1.17 $"
    endNonFunctionalProperties
 
    concept route
        nonFunctionalProperties
            dc:description hasValue "concept of a route between two 
                stations"
         endNonFunctionalProperties
         sourceLocation type tc:station
         destinationLocation type tc:station
 
    concept reservation
        nonFunctionalProperties
            dc:description hasValue "concept of reservation, containing 
                a reservation holder"
         endNonFunctionalProperties
         reservationNumber type xsd:integer
         reservedRoute type route
         reservationHolder type prs:person

    relation connectionExists
         nonFunctionalProperties
            dc:description hasValue "connection existance relationship
               between two stations"
         endNonFunctionalProperties
         sourceLocation type tc:station
         destincationLocation type tc:station

    function validCreditCard
         nonFunctionalProperties
            dc:description hasValue "credit card is valid or not"
         endNonFunctionalProperties
         range type xsd:boolean
         creditCard type prs:CreditCard

        

Listing 4 contains the definition of the Trip Reservation Service. The capability offered by it is Reservation Service capability, presented in Listing 5, and its choreography (Trip Reservation Service Choreography) is described in Listing 6. Note that listings 5 to 8 are assumed to be in the same namespace (i.e. the trip reservation service namespace).

Listing 4. Trip Reservation Service definition.
namespace <<<http://www.wsmo.org/ontologies/tripReservationService#>>
    dc:<<http://purl.org/dc/elements/1.1#>>
    prs:<<http://www.wsmo.org/2004/d3/d3.3/v0.1/20041008/resources/owlPersonMediator.wsml>>
    xsd: <<http://www.w3.org/2001/XMLSchema#>>
    tc:<<http://www.wsmo.org/ontologies/trainConnection#>>   
    po: <<http://www.wsmo.org/ontologies/purchase#>>
    ts: <<http://www.wsmo.org/ontologies/tripReservationOntology#>>
    targetnamespace:<<http://www.wsmo.org/ontologies/tripReservationService#>>

service <<http://www.wsmo.org/ontologies/tripReservationService.wsml>>

    nonFunctionalProperties 
        dc:title hasValue "Trip Reservation Service"
        dc:creator hasValue "DERI Innsbruck"
        dc:description hasValue "service for online trip reservations for Austria 
            and Germany"
        dc:publisher hasValue "DERI International"
        dc:contributor hasValues "Titi"
        dc:date hasValue "2004-10-22"
        dc:type hasValue <<http://www.wsmo.org/2004/d2/#service>>
        dc:format hasValue "text/html"
        dc:language hasValue "en-us"
        dc:coverage hasValues {tc:austria, tc:germany}
        dc:rights hasValue <<http://deri.at/privacy.html>>
        version hasValue "$Revision 1.17 $"
    endNonFunctionalProperties

    capability reservationServiceCapability

    interface reservationServiceInterface
                choreography reservationServiceChoreography

Listing 5 below presents the capability of the service by defining its precondition and postcondition. The assumption requests a valid credit card. The precondition expresses the fact that the service requires a route, for which the start and end location have to be in Austria or in Germany, and a connection exists. The postcondition expresses the fact that, in case of a successful execution of a service, a reservation is sent to the user.

Listing 5. Trip Reservation Service Capability definition.
capability reservationServiceCapability

    nonFunctionalProperties 
        dc:title hasValue "Trip Reservation Service Capability"
        dc:creator hasValue "DERI Innsbruck"
        dc:description hasValue "description of the capability of the reservation 
            service of providing trip reservations for Austria and Germany"
        dc:publisher hasValue "DERI International"
        dc:contributor hasValues "Titi"
        dc:date hasValue "2004-10-22"
        dc:format hasValue "text/html"
        dc:language hasValue "en-us"
        dc:rights hasValue <<http://deri.at/privacy.html>>
        version hasValue "$Revision 1.17 $"
   endNonFunctionalProperties
  
   sharedVariables ?route, ?creditCard   

   assumption
       nonFunctionalProperties
            dc:description hasValue "In order to purchase a trip, the credit card
               given by the user must be valid"
        endNonFunctionalProperties
        definedBy
          validCreditCard(?creditCard)

   precondition        
        nonFunctionalProperties
            dc:description hasValue "the service receives a route, for which the
                start and end location have to be in Austria or in Germany,  
                and a credit card which has to be valid."      
        endNonFunctionalProperties
        definedBy
            ((?route memberOf ts:route
               ?route.startLocation hasValue ?start
               ?route.endLocation hasValue ?end) and
            (connectionExists(?start,?end)) and
            (?creditCard memberOf prs:CreditCard) 

    postcondition
        nonFunctionalProperties
            dc:description hasValue "in case of a successful execution of a service, 
            a confirmation is sent to the usera confirmation is sent to the user"
        endNonFunctionalProperties
        definedBy
            (?reservation memberOf ts:reservation) and
            (?reservation.route = ?route)

    effect
        nonFunctionalProperties
            dc:description hasValue "If the credit card is valid and the route is available,
            then we need to charge the credit card"
        endNonFunctionalProperties
        definedBy
            (?creditCard memberOf prs:CreditCard
                  balance hasValue ?currentBalance) and
            (?reservation memberOf ts:reservation
                  price hasValue ?reservationCost) and
            (?currentBalance.amount = ?currentBalance.amount - ?reservationCost)

For defining the choreography of the service, we need to present its state signature (Listing 7) and its guarded transition (Listing 8).

Listing 6. Trip Reservation Service Choreography definition.
choreography reservationServiceChoreography

    stateSignature reservationServiceStateSignature
    
    guardedTransitions reservationServiceTransitionRules

The signature of the states is given by elements of the WSMO Ontology, and it remains unchanged during the execution of the choreography. All its elements are inherited from the already defined elements of the ontology, additionally having the attribute mode, described in Section 2.

Listing 7.State signature in the Choreography of the Trip Reservation Service.
stateSignature reservationServiceStateSignature

    nonFunctionalProperties
        dc:title hasValue "State signature"
        dc:description hasValue "The definition of the elements that are part of 
            the state signature of Trip Reservation Service choreography."
        dc:date hasValue "2004-10-22"
        dc:format hasValue "text/plain"
        dc:language hasValue "en-US"
        version hasValue "$Revision 0.1 $"
    endNonFunctionalProperties

hasConceptInChoreography route subClass ts:route
    nonFunctionalProperties
      dc:description hasValue "a route as defined in 'ts' ontology and 
         adopted for choreography"
      mode hasValue in
      grounding hasValue reservationWSDL:reserveRoute
    endNonFunctionalProperties

hasConceptInChoreography creditcard subClass prs:CreditCard
    nonFunctionalProperties
      dc:description hasValue "a credit card as defined in the 'prs" ontology
         and adopted in choreography"
      mode hasValue in
      grounding hasValue reservationWSDL:reserveRoute
    endNonFunctionalProperties

hasConceptInChoreography reservation subClass ts:reservation
    nonFunctionalProperties
      dc:description hasValue "concept of credit card as defined in the 
        'po' ontology and adapted for choreography"
      mode hasValue out
      grounding hasValue reservationWSDL:reserveRoute
    endNonFunctionalProperties
        

Listing 8 presents the guarded transitions for the Trip Reservation Service choreography.

Listing 8. Guarded Transitions in the Choreography of the Trip Reservation Service.
guardedTransitions reservationServiceTransitionRules

  if((routeInstance memberOf ts:route
         sourceLocation hasValue ?start
         destinationLocation hasValue ?end) and 
      (?start.locatedIn = austria or ?start.locatedIn = germany) and 
      (?end.locatedIn = austria or ?end.locatedIn = germany) and
      (connection (?start,?end)) 
  then
    (reservationInstance memberOf ts:reservation) and 
    (reservationInstance.reservedRoute hasValue routeInstance)


  if((reservationInstance memberOf ts:reservation) and
      (creditCardInstance memberOf prs:CreditCard) and
      valid(creditCardInstance))
  then
    (reservationInstance memberOf ts:reservation) and
    (reservationInstance.reservationHolder hasValue creditCardInstance.owner)
        

6. Conclusions and further work

This document presented a core conceptual model for modeling WSMO Choreographies based on the ASMs methodology. Future versions of this document will give a precise translation of the model to ASMs in order to benefit from using ASMs interpreters, thus having an environment for executing choreographies.

References

[Börger, 1998] Egon Börger: "High Level System Design and Analysis Using Abstract State Machines", Proceedings of the International Workshop on Current Trends in Applied Formal Method: Applied Formal Methods, p.1-43, October 07-09, 1998

[Gurevich, 1995] Yuri Gurevich: "Evolving Algebras 1993: Lipari Guide", Specification and Validation Methods, ed. E. Börger, Oxford University Press, 1995, 9--36.

[Roman et al., 2004] D. Roman, H. Lausen, and U. Keller (eds.): Web Service Modeling Ontology (WSMO), WSMO deliverable D2 version 1.1. available from http://www.wsmo.org/2004/d2/v1.1/

[W3C Glossary, 2004] Hugo Haas, and Allen Brown (editors): Web Services Glossary, W3C Working Group Note 11 February 2004, available at http://www.w3.org/TR/ws-gloss/

Acknowledgement

The work is funded by the European Commission under the projects DIP, Knowledge Web, InfraWebs, SEKT, SWWS, ASG and Esperonto; by Science Foundation Ireland under the DERI-Lion project; by the Vienna city government under the CoOperate programme and by the FIT-IT (Forschung, Innovation, Technologie - Informationstechnologie) under the projects RW² and TSC.The editors would like to thank to all the members of the WSMO working group for their advice and input into this document.


[1] This corresponds also to a database schema which defines the structure of a database.

[2] The state corresponds to the actual elements stored in the database


Valid XHTML 1.1!

webmaster

$Date: 2005/01/24 11:32:45 $