OCL Prime Talk

farrightSoftware and s/w Development

Aug 15, 2012 (5 years and 3 months ago)

366 views

Computation and
Information Structures

Flavors of Model Transformation

QVT with OCL/Prime and TRIPLEMOD


Jörn Guy Süß

Computation and Information Structures, TU Berlin


Department of Software Engineering,


Faculty of Mathematics and Physics,


Charles University Prague, Czech Republic


February 24, 2004

Computation and
Information Structures

February 24, 2004

2

Jörn Guy Süß

Overview

Motivation:

Practical Approaches to UML Queries & Transformations

OCL/Prime:

Implementing OCL for the Meta
-
Level


Basis: Meta
-
Model & Profile
-
Checker


Result: Transformation Environment & Language


TRIPLEMOD:

Mapping the Meta
-
Level to RDF


Basis: RDF, Triple & ODIS


Result: Flexible Reasoning and Mapping


Outlook & Challenges

Computation and
Information Structures

February 24, 2004

3

Jörn Guy Süß

Why Queries, Views & Transformations (QVT)?

Query

Orientation and Discovery in Models


Select and Export parts to artifacts

View

Selectively manipulate models


Partition workspace, allow transactions

Transform

Automatically Maintain Models


Convert between Metamodel Versions

Computation and
Information Structures

February 24, 2004

4

Jörn Guy Süß

XML and UML Theory ...

1: Mathematical
Instance
Structure

2: Denotation

<bar> <foo/> </bar>

3: Abstracted
Constraints
(“Classes”)

5: Construction

4: Structural
Selection

pg =

Computation and
Information Structures

February 24, 2004

5

Jörn Guy Süß

… and Practice

XML
UML
Structure
SAX-Parser 1999 or
earlier
JMI repositories 2001 and
later
Denotation
XML 1.0 1998, stable
Only 1 normative DTD
published, not up-to-date
Abstracted Constraints
DTD-Parser 1999 or
earlier, Schema 2001 and
earlier
OCL-Metamodel
constraints still not type-
checked today
Selection
XPath 2001 and earlier
No OCL parser
Projection
XSLT 2002
MOF 2.0 RFP for "Query,
Views and Trans-
formations" 2002
Computation and
Information Structures

February 24, 2004

6

Jörn Guy Süß

UseCase

Class

Component

Node

UML

BizCase

DTD

Schema

ASM

XSLT

XQL

Element

Transformation

Adapter

BrokerHost

AdapterHost

Goal Definition: Lightweight MDA

Computation and
Information Structures

February 24, 2004

8

Jörn Guy Süß

OCL Metamodel (and Profile) Checker

Metamodel
-
Consistency

Analysis

Design

Code & Doc.

Software

Type
-
Check of OCL Constraints

… using a Model
-
Façade of Dresden OCL

Instance Evaluation

… using a Visitor
-
based Interpreter

Profile
-
Checking

… using a Constraint
-
Extractor for the Extension
-
System

Computation and
Information Structures

February 24, 2004

9

Jörn Guy Süß

Applications in Forward & Reverse Processes

Profile consistency

Profile consistency

Analysis

Design

Code & Doc.

Software

. . .

. . .

. . .

. . .

A

D

C

S

A

D

C

S

… within one UML
-
Model

<<PIM>>



MBM Message

<<PSM>>



MBM XML DTD

Implementation

<<mapping>>

<<mapping>>

UML Profile

Refinement

…between several
UML
-
Models

Computation and
Information Structures

February 24, 2004

10

Jörn Guy Süß

Transformation Cycle

Profile consistency

Profile consistency

Analysis

Design

Code & Doc.

Software

. . .

. . .

. . .

. . .

A

D

C

S

A

D

C

S

Manipulation of

selected

elements

UML
constraints

Profile 1

constraints

Profile 2

constraints

Computation and
Information Structures

February 24, 2004

11

Jörn Guy Süß

package

example


context

UseCase
def :


let

ucsNonExt
:Set(UseCase)
=


self.allInstances
-
>select(
uc
|
uc.extensionPoint
-
>size() = 0)


let

stBoundary
:Stereotype

=


Stereotype
.allInstances
-
>select(
st
|

st.Name
= "
Boundary
")


endpackage




INSERT INTO
Interface (Name)
SELECT

Name
FROM

ucsNonExt

;


UPDATE
Interface
SET
stereotype
=
stBoundary

WHERE
Name
In
ucsNonExt
.Name
;


A Minimal Working Example*

OCL

SQL

Interface
ExtensionPoint
UseCase
0..n
1
0..n
1
Stereotype
Modelelement
name : Name
+stereotype
+extended Element
Task
: Create Interfaces for all Use
Cases that do not have Extension
Points and Stereotype them as
“Boundary”

* inspired by [Jansson95]

Computation and
Information Structures

February 24, 2004

12

Jörn Guy Süß

Language interpreters
are described as
services.
Transformation acts
as both namespace
and transaction brace.
QueryExpression
<<DTDEl ementPCDATA>>
Service
type : (Java | WebService | HTTPPost)
class : CDATA
<<DTDEl ementPCDATA>>
ImplementationExpression
<<DTDEl ementPCDATA>>
Query_grp
{2}
{1}
Implementation_grp
{1}
{2}
Query
<<DTDEl ement>>
Implementation
<<DTDEl ement>>
Validation_grp
Rule_grp
{1}
{2}
Validation
<<DTDEl ement>>
Source
URI : CDATA
innerPath : CDATA
<<DTDElementEMPTY>>
Rule
<<DTDEl ement>>
1..n
1..n
Pre_grp
Post_grp
Step_grp
Inverse
URI : CDATA
innerPath : CDATA
inverseDesigner : CDATA
inverseDescription : CDATA
<<DTDEl ementPCDATA>>
Transformation
name : ID
description : CDATA
timeout : CDATA = 1500
isClosure : CDATA = false
targetURI : CDATA
<<DTDEl ement>>
+package
Pre
<<DTDEl ement>>
Post
<<DTDEl ement>>
Step
<<DTDEl ement>>
Transformation_grp
0..n
0..n
{3}
{1}
{5}
1..n
1..n
{4}
Params
<<DTDEl ement>>
{2}
Parameter
name : CDATA
description : CDATA
type : (Boolean | Integer | Real | String)
<<DTDElementEMPTY>>
Params_grp
0..n
0..n
Computation and
Information Structures

February 24, 2004

13

Jörn Guy Süß

Language interpreters
are described as
services.
Transformation acts
as both namespace
and transaction brace.
QueryExpression
<<DTDEl ementPCDATA>>
Service
type : (Java | WebService | HTTPPost)
class : CDATA
<<DTDEl ementPCDATA>>
ImplementationExpression
<<DTDEl ementPCDATA>>
Query_grp
{2}
{1}
Implementation_grp
{1}
{2}
Query
<<DTDEl ement>>
Implementation
<<DTDEl ement>>
Validation_grp
Rule_grp
{1}
{2}
Validation
<<DTDEl ement>>
Source
URI : CDATA
innerPath : CDATA
<<DTDElementEMPTY>>
Rule
<<DTDEl ement>>
1..n
1..n
Pre_grp
Post_grp
Step_grp
Inverse
URI : CDATA
innerPath : CDATA
inverseDesigner : CDATA
inverseDescription : CDATA
<<DTDEl ementPCDATA>>
Transformation
name : ID
description : CDATA
timeout : CDATA = 1500
isClosure : CDATA = false
targetURI : CDATA
<<DTDEl ement>>
+package
Pre
<<DTDEl ement>>
Post
<<DTDEl ement>>
Step
<<DTDEl ement>>
Transformation_grp
0..n
0..n
{3}
{1}
{5}
1..n
1..n
{4}
Params
<<DTDEl ement>>
{2}
Parameter
name : CDATA
description : CDATA
type : (Boolean | Integer | Real | String)
<<DTDElementEMPTY>>
Params_grp
0..n
0..n
Computation and
Information Structures

February 24, 2004

15

Jörn Guy Süß

OCL/Prime: Imperative Mapping

Prime

Language for creation of QVT languages

OCL/Prime

Reference Implementation


uses OCL for selection


SQL DMl for construction

To be used within

EVE

=> As shown yesterday

Computation and
Information Structures

February 24, 2004

16

Jörn Guy Süß

UseCase

Class

Component

Node

UML

BizCase

DTD

Schema

ASM

XSLT

XQL

Element

Transformation

Adapter

BrokerHost

AdapterHost

From UML
-
Metaclasses ...

Computation and
Information Structures

February 24, 2004

17

Jörn Guy Süß

… to RDF Statements

Is Part of

Is a special (stereotype)

Resides on

UseCase

Class

Node

UML

Component

BizCase

DTD

Schem
a

ASM

XQL

Element

Transformation

Adapter

Broker
Host

Adapter
Host

XSLT

Computation and
Information Structures

February 24, 2004

18

Jörn Guy Süß

“Can I sell coffee with Java?”: Models

UML
-
Model

Business
-
Ontology

Architecture Description Language

Computation and
Information Structures

February 24, 2004

19

Jörn Guy Süß

“Can I sell coffee with Java?”: Statements

UML
-
Model

The “sell
-
coffee”
use case is part of
end
-
user
-
sales.

Business
-
Ontology


End
-
user
-
sales is part of the
small business group.


Small business is doing online
sales.


Online sales need OLTP.

Architecture Description Language


OLTP is synchronous.


CORBA is synchronous.


You can do CORBA with RMI.


RMI is part of Java.

Computation and
Information Structures

February 24, 2004

20

Jörn Guy Süß

“Can I sell coffee with Java?”: Rules & Deductions

End
-
user
-
sales need OLTP.

Computation and
Information Structures

February 24, 2004

21

Jörn Guy Süß

“Can I sell coffee with Java?”: More Deductions

You can sell coffee with Java! And here is how you do it (proof) ...:

Computation and
Information Structures

February 24, 2004

22

Jörn Guy Süß

“Let’s sell coffee with Java!”: Assertions

Computation and
Information Structures

February 24, 2004

23

Jörn Guy Süß

TRIPLEMOD: Declarative Mapping

Prerequisite

Map MOF
-
Model (& other sources) to RDF

Approach

Describe expert rules to validate


Assert new facts (in RDF
-
Model)


Map RDF back to MOF

Technology

Triple, an RDF language on top of Prolog


+ ODIS, a Triple system by FhG ISST

Computation and
Information Structures

February 24, 2004

24

Jörn Guy Süß

Outlook & Challenges

Outlook

several approaches to mapping (QVT)


no single favorite (flavors of prog. language)


only viable if models and tools available

Challenges

split of model material by standard versions


copyright on standard
-
based items


excessive complexity in approaches