• Ei tuloksia

3. Methods

3.5 Generating OWL-S from WSDL Documents

A WSDL document typically contains all of the information necessary to invoke a web service. Therefore, executable OWL-S processes may be derived from WSDL documents. However, the WSDL documents must contain SAWSDL annotations from which it is possible to determine the semantic details of the OWL-S processes, such as input parameter types as well as the conditions and effects of invoking the services. The approach presented in this section includes the typical method of annotating XML schema elements with references to OWL classes and providing XSLT transformations for translation between the XML schema and OWL. Addi-tionally, this section proposes several additional conventions for use in the derivation of OWL-S descriptions from annotated WSDL documents.

Figure 3.9 illustrates the use of SAWSDL annotations in the proposed approach.

In the figure, diamond shapes represent aggregation relationships, dashed arrows represent SAWSDL model references, and solid arrows represent other language-dependent references, such as references to variables in SWRL rules. The model references refer to OWL individuals by their URIs. XSLT transformation scripts have no URIs. Nonetheless, they can be saved as XML files and made accessible through URLs, so that the SAWSDL lowering and lifting schema mapping annota-tions can refer to the URLs.

SAWSDL sets no restrictions on how the actual OWL descriptions are accessed.

In Figure 3.9, the WSDL document contains a small embedded OWL document which imports the actual OWL descriptions, such as the domain ontology and the referenced SWRL rules. In addition, the embedded OWL document may contain theBinding instances to be used in replacing variables in the SWRL rule referents in order to specialize the rule conditions and effects for the service instance described.

The software component that processes the service WSDL descriptions uses the SAWSDL annotations in generating executable OWL-S processes, namely instances of the class AtomicProcess defined in the OWL-S Process ontology. In the seman-tic web service orchestration framework described in this dissertation, the software component is a web service called Service Monitor [84]. Therefore, in the sequel, the software component will be referred to as Service Monitor. To allow the generated

3. Methods 57

Figure 3.9: SAWSDL annotations are added to WSDL operations, port types, message parts and schema elements.

processes to be executed, Service Monitor additionally generates a grounding for each of the generated processes.

The UML class diagram in Figure 3.10 illustrates the structure of the OWL-S documents that Service Monitor generates from the annotated WSDL documents.

Figure 3.10 represents the structure as a simplified UML class diagram, in which the classes correspond to the classes in the OWL-S ontology for which Service Monitor creates instances, and the associations represent the same-named OWL object prop-erties in the OWL-S ontology. The attributes of the classes in the diagram represent the OWL datatype properties for which Service Monitor writes values.

The following subsections describe the proposed approach of applying SAWSDL annotations to specific WSDL entity types. The approach differs from the guidance given in the SAWSDL specification [20], which appears to provide suggestions rather than strict definitions [54].

3.5.1 WSDL Operations

The model references of WSDL operations may refer to SWRL rules and instances of theBinding class defined in the OWL-S Process ontology. Each rule is the source of the condition and effect expression extracted for one generated OWL-S Process

3. Methods 58

Figure 3.10: The generated OWL-S model both describes the service functionality and provides sufficient data to invoke the service.

Result. Each binding specifies an OWL individual to replace a SWRL variable when copying the conditions and effects from the rule references to the generated OWL-S Process Results. Thus, it is possible to formulate the conditions and effects for a group of web services of the same type using only a few SWRL rules.

As noted in Section 3.4.3, the SWRL rule syntax can be extended to also allow negative conditions and effects.

3.5.2 WSDL Port Types

The model references of a WSDL port type may refer to instances of the Binding class. Such references are a shorthand for annotating each of the port type operations with the Binding instances.

3.5.3 WSDL Outputs

The model reference of an Output may refer to an OWL individual. Each refer-ent is interpreted to represrefer-ent the value of the output after a successfull service invocation. Service Monitor will generate a corresponding OutputBinding for the generated Process.

3. Methods 59

3.5.4 WSDL Message Parts

Service Monitor will generate an OWL-S Process Input or Output for each WSDL message part used in an operation input or output. The model reference of the message part may specify the SWRL variable that the generated parameter will replace in the generated condition and effect expressions.

3.5.5 XML Schema Definitions

The model reference of a schema element may refer to an OWL class or to an OWL datatype property. Service Monitor uses the referents in determining the parameter types of the generated process parameters. The latter referent type is a special case, in which the parameter type is the range of the referent property. Hence, a datatype property referent indicates that the generated OWL-S parameter takes data values instead of OWL individuals.

Regardless of the referent type, lifting schema mappings may additionally be specified. Service Monitor will then download the XSLT scripts from the URIs used as the annotation values and insert them into the generated OWL-S Groundings.

When an element used in an output message has no lifting schema mapping, Service Monitor will generate the XSLT scripts by analyzing the model references. However, for input messages, Service Monitor generates a single XSLT transformation script, and lowering schema mappings specified for the individual elements are ignored.

If the referent is an OWL class, XSLT derivation requires that all individuals of the class are known, and a mapping between string parameter values and the OWL individuals is specified through SAWSDL model references. An example of such a mapping can be found on lines 21-23 in Listing 5.9 in Section 5.6.

If the same XML schema type is used in several schema elements, it may be convenient to add the SAWSDL annotations to the type definition. Service Monitor will then interpret the annotations exactly similarly as if they had been attached to the schema elements using the type definitions. Thus, it is unnecessary to explicitly annotate the schema elements.