Top Banner
Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri
28

Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Jan 02, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Your Mediators need Data Conversion!*

Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga

By

Prapulla Bajjuri

Page 2: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Introduction

• Converts the data from one format to another

• It provides tools for the specification and the implementation of data conversions among heterogeneous data sources.

• YAT model uses graphs for representation

• YATL is rule-based

Page 3: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Translation Scenario

RDBMS OODBMS

SGML Files HTML files

YAT/relationalwrapper

YAT/SGMLwrapper

YAT/HTMLwrapper

YAT/ODMGwrapper

YATL translationrel + sgml ->odmg

YATL translationOdmg -> html

Page 4: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

YAT Model

• Consists of set of patterns and variable domains

• Two kinds of variables

(i) Data Variables

(ii) Pattern Variables

• The domain of data variable is the set of all data constants and variable names

• The domain of pattern variable is the set of all its instance patterns.

• Ground pattern.

Page 5: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Yat:

Att

Ptype

Psup:Pcar:

Pclass:

The YAT model

S2:S1:C1:

The Golf GTI modelThe car schema model

The ODMG model

Ptype:

class

car

L & Yat L

*

Yat

VV

Class

Class_name

Ptype

*Att

Y: int V String..V Tuple V*

Z: (set, list, bag, array)

V &Pclass

Ptype

*

name

S1:str

desc suppliers

S2:str set

&Psup

*

&Pcar

… …class

car

name desc

“Golf” “The 1995 volksGolf GTI….”

suppliers

set

&s1 &s2

Page 6: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Model Instantiation

• It relies on pattern instantiation which itself relies on variable domain inclusion.

(i) Each pattern of the instance model must be an instance of some pattern of the source model

(ii) A variable can be instantiated either by a constant belonging to the variable’s domain or by a variable whose domain is a subset.

Pattern for car objects

Pcar: classcar(names1:string, descS2:string, suppliersset&Psup)

Page 7: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

The YAT Language

• It is declarative and rule-based

• Deals with heterogeneity

• Deals with collections

• Detects cyclic programs

• Supports graphical interface

• Typing in YATL

Page 8: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 1

Psup(SN) :Class supplier ( name SN, city C, zip Z)

Pbr :brochure( number Num, title T, model Year, desc D, suppls supplier ( name SN, address Add)),Year > 1975,C is city(Add),Z is zip(Add)

*

Page 9: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 2

Pcar(pbr) :Class car ( name T, desc D, suppliers

set &Psup(SN) )

Pbr :brochure( number Num, title T, model Year, desc D, suppls supplier ( name SN, address Add)),{ }

*

Page 10: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 1’

Psup(SN) :Class supplier ( name SN, city C, zip Z, sells set &Pcar(Pbr) )

Pbr :brochure( number Num, title T, model Year, desc D, suppls supplier ( name SN, address Add)),

C is city(Add),Z is zip(Add)

{ }

*

Page 11: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Dealing with heterogeneity

Suppliers Relational Database Schema

suppliers[sid: integer, name: string, city: string, address: string, tel: string]

Cars[cid: integer, broch_num: string]

Sales[sid: integer, cid: integer, year: integer, sold: integer]

Page 12: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 3

Psup(SN) :Class car ( name T, desc D, suppliers set &Psup(Sid))

Pbr :brochure( number Num, title T, model Year, desc D, suppls supplier ( name SN, address Add)),Rsuppliers:Suppliers row (sid Sid, name SN, city C, addressAdd2, tel Tel).

Rcars:Cars row (cid Cid, broch_num Num),sameaddress(Add, C, Add2)

*

*

*

*

Page 13: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Dealing with collections

• YATL handles sets and lists.

• It provides one primitive for grouping and another for ordering.

• It allows to grouping on some criteria and ordering on others.

• Arrays can also be manipulated using YAT language.

Page 14: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 4

Pallsups( ) :

list &Psup(SN)

Pbr :brochure( number Num, title T, model Year, desc D, suppls supplier ( name SN, address Add)),

*

[]SN

Page 15: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Rule 5

New (Id) : Id:

Mat Y X A Mat X Y A[]J []I I J

Mat:

Output Transposed MatrixInput Matrix

Mat:

110 22 20 300 330100

Polo golf polo golf polo golf

Paris nice caen

sales sales

Polo golf

Paris nice caen paris nice caen

100 22 300 110 20 330

Page 16: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Detecting cyclic programs

• Removing the & symbol in Rules 1’ and 2 introduces cycle in the program

• Statically detecting cycles in a YATL program is undecidable

• This can be done by constructing dependency graph of dereferenced functions

• It rejects conversion programs working by recursion on the input tree.

• Rejects programs that are not safe-recursive.

Page 17: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Typing in YATL

• Input and output models can easily be inferred by considering

(i) input and output patterns

(ii) predicate/function signatures

(iii) variable domains

Rule 1Psup(SN) :Class supplier ( name SN, city C, zip Z)

Pbr :brochure(…… suppls supplier ( name SN, address Add)),Year > 1975,C is city(Add),Z is zip(Add)

*

Page 18: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Customizing programs

• Converts any ODMG data into HTML• An object is converted into HTML page• An atomic value is converted into a string• A collection is converted into a list of HTML items• An object reference is converted into an HTML anchor

Page 19: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

HtmlPage(Pclass) :Html( head title Classname, body(h1Classname, ul li, ( Att2, HtmlElement(Ptype))))

Pclass :class Classname Att Ptype, Att2 is concat(Att, “ : “)

Web 1

HtmlElement( Ptype) : S Ptype : Data, S is data_to_string(Data)

Web 2

•An object is converted into an HTML page

•An atomic value converted into a string

Page 20: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

HtmlElement(Ptype) :ul li( Att2, HtmlElement(P2: Ptype))

Ptype :tuple Att P2:Ptype, Att2 is concat(Att, “ : “)

Web 3

HtmlElement( Ptype) : Ptype : ul li HtmlElement(P2:Ptype) X:{ set, bag} P2 : Ptype

Web 4

* *

**

• A collection is converted into a list of HTML elements.

•A tuple is converted into a list of HTML items

Page 21: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

HtmlElement(Ptype) :

ol li HtmlElement(P2:Ptype))

Ptype :X : {list,array} P2:Ptype

Web 5

HtmlElement( Ptype) : Ptype : &Ptype,A( href & HtmlPage(Pclass), Pclass : cont Classname) class Classname P2:Ptype

Web 6

o(I)I

•A object reference is converted into an HTML anchor.

•A list or array is converted into a list of HTML elements.

Page 22: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

HtmlPage(Pcar) :html( head title car, body(h1car, ul( li ( ”name:”, T1), li( ”age:”, D1), li( ”suppliers:”, ul li a ( href HtmlPage(Psup), cont Classname)))))

Pcar :Class car ( nameT, desc D, suppliers set &Psup), Psup: classClassnameP2:Ptype, T1 is data_to_string(T), D1 is data_to_string(D)

*

*

Example

Page 23: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Combining programs

• YATL interpreter organizes the set of rules of a program hierarchically.

• For a given input pattern, the more specific rules matching the input are applied first then less specific rules are tried.

• User may also enforce the rule hierarchy.

Page 24: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Composing programs

• Using YATL , it is possible to compose two programs and generate a more efficient program.

• Composition mechanism: It takes two programs and checks whether they are compatible and produces the new program by combining them.

• Here it takes SGMLODMG and ODMGHTML and produces SGMLHTML

Page 25: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Example• Prg1: M1M2• Prg2: M2’M3• System instantiates prg2 with the patterns of

M2.• Prg2’: M2M3’

Page 26: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

YAT Architecture

• It does not provide the ability to query or update external sources.

• System is composed into three main parts

(i) The specification environment

(ii) The runtime environment

(iii) A library of programs and formats

Page 27: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

YAT Architecture

Import wrapper

Import wrapper

Graphical User Interface

Specification Environment

Static Typing

YAT pattern/ YATL rules management module

YATL programInstantiation module

Library of programs and models

Exportwrapper

Target 1

Runtime environment

YAT Patterns/YATL rulesManagement module

Type checker

YATL interpreter External Functions &

Predicates evaluation

Source 1 Source 2

Page 28: Your Mediators need Data Conversion!* Sophie Cluet, Claude Delobel, Jerome Simeon, K Smaga By Prapulla Bajjuri.

Questions….?

Thank You