RE: Web Service Composition using OWL-S

Chris, I've suggested a few ideas inline. Hope this helps.
Take with a pinch of salt as nothing is tested.
Steve.

> -----Original Message-----
> From: public-sws-ig-request@w3.org 
> [mailto:public-sws-ig-request@w3.org] On Behalf Of Chris Parish
> Sent: 04 January 2006 13:20
> To: public-sws-ig@w3.org
> Subject: Web Service Composition using OWL-S
> 
> 
> I am currently attempting to describe web services using 
> OWL-S in such a way that I can perform automatic web service 
> composition.
> 
> Consider the following simple example.
> 
> Ontology
> --------
> Ontology has a class Person with properties ID1, ID2, Name, 
> where ID1/ID2 are integer values and Name is a string.
> 
> Web Services
> ------------
> Two web service operations exist which obtain ID2 given ID1 
> and Name given ID2, ie:
> 
> int ID1toID2(int ID1)
> String ID2toName(int ID2)
> 
> Composition
> -----------
> I want to generate a composition which given a person's ID1 
> returns their Name.
> 
> 
> Currently I am using a custom format to describe the web 
> services using the following rules:
> 
> 	(?person hasData ID1) -> (?person hasData ID2)
> 	(?person hasData ID2) -> (?person hasData Name)
>

I assume that ID1, ID2, Name here aren't variables but a convention for
asserting that fact that you have ID1, ID2...
You probably need to quote those values and place hasData in a suitable
namespace. :)
Incidentally, you really only need to make a unary assertion about
person here eg. (?person rdf:type eg:hasID1).

> By defining statement (?person hasData ID1) I then test 
> whether (?person hasData Name) can be inferred (I am using 
> the Jena generic rule reasoner for
> this) and from the resulting derivation the sequence of calls 
> required can be determined.

> 
> I am now trying to describe the services using a standard 
> format (OWL-S) but am not really clear how this should be 
> achieved.  The hasInput/Output Process properties are defined 
> with a parameterType which is either a class or an XSD 
> datatype, but what I want to do is define as a class/property 
> pair, eg. Person/ID1 otherwise a full semantic description of 
> the parameter is not possible.  Is this a limitation of OWL-S 
> or a result of my misunderstanding?

Looks to me like you're trying to do two things with hasInput/Output
which is really only meant to describe the parameter type, whereas it
looks like you want to evaluate a precondition (?person hasData 'ID1').

In you original service description, ID1 and ID2 are int so you could
use xs:int as the parameter type. The Name is a String so use xs:string.
For example, this would express the ID1 input of ID1toID2.

  <process:hasInput>
    <process:Input rdf:ID="ID1in">
      <process:parameterType
rdf:datatype="&xsd;#anyURI">&xs;int</process:parameterType>  
    </process:Input>
  </process:hasInput>

So the real question is how do you express the precondition and effect
of these operations. Your planner should not only check that the
inputs/outputs match up, but also that preconditions are satisfied by
earlier effects.

To express preconditions and effects I'd recommend looking at SWRL. To
express the precondition as you've stated it, (?person eg:hasData
'ID1'), I'd guess the SWRL would look something like the following. I've
used SWRL XML syntax as defined in
http://www.daml.org/rules/proposal/xmlsyntax.html. This differs from the
CongoBuy examples because I've not used an RDF AtomList, but an XML
ruleML body. Whatever the syntax, this lets you express the triples in
your rule body. Variables like Person need to be tied to
input/output/local parameters declared in OWL-S. It's probably easier to
evaluate these conditions directly against your model rather than
translating back into Jena rules.

  <process:hasPrecondition>
    <rdfs:label>(?person eg:hasData 'ID1')</rdfs:label>
    <expr:SWRL-Condition>
      <expr:expressionLanguage rdf:resource="&expr;#SWRL"/>
        <expr:expressionBody rdf:parseType="Literal">
          <ruleml:_body>
            <swrlx:datavaluedPropertyAtom swrlx:property="&eg;hasData"> 
              <ruleml:var>&thisNamespace;person</ruleml:var>
   		  <owlx:DataValue
owlx:datatype="&xsd;string">ID1</owlx:DataValue>
            </swrlx:datavaluedPropertyAtom>
          </ruleml:_body>
        </expr:expressionBody>
    </expr:SWRL-Condition>
  </process:hasPrecondition>

Because you introduced the extra person entity, I think you need to
introduce this as a local variable (process:hasLocal). Repeat for the
effect with a SWRL-Expression of (?person eg:hasData 'ID2') inside a
process:hasResult/process:hasEffect block, and do it all again for
ID2toName.

> 
> If I can achieve a satisfactory representation of the above 
> simple case within OWL-S, I have some more complex situations 
> which need to be handled:
> 
> 1) If their is a web service which requires ID1 of two people 
> where the two people are related (eg. person1 hasMother 
> person2, where hasMother is a further property added to the 
> ontology), how could this be handled so that the two 
> different ID1 parameters can be distinguished.
> 
> 2) If the web services operate on arrays instead of single values, eg:
> 	int[] Array_ID1toID2(int[] ID1)
> 	String[] Array_ID2toName(int[] ID2)
> How can these services be handled distinctly from those above.
> 
> Any ideas are most welcome.

I think the simplest approach is to map the array onto an RDF list. The
types of the input and output will change from xsd datatypes to
rdf:List.

> 
> Thank you
> 
> Chris Parish
> 
> 
> 
> 
> ..............................................................
> .....................................
> 
> This message and any attachments may contain OCC confidential 
> or proprietary information. If you are an unintended recipient: 
> 
> (i) immediately delete the information contained herein and 
> contact the author; and
> (ii) do not disclose, distribute, or duplicate any 
> information from this message or any of its attachments.
> 
> 
> 
> 
> 

Received on Thursday, 5 January 2006 14:28:34 UTC