43
naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Embed Size (px)

Citation preview

Page 1: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

naam

An Ontology-Based Metalanguage with

Explicit Instantiation

Alfons Laarman

Committee:Dr. Ivan KurtevDr. Ir. Klaas van den BergArda Goknil, Msc

Page 2: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Overview

• Introduction– Title

• Problem Statement• Approach• The Metalanguage OGML• Results• Conclusion

2

Page 3: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Introduction (Title)

An Ontology-Based Metalanguage

with Explicit Instantiation

Model Driven Engineering

3

Page 4: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Introduction (Ontology)

• Ontology is the study of existence • Uses Observation & Logic

Existential dependence & metaphysical realism

SubstantialUniversal

SubstantialIndividual

MomentUniversal

Moment

4

Page 5: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Introduction (Model Driven Engineering)• In a model we capture the state of affairs in a

domain of interest• Instantiation / instanceOf• A UML model:

• Models raise the level of abstraction in software development

dateOfBirth : Integer = 1983

Jan : Student

buildIn : Integer = 1938

DeTragellijn : School

attends

dateOfBirth : Integer = 1984

Piet : Student

attends

-buildIn : Integer

School

-dateOfBirth : Integer

Student

-attends

5

Page 6: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Model transformation taken from OMG/MDA Guide 03

Introduction (Model Driven Engineering)

Models can be used to automate software development

6

Page 7: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

• A model is expressed in a modeling language

• A modeling language consist of concrete syntax, abstract syntax and semantics

• A modeling language makes an ontological commitment

• A modeling language can be represented as model

Introduction (Model Driven Engineering)

7

Page 8: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Introduction (Model Driven Engineering)

dateOfBirth : Integer = 1984

Piet : Student-dateOfBirth : Integer

Student

-name : string

Class

-name : string

Attribute

-owner

1

-attributes

*

* -type 1 -name : string

Object

-owner

1

-slots

*

-value

Literal

1-value *

1

-value

*-name : string

Slot

8

Page 9: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

M1 (models)

M0 (real world) Things

MetamodelM2

(Modeling language)

represents

Models Models

Introduction (Model Driven Engineering)

Modeling architecture

General-purpose

or domain-specific?

Support for multiple modeling

languages is desirable

9

Page 10: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

• Metamodeling is the

practice of defining a

modeling language

• A metalanguage

is introduced to define

Metamodels (MOF)

Introduction (Model Driven Engineering)

10

M1 (models)

M0 (real world)

Things

metamodelM2

(Modeling language)

Metametamodel

represents

M3 (metalanguage)

Models

Page 11: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem statement

11

Page 12: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement

Tradition modeling architectures do notprovide sufficient support for metamodelingIt lacks:• Support for data translation• uniform model handling

12

Page 13: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement (the problems)

data translation: uniform model handling:

The OCL specification only supports

UML and MOF

13

Taken from Kurtev 08

Page 14: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement (an analysis)

We found two sources of the problems:• Multiple instanceOf relations (relativity)• The expressiveness of the

metalanguage is imprecise

14

Page 15: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement (an analysis)

Multiple instanceOf: Relativity:

15

dateOfBirth : Integer = 1984

Piet : Student-dateOfBirth : Integer

Student

-name : string

Object

-owner

1

-slots

*

-value

Literal

1-value *

1

-value

*-name : string

Slot

-dateOfBirth : Integer

Student

UML Class

MOF Object

MOF Class

Page 16: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement (an analysis)

expressiveness of metalanguage:Guizzardi,Wand & Webber looked at the ontological

faithfulness of UML and concluded that it suffers from:• Construct excessiveness, overload and incompleteness

MOF uses the same constructs as UML and is thus unsuitable to express the ontological commitment of modeling languages

16

Page 17: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Problem Statement (research questions)

• How to provide an uniform interpretation of the instanceOf relation in the whole modeling architecture?

• How to ensure precise and consistent definition of metamodels?

17

Page 18: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Approach

18

Page 19: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

• Define a metalanguage which can express the instantiation semantics

• Base the language constructs on Ontology

Approach

19

Page 20: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage OGML

20

Ontology Grounded MetaLanguage

Page 21: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGMLOntological Constructs

21

Page 22: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGML Example Exercise. Express in OGML:

ObjectClassAttribute

-attributes

1

-owner

*

Slot

-slots

1*

* *

Literal

-value

1*

SimpleUML (blue):

Models:-dateOfBirth : Integer

Student

dateOfBirth : Integer = 1984

Piet : Student

22

Page 23: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGML

23

Example

Language SimpleUML {SubstantialDefinition Class {

...} DataTypeDefinition UMLDataType {

...}MomentDefinition Attribute {

...}ObjectDefinition Object {

...}ObjectDefinition Literal {

...}PropertyDefinition Slot {

...}

}

Page 24: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGMLOntological Relations

SubstantialUniversal

SubstantialIndividual

MomentUniversal

Moment

instantiatied to instantiatied to

characterizes

inheres in

24

Page 25: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

SimpleUML Language Definition

SubstantialDefinition

Class

MomentDefinitionAttribute

ObjectDefinitionObject

PropertyDefinitionSlot

CharacterizationRelation

InherenceRelation

Example

25

The Metalanguage: OGML

Page 26: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGML

26

The definition of instantiation semantics

(with the use of OCL)

Page 27: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

SimpleUML Language Definition

SubstantialDefinition

Class

MomentDefinitionAttribute

ObjectDefinitionObject

PropertyDefinitionSlot

InstanceOfDefinition

InstanceOfDefinition

CharacterizationRelation

InherenceRelation

Example

27

The Metalanguage: OGML

Page 28: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

28

Relations UMLInstanceOfDefinition { c : Class -> o : Object {

... } when (not(c.isAbstract))

a : Attribute -> s : Slot {...

}}

Page 29: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Class

Attribute

Object

name=StudentisAbstract=false

name=Piet

name=dateOfBirthrange=Integer

name=dateOfBirth

value=1984

Slot

Example

29

The Metalanguage: OGML

Page 30: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGMLOntological Perspective

Object Diagram

name=Piet

name=weigth

value=1984dateOfBith

1984

Class Diagram

name=Student

name=dataOfBirthrange=Integer

dateOfBith

Integer

Example

30

Page 31: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

How to define the perspective in the metamodel?

Ontology tells us about the nature of

relations: each participant has its own

view on the relation

Attribute Function

-name : String

Team team player

inY

ear

-year : Integer

Year

-name : String

Player

*

31

Page 32: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGML, Attribute functiona : Attribute -> s : Slot {

attributes { naming name <- a.name; valuing [a.lowerbound .. a.upperbound]

s.value; typing a.type;}

}}

Example32

Object Diagram

name=Piet

name=weigth

value=1984dateOfBith

1984

Class Diagram

name=Student

name=dataOfBirthrange=Integer

dateOfBith

Integer

Page 33: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Since OGML is a language to define languages, we can apply reflection

What is the ontological commitment for the models?

33

OGML

Language Models

The Metalanguage: OGML : Reflection

SubstantialDefinition Definition { attribute name : "String";

}SubstantialDefinition "SubstantialDefinition" extends UniversalDefinition {}SubstantialDefinition "MomentDefinition" extends UniversalDefinition {}SubstantialDefinition "DataTypeDefinition" extends UniversalDefinition {}SubstantialDefinition IndividualDefinition extends Definition {}SubstantialDefinition "ObjectDefinition" extends IndividualDefinition {}SubstantialDefinition "PropertyDefinition" extends IndividualDefinition {}

SubstantialDefinition LanguageDefinition {attribute definitions [*] : Definition, "Relations",

"GeneralizationRelation";}...

Page 34: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

The Metalanguage: OGML, Reflection

34

Page 35: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

35

The Metalanguage: OGML :Reflection

Relations OGMLInstanceOfRelation {

abstract Definition -> PropertiesElement {... }

sd : UniversalDefinition -> su : InstantiatableElement {... }

md : "MomentDefinition" -> mu : MomentUniversal {... }

"PropertyDefinition" -> XObject {} "SubstantialDefinition" -> SubstantialUniversal {} "DataTypeDefinition“ -> SubstantialUniversal {} "ObjectDefinition" -> XObject {} "Class" -> XObject {} "OGMLDataType" -> Literal {} InstanceOfRelation -> InstanceOfProperty {} ld : LanguageDefinition -> mm : MetaModel {... } a : Attribute -> p : Property {... } i : InherenceRelation -> p : Property {... } c : CharacterizationRelation -> p1 : Property {... } c : CharacterizationRelation -> p2 : Property {... } g : "GeneralizationRelation" -> p1 : Property {... } g : "GeneralizationRelation" -> p2 : Property {... }

}

Page 36: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Results

36

Page 37: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Results• To verify that OGML works we created a

prototype of the language• We conducted case studies and

expressed different kinds of UML• The OCL engine was used to show that

models can be uniformly handled (navigated)

• We proved that models are instanceOf OGMLX

37

Page 38: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Results: Navigating N-ary AssociationsPlayer Team Year salary

Davids TWENTE 1999 1000000

Kluivert TWENTE 2000 100000

Davids AJAX 1997 200000

Kluivert AJAX 1998 500000

Player Davids played in team TWENTE during 1999 for the mere sum of $1000000Player Kluivert played in team TWENTE during 2000 for the mere sum of $100000Player Davids played in team AJAX during 1997 for the mere sum of $200000Player Kluivert played in team AJAX during 1998 for the mere sum of $500000

-name : String

Team

-salary : Integer

PlayedIn

* *team player

inY

ear

-year : Integer

Year

-name : String

Player

*

38

{UML | UMLMM!Player.allInstances()->collect(ps | ps.player-

>collect(ac |'Player '+ ac.player.name +' played in team '+

ac.team.name + ' during '+ inYear.year +' for the mere sum of $'+

ac.salary)) ->iterate(row ; result: String = '' | result + row

+'\n')}

Page 39: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

39

Results: Navigating explicit relativeness

{OGML| UMLM!Kluivert->first().attributes}

{OGMLX| UMLM!Kluivert->first().properties}

Class

Association

Object

name=Playername=Kluivert

name=playedIn

Link

Object

name=playedIn

Year=1999

ObjectClassClass

name=Twente

name=Year

name=Team

Page 40: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

OGML constructs are defined self-reflectively

+ InstanceOfDefinitions map OGML to OGMLX constructs

= All models are instanceOf OGMLX

OGMLX stores the ontological meaning of constructs!

40

The Metalanguage: OGMLProof of Uniform model representation

Page 41: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

OGMLo :! OGMLXox :!

IO IO

IO

IOD

LANGUAGEl :IO

IO

MODELm :IO

IO

IO

OGMLi :

LANGUAGEl :'!

OGMLoo :!

41

The Metalanguage: OGMLProof of Uniform model representation

Page 42: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Conclusion

• OGML can provide uniform handling of models as demonstrated with OCL explicit relativity

• OGML provides an explicit ontological commitment for metamodels and models (via OGMLX)

• Compared MOF and OWL we are closer to the OWL reification model but preserve more meaning of the constructs

42

Page 43: Naam An Ontology-Based Metalanguage with Explicit Instantiation Alfons Laarman Committee: Dr. Ivan Kurtev Dr. Ir. Klaas van den Berg Arda Goknil, Msc

Conclusion

• Did OGML trade expressiveness for uniform model handling?

• We only expressed a subset of UML, what about RDF, OWL, MOF?

• Can this support data translation?

Future Work: investigate expressiveness

Extend OGML with mereology, multiple instantiation

43