In Step 1 (cf. Figure 7-117), we perform two activities, namely, (i) we derive the information PIMs and (ii) the behavior PIMs of Blue and Moon using the WSDL descriptions of their services.
PIM PIM
1 1
3
2 4 2
3 PIM
PSM PSM PSM
5
Deriving the Information PIMs
We derive the information PIMs of Blue and Moon from the types sections of the WSDL descriptions of their services. We do this by adopting and extending the rules defined in (Battle, 2006; García, 2005). The mapping rules are summarised in the table below:
Figure 7-117 Step 1. Abstracting WSDL descriptions of Blue and Moon to COSMO
XML Schema OWL
1. attribute DatatypeProperty
2. element of a simple type DatatypeProperty 3. element of a complex type ObjectProperty
4. simple type DatatypeProperty
7. restriction on a simple type subPropertyOf
5. complex type Class
6. restriction / extension of a complex type subClassOf a. complex type (sequence or all) intersectionOf
b. complex class (choice) intersectionOf(unionOf, complementOf)
8. minOccur / maxOccur constraint minCardinality / maxCardinality restriction
In the following, we present each rule and give a short example to illustrate it. All rules are generic; they can be applied to transform any XML schema to an OWL ontology.
1. An XML schema attribute is transformed to an OWL DatatypeProperty.
Example
<xsd:schema ...>
...
<xsd:attribute name=”name” type=”xsd:string”/>
...
</xsd:schema>
:name a owl:DatatypeProperty;
owl:dataRange xsd:string .
2. An XML schema element of a complex type is transformed to an OWL ObjectProperty.
Example
<xsd:schema ...>
...
<xsd:element name=”address” type=”AddressType”/>
...
</xsd:schema>
:address a owl:ObjectProperty;
rdfs:range :AddressType .
complex type
3. An XML schema element of a simple type is transformed to an OWL DatatypeProperty.
Example
<xsd:schema ...>
...
<xsd:element name=”city” type=”xsd:string”/>
...
</xsd:schema>
:city a owl:DatatypeProperty;
rdfs:dataRange xsd:string .
4. An XML schema simpleType is transformed to an OWL DatatypeProperty.
Example
<xsd:schema ...>
...
<xsd:simpleType name="adultAge">
<xsd:restriction base="integer">
<xsd:minInclusive value="18">
</xsd:restriction>
</xsd:simpleType>
...
</xsd:schema>
:adultAge a owl:DatatypeProperty;
rdfs:domain rdfs:subClassOf [ a owl:DatatypeRestriction;
owl:onDataRange xsd:nonNegativeInteger;
owl:minInclusive "18"^^xsd:integer ].
5. An XML schema complexType is transformed to an OWL Class. More precisely, (a) a complexType using the compositors sequence or all is transformed to an OWL Class defined as intersectionOf of property restrictions derived from the elements of the compositor.
Example
[ a owl:Restriction; owl:onProperty :street;
owl:allValuesFrom xsd:string ]
[ a owl:Restriction; owl:onProperty :city;
owl:allValuesFrom xsd:string ] )].
(b) A complexType using the compositor choice is transformed to an OWL Class defined as an expression containing OWL intersectionOf, unionOf and complementOf. If fact, the choice (i.e., exclusive or) is defined as combination of conjunctions (and), disjunctions (or), and negations (not), e.g. the choice between A and B is equivalent to (A or B) and not (A and B).
[ a owl:Restriction; owl:onProperty :dutchAddress;
owl:allValuesFrom :DutchAddressType ]
[ a owl:Restriction; owl:onProperty :ukAddress;
owl:allValuesFrom :UKAddressType ] ) owl:complementOf owl:intersectionOf (
[ a owl:Restriction; owl:onProperty :dutchAddress;
owl:allValuesFrom :DutchAddressType ]
[ a owl:Restriction; owl:onProperty :ukAddress;
owl:allValuesFrom :UKAddressType ] ) ) .
6. An XML schema complexType derived by extension from or restriction on another complexType is transformed to a rdfs:subClassOf assertion between the respective OWL classes.
Example
<xsd:schema ...>
...
<complexType name="Car">
<extension base="Vehicle">
</complexType>
...
</xsd:schema>
:Car a owl:Class;
rdfs:subClassOf :Vehicle.
7. An XML schema simpleType derived by restriction from another simpleType is transformed to a rdfs:subPropertyOf assertion between the respective OWL properties.
Example
<xsd:schema ...>
...
<simpleType name="adultAge">
<restriction base="age">
</complexType>
...
</xsd:schema>
:adultAge a rdf:Property;
rdfs:subPropertyOf :age.
8. XSD minOccur and maxOccur constraints are transformed to OWL minCardinality and maxCardinality property restrictions.
Example
<xsd:element name="city" type="xsd:string“ minOccur=”1” />
</xsd:sequence>
[ a owl:Restriction; owl:onProperty :street;
owl:allValuesFrom xsd:string ]
[ a owl:Restriction; owl:onProperty :street;
owl:minCardinality 1 ]
[ a owl:Restriction; owl:onProperty :city;
owl:allValuesFrom xsd:string ]
[ a owl:Restriction; owl:onProperty :city;
owl:minCardinality 1 ] )].
We apply the transformation rules on the types sections from the WSDL descriptions of Blue and Moon, and derive their information models in terms of OWL-DL. The complete information models are quite verbose, therefore we only present small excerpt of them in Turtle syntax (Beckett, 2007):
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix : <http://sws-challenge.org/schemas/rnet2#> . :AddLineItemResponseType a owl:Class;
rdfs:subClassOf
:AddLineItemResponse rdfs:range :AddLineItemResponseType . :Item a owl:Class;
rdfs:subClassOf
[ a owl:Restriction;
Deriving the Behavior PIMs
The behavior PIMs are derived using the interface section of the WSDL descriptions of Blue and Moon.
As presented in Chapter 3, a WSDL description contains two parts. In the abstract part, WSDL defines a web service in terms of messages accepted by the system that implements the service. The messages are defined by means of a type system (typically XML Schema) and their sequence and cardinality is defined by message exchange patterns (MEPs). An operation associates message exchange patterns with one or more messages.
An interface is used to group these operations. In the concrete part of the WSDL description, bindings specify the transport and wire format for interfaces. A service endpoint associates network address with a binding.
Finally, a service groups the endpoints that implement a common interface.
Using the WSDL descriptions of Blue and Moon we derive the initial behavior models of the systems (cf. Figure 7-118).
Moon’s SM
M1-M16 are the messages described in the beginning of this section. They are summarised in the following table:
Figure 7-118 The behavior PIMs of Blue and Moon
M1 Purchase Order Request M2 Acknowledgement of Receipt M3 Search Customer Request M4 Search Customer Response M5 Create New Order Request M6 New Order Response M7 Add Line Item Request M8 Add Line Item Response
M9 Close Order
M10 Order Line Item Confirmation M11 Purchase Order Confirmation M12 Acknowledgement of Receipt message
In this step, we provided evidence for the validity of Claim 1, i.e., service PIMs can be derived from their respective PSMs.