]> $Id: CongoProcess.owl,v 1.88 2006/01/30 07:52:44 martin Exp $ A B2C bookbuying example of OWL-S (Web Ontology Language for Services; see http://www.daml.org/services/owl-s) usage, illustrating a simple use of the process model. There are several other .owl files that instantiate the other areas of OWL-S (profile, grounding, and service declarations) for this same example. NOTE: This is a sketch; not a complete example. It is designed to illustrate the usage of the process model ontology. The service described here is a fictional book buying (or selling, depending on your perspective) service from www.congo.com. The normal usage scenario for these processes is as follows: they would be published by Congo, but executed by a software agent that wants to buy from Congo. We present two forms of the service. First, there's a one-step form, ExpressCongoBuy, with the service treated as ATOMIC; i.e., no interactions between buying and selling agents are required, apart from invocation of the service and receipt of its outputs by the buyer. Given certain inputs and preconditions, the service provides certain outputs and has specific effects. Second, a full-fledged version of the service is specified, showing its composition from its component services. The full-fledged version of the service, FullCongoBuy, includes an arrangement of subprocesses LocateBook, PutInCart, SignIn, CreateAcct, LoadUserProfile, SpecifyDeliveryDetails, FinalizeBuy each with its own specification of inputs and outputs. Note: Input, output, precondition, and result properties of *composite* processes can, in principle, be automatically generated by tools. Since such tools don't yet exist, they have been manually generated for this example. Original Congo example created by Srini Narayanan (srini@ai.sri.com). Major modifications by Mark Burstein, David Martin, Sheila McIlraith, Srini Narayanan, Terri Payne, Massimo Paolucci. Note: Starting with version 1.0, OWL-S views processes as instances of the Process class rather than as subclasses of it. 1 1 1 1 1 1 1 1 If successful, LocateBook returns an ISBN; otherwise, it returns a FailureNotification. The set of books that are found in stock of Congo. The set of books that are NOT found in stock of Congo. Inverse of hasISBN property, i.e. relate an ISBN number to a book. An account exists if there is an account ID associated with it. If there is no account ID for an account then that account simply does not exist 0 The Cart Class, which is simply a list of Books, is used to record books selected by a customer during a shopping session. Various processes like AddToCart, RemoveFromCart, itemInCart?, etc. can be defined using the Cart Class as the structure manipulated. So the output/effect of these processes would manipulate the cart to add, delete items. (These manipulations are not yet specified here.) This is an express "one shot" service for buying a book with Congo. It takes as input a Book ISBN number and the customer's sign-in information, and has the effect of ordering the book if the book is in stock. In this case, the output of the service is a message saying the book is ordered. If the book is not in stock, the output says that the book is out of stock. &profileHierarchy;#ISBN &THIS;#SignInData &xsd;#decimal &THIS;#CreditCardType &xsd;#gYearMonth This is a local variable that represents the associated account ID for the given sign-in info. The existence of this value indicates that the sign-in info is valid an account exists. &THIS;#AcctID This is a local variable that represents the associated credit card for the given card number. &THIS;#CreditCard hasAcctID(ExpressCongoBuySignInInfo, ExpressCongoBuyAcctID) cardNumber(ExpressCongoBuyCreditCard, ExpressCongoBuyCreditCardNumber) & validity(ExpressCongoBuyCreditCard, Valid) Typically this condition should also say that given credit card type and expiration date is also correct for the credit card. Those details are left out for this example. &THIS;#ExpressCongoBuyOutputType If the book is in stock, then the result is that the order was shipped and an appropriate acknowledgment is output. Thee book identified by the given ISBN input &profileHierarchy;#Book The shipment that gets generated on a successful purchase &THIS;#Shipment hasISBN(ExpressCongoBuyBook, ExpressCongoBuyISBN) & InStockBook(ExpressCongoBuyBook) This expression says that the ExpressCongoBuyOutput will be of type OrderShippedAcknowledgment. This expression says that the selected book is shipped to the account If the book is out of stock, then the result is simply that an appropriate acknowledgment is output, indicating that the book is out of stock. This expression just says that the value of ExpressCongoBuyOutput will be NotifyBookOutOfStock. This composite process is composed of a sequence that performs an atomic process, LocateBook, and a composite process, CongoBuyBook. &xsd;#string &THIS;#AcctInfo &THIS;#SignInData &xsd;#decimal &THIS;#CreditCardType &xsd;#gYearMonth &xsd;#string &xsd;#string &THIS;#DeliveryType &THIS;#AcctID &THIS;FullCongoBuyOutputType When the book is in stock, return an instance of OrderShippedAcknowledgment, and the Acct ID (from CongoBuyBookCreateAcctOutput). The shipment that gets generated on a successful purchase &THIS;#Shipment This expression just says that the FullCongoBuyOutput will be of type OrderShippedAcknowledgment. This expression says that the selected book is shipped to the account. (This expression is not complete yet, it needs to relate the shipment to the located book and user's account. See ExpressCongo for a more complete example) When the book is out-of-stock, return the value returned by LocateBook (an instance of FailureNotification). FullCongoBuyCreateAcctOutput is left unspecified (it will be a null value). Control structure for CongoBuyBook: Perform composite process BuySequence Perform atomic process SpecifyDeliveryDetails Perform atomic process FinalizeBuy &profileHierarchy;#ISBN &THIS;#AcctInfo &THIS;#SignInData &xsd;#string &THIS;#CreditCardType &time;#Instant &xsd;#string &THIS;#PackagingType &THIS;#DeliveryType &THIS;#AcctID BuySequence is a sequence that performs an atomic process PutInCart, followed by a composite process SignInAlternatives, followed by an atomic process SpecifyPaymentMethod. &profileHierarchy;#ISBN &THIS;#AcctInfo &THIS;#SignInData &xsd;#decimal &THIS;#CreditCardType &time;#Instant &THIS;#AcctID &THIS;#AcctInfo &THIS;#SignInData &THIS;#AcctID SignInAlternatives is a choice whose components are a composite process CreateAcctSequence and a composite process SignInSequence. In either case, the user's account ID is returned. It's a pre-existing ID in the case of SignInSequence; a new ID in the case of CreateAcctSequence. hasAcctID(SignInAlternativesSignInData, SignInAlternativesAcctID) If an account already exists, sign-in operation will be performed and returned acct ID willbe used If an account does not exist a new account will be create by the CreateAcct process and the ID of new account will be used. SignInSequence performs an atomic process SignIn, followed by an atomic process LoadUserProfile. &THIS;#SignInData The output is a copy of the account ID from the input. &THIS;#AcctID CreateAcctSequence performs atomic process CreateAcct followed by atomic process LoadUserProfile. &THIS;#AcctInfo &THIS;#AcctID If the book described by "bookName" is in Congo's catalogue, then the output of LocateBook is the description of the book and the prices. If the book is not in Congo's catalogues, then the output is a message to this effect. &xsd;#string &THIS;#LocateBookOutputType If the book is in stock, then the result is that that the book's ISBN is output. Thee book identified by the given name &profileHierarchy;#Book If the book is out of stock, then an appropriate notification is returned. A very simple version of the put-in-cart process, in which the cart is a list of books (each item being a book). &profileHierarchy;#ISBN Sign in is a process that requires input of signin info. &THIS;#SignInData &THIS;#AcctInfo &THIS;#AcctID LoadUserProfile can only be invoked if a user profile already exists. &xsd;#decimal &THIS;#CreditCardType &time;#Instant &xsd;#string &THIS;#PackagingType &THIS;#DeliveryType