2ronwalf * This example shows how to create a complex process model that is shown in the file 2ronwalf * </a>. The process model contains a sequence that starts with a service that gets the 2ronwalf * price for a given book title, then has a SplitJoin to get the book price from Amazon and 2ronwalf * Barnes&Nobles concurrently, and as a last step has an If-Then-Else construct to compare 2ronwalf * the prices and return the cheaper book price. 2ronwalf // knowledge base we are going to use 2ronwalf // ontology where service descirption is saved 2ronwalf // swrl factory to create consitions and expressions 2ronwalf // commonly used classes, properties, datatypes 2ronwalf // the process we create to do the comparison 2ronwalf // the inputs of the comparison process 2ronwalf // the outputs of the comparison process 2ronwalf "Find the price of book in Amazon and Barnes & Nobles " +
2ronwalf "and return the cheaper price" );
2ronwalf // create the composite process 2ronwalf // Create an input that has parameterType xsd:string 2ronwalf // Create an output that has parameterType xsd:string 2ronwalf // Create an output that has parameterType concepts:Price 2ronwalf // process is composed of a sequence 2ronwalf // first element of the sequence is a simple perform 2ronwalf // the input of the perform is coming from the parent perform 2ronwalf // add thid perform as the first element of the sequence 2ronwalf // second element of the sequence is a Split-Join that has to performs in it 2ronwalf // the input of the perform is coming from FindBookInfo perform 2ronwalf // then similarly perform BNPrice 2ronwalf // the input of the perform is coming from FindBookInfo perform 2ronwalf // finally add the Split-Join to the sequence 2ronwalf // feed the input from book previous performs to the comparison process 2ronwalf // add the comparison step as the last construct in the sequence 2ronwalf // we need a new composite process for the last step to do the 2ronwalf // comparison (we need local variables whihc can only be declared 2ronwalf // in conjunction with a process) 2ronwalf // the price from two bookstores as input 2ronwalf // the actual value for each price as locals 2ronwalf // the minimum price and the associated bookstore as outputs 2ronwalf // the first precondition is just to bind the value of concepts:amount property 2ronwalf // to the local variable for AmazonPrice 2ronwalf // exactly same as the previous one but for BNPrice. note that we could have 2ronwalf // equivalently create one precondition and add two atoms in it. the operational 2ronwalf // semantics would be same because multiple preconditions are simply conjuncted 2ronwalf // ComparePricesProcess is simply one If-Then-Else 2ronwalf // now the condition for If-Then-Else to compare values 2ronwalf // create two produce constructs to generate the results 2ronwalf // the produce construct to produce the price 2ronwalf // we directly pass the input value from the parent process as output to the parent process 2ronwalf // the produce construct to produce the name 2ronwalf // we need a constant string value to produce so use process:ValueData 2ronwalf // add the binding for this output 2ronwalf // now add both produce into this sequence 2ronwalf // create an OWL-S knowledge base 2ronwalf // create an empty ontology in this KB 2ronwalf // create SWRLFactory we will use for creating conditions and expressions 2ronwalf // load three OWL-S files and directly get the processes we want 2ronwalf // also add the imports statement 2ronwalf // get common classes, properties and datatypes we will need 2ronwalf // print the description of new service to standard output 2ronwalf // get the process of the new service 2ronwalf // initialize the input values to be empty 2ronwalf // get the parameter using the local name 2ronwalf // get the output param using the index