wsmo implementation workshop matt moran, matthew.moran@deri 07 june 2005
DESCRIPTION
Towards Translating between XML and WSML based on mappings between XML Schema and an equivalent WSMO Ontology. WSMO Implementation Workshop Matt Moran, [email protected] 07 June 2005. Overview. Motivation It’s a WSDL and XML Schema world Background - PowerPoint PPT PresentationTRANSCRIPT
Copyright 2005 Digital Enterprise Research Institute. All rights reserved.
www.deri.org
Towards Translating between XML and WSML based on mappings between XML Schema and an equivalent
WSMO Ontology
WSMO Implementation WorkshopMatt Moran, [email protected]
07 June 2005
2
Overview
• Motivation– It’s a WSDL and XML Schema world
• Background– XML, XML Schema, what’s been done before
• Approach to Mapping– Three possible approaches, one chosen
• Creating the Mappings– Methodology, identifying mappings, next steps
• Grounding WSMO Choreography to WSDL– Linking to the standards
3
Motivation
• Web services being created and deployed now and for the next few years will be described using WSDL and XML Schema
• Want to define the mechanism for how WSMO service descriptions can be grounded to WSDL – Ground WSMO ontologies to XML Schema (this presentation)– Ground WSMO choreography descriptions to WSDL operations
• Lifting XML Schema to a corresponding ontology provides opportunities for data mapping at the conceptual level
4
Background - XML
• XML Pros – Standard language for sharing data across systems especially
the Web– Extensible tag set great flexibility, many XML based
languages for all kinds of purposes– Strong tool support parsers, editors, storage, querying
• XML Con– Semantics must be known by receiver of XML documents in
advance; can not be determined from the document itself
5
Background - XML Schema
• Defines constraints on syntax and structure of XML documents– Legal elements and attributes, order of child elements, default and fixed
values for elements and attributes
• Components of XML Schema– Simple types
• Built-in or defining constraints on values of built-in types
– Complex types• Define a data type composed of child elements of other data types• Define allowed structure of child elements• Extend or restrict definition of an existing complex type
– Elements• An association between a name and a type definition (simple or complex)
– Attibutes• An association between a name and a simple type. They can be global or in
the scope of a complex type.
6
Background – Previous Work
• Comparing XML schema (DTD, XMLS) to Ontologies
XML schema Ontologies
Define vocabulary and constraints for XML docs
Formal specification of shared domain theory
Structure Meaning, no explicit structure
• Embed semantic metadata into XML– Complement structure with semantics
• Lifting XML representation to OWL and RDF– We will take a similar approach
• Lowering ontologies to XML schema– More expressive to less expressive
Other Related Areas of Work
7
Approaches to Mapping
• Map between XML and WSML/XML
• Map between XML and WSML
• Lift XML to ontological representation and create mappings from WSMO to WSMO at conceptual level
8
Approach to Mapping #1
• Direct transformation between XML as defined in WSDL and the XML syntax for a target WSMO ontology
• Use XSLT
• Disadvantages– Might be no suitable WSMO ontology– New XSLT must be created for every XML/ WSMO ontology pair– Syntactic mapping based on the structure of the XML document– Low possibility for re-use of WSMO data mediation– The XML syntax of WSMO has less parser support
9
Approach to Mapping #2
• Map directly between XML and WSML instances• Create a mapping language for this
– Maybe XSLT
• Disadvantages (mostly same as approach #1)– Might be no suitable WSMO ontology– New mapping needed for every XML Schema/WSMO ont. pair– Low possibility for re-use of WSMO data mediation– Syntactic mapping based on the structure of the XML document
10
Approach to Mapping #3 (the chosen one)
• Define mapping at the conceptual level• Create WSMO Ontology from XML Schema of WSDL
– Define mappings from conceptual framework for XML Schema to WSMO Ontology metamodel
– Generate ad-hoc ontology– Create set of executable mapping rules for data instances
• Benefits– Take advantage of data mediation– Mapping rules generated automatically– No additional ontology required (in simplest case)
11
Creating the Mappings – Example Scenario
• Semantic service description designer with the task of providing a semantic description for the Amazon service
• Only consider scenario in terms of grounding the data• Imagine that a tool exists that can automatically create a
ad-hoc WSMO ontology from an XML Schema• Two scenario use cases
– No mediation required– Mediation required
12
Creating the Mappings: Use Case 1
• The ad-hoc ontology is sufficient for designer’s needs• Mapping rules to get from instances of WSMO to
instances of XML and vice-versa are created automatically during creation of the ad-hoc ontology
13
Creating the Mappings: Use Case 2
• Designer wishes to use a specific book ontology• Ad-hoc ontology + rules created as before• Additional data mediation needs to be defined (using
existing tools)
14
Creating the Mappings: Methodology
• Define a mapping between the XML Schema Conceptual Model to the WSMO Ontology Metamodel.
• Create an executable description of these mappings to enable the automatic creation of ad-hoc WSMO ontologies from specific XML Schema.
• Create the bidirectional mappings rules to be used for the transformation between XML instances and WSMO instances. – Should be created at the same time as the generation of the ad-
hoc WSMO ontology from an XML Schema. – The creation of these mapping rules should be automatic as they
should be completely derived from the actions described in the first two bullet points.
15
Creating the Mappings: Methodology
16
Mapping from XML Schema to WSMO
00 <xsd:schema xmlns:xsd="http://www.ws.org/2000/08/XMLSchema"> 0102 <xsd:element name="resumes" type="resumeTypes"/> 0304 <xsd:complexType name="resumesTypes"> 05 <xsd:sequence>06 <xsd:element name="applicantName" type="xsd:string"/>07 <xsd:element name="jobsAvailable" type="jobListType"/>08 </xsd:sequence>09 <xsd:attribute name="applicationDate" type="xsd:date"/>10 </xsd:complexType> 1112 <xsd:complexType name="jobListType"> 13 <xsd:sequence>14 <xsd:complexType name="job" type="jobDesc">15 <xsd:attribute name="jobid" type="xsd:string"/>16 </xsd:complexType name="job" type="jobDesc">17 </xsd:sequence>18 </xsd:complexType> 1920 <xsd:complexType name="jobDesc"> 21 <xsd:element name="title" type="xsd:string">22 <xsd:element name="salary">23 <xsd:simpleType>24 <xsd:restriction base="xsd:positiveInteger">25 <xsd:maxExclusive value="55000">26 </xsd:restriction>27 </xsd:simpleType>28 </xsd:element>29 </xsd:complexType>3031 </xsd:schema>
17
Mapping from XML Schema to WSMO
00 <xsd:schema xmlns:xsd="http://www.ws.org/2000/08/XMLSchema"> 0102 <xsd:element name="resumes" type="resumeTypes"/> 0304 <xsd:complexType name="resumesTypes"> 05 <xsd:sequence>06 <xsd:element name="applicantName" type="xsd:string"/>07 <xsd:element name="jobsAvailable" type="jobListType"/>08 </xsd:sequence>09 <xsd:attribute name="applicationDate" type="xsd:date"/>10 </xsd:complexType> 1112 <xsd:complexType name="jobListType"> 13 <xsd:sequence>14 <xsd:complexType name="job" type="jobDesc">15 <xsd:attribute name="jobid" type="xsd:string"/>16 </xsd:complexType name="job" type="jobDesc">17 </xsd:sequence>18 </xsd:complexType> 1920 <xsd:complexType name="jobDesc"> 21 <xsd:element name="title" type="xsd:string">22 <xsd:element name="salary">23 <xsd:simpleType>24 <xsd:restriction base="xsd:positiveInteger">25 <xsd:maxExclusive value="55000">26 </xsd:restriction>27 </xsd:simpleType>28 </xsd:element>29 </xsd:complexType>3031 </xsd:schema>
Simple Type
Complex Type
Element
18
Mapping Simple Types
• Built-in simple types– Simple mapping as WSMO supports XML Schema built-in types
• Simple Type based on restriction of a built-in type– Create a sub concept and use axiom to express the restriction
XML Schema
<xsd:element name="salary">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="55000">
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
WSML
concept salaryType subConceptOf xsd:positiveInteger
constraint salaryConstraint
definedBy ?X:salaryType and ?X<55000
19
Mapping Complex Types
• Complex types always map to a WSMO concept• Complex type can have sub-components that are a mixture of
simple types, attributes, elements and complex types• Sub-components with a built-in simple type are mapped to attributes
of the concept with the same type• Sub-components with simple types that are not built-in are mapped
to attributes of the concept with the type of the mapped simple type definition
• A sub-component that itself is a complex type, leads to the creation of a corresponding concept. The sub-component is then mapped to an attribute with the type of the newly created concept.
20
Mapping Complex Types
• Attributes within the scope of complex types provide an additional complexity
• We propose that the attribute acts as an extension to the definition of the concept mapped from the complex type definition
• This means:1. A concept for the complex type is created
2. A second concept is defined as a subconcept of 1.It contains an attribute mapped from the XML Schema attribute
21
Mapping Complex Types
XML Schema
<xsd:complexType name="jobListType">
<xsd:sequence>
<xsd:complexType name="job" type="jobDesc">
<xsd:attribute name="jobid" type="xsd:string"/>
</xsd:complexType name="job" type="jobDesc">
</xsd:sequence>
</xsd:complexType>
WSML
concept jobListType
job (0 *) ofType jobList_withAttrJobID
concept jobList_withAttrJobID subConceptOf jobDesc
jobid ofType xsd:integer
concept jobDesc
title ofType xsd:string
salary ofType salaryType
22
Mapping attributes and elements
• Elements are structural components within XML Schema– No mapping
• Although they do need to be considered when creating the rules for mapping between instances of XML and instances of WSMO– Why?– They define the element name required in the XML document
• Mapping attributes (outside complex types)– No mapping defined yet
23
Some Discussion Points & Next Steps
• XSLT is powerful but does not take account of semantics• Conceptual mapping offers better opportunity for reuse• How to deal with structural info during the mapping?
– Does a WSMO attribute maps back to and XML Schema sub element or to an attribute of an element?
– How to maintain the element names for the XML Schema – neither an attribute nor a sub element
• Need to formalise the mappings • Need to extend the mappings• Need to define how they mappings should be executed
24
Grounding WSMO Choreography to WSDL
• How is choreography represented in WSMO– States (made up of concepts) and transitions– Some concepts represent in or out messages
• Mode non functional property – In, out, shared
• Grounding non functional property– Specifies a set of URIs relating to that message– URIs point to WSDL in, out or fault messages
• URIs for identifying messages in WSDL 2.0– http://example.com/#wsdl.interfaceMessageReference(PrinterInterface/print/In
• WSDL WSMO – manual (with tool support)• WSMO WSDL – auto generation of WSDL
25
Summary
• Motivation is to provide the link to the WSDL and XML Schema world
• Grounding is needed for semantic service designers needing to describe an existing WSDL service
• Looked at a scenario with and without mediation• Three steps in approach
– Define mappings from metamodel of XML Schema to that of WSMO
– Use the mappings to create ad-hoc WSMO ontologies and …
– During ontology creation, generate mapping rules that can be applied at runtime to lift and lower data instances
• Presented some initial work for this first step with some example XML Schema and WSML
• Had a quick look at the approach for grounding WSMO chor.
26
Summary
Inaccuracy in WIW paper
27
Summary
Inaccuracy in WIW paper
Simplest case would consist of only the mapping rules required to lift and lower between XML and WSMO
28
Thanks, Q&A
Questions?