model-driven software development with semantic web technologies

219
Web Science & Technologies University of Koblenz Landau, Germany Model-Driven Software Development with Semantic Web Technologies Fernando Silva Parreiras, Tobias Walter, Christian Wende and Edward Thomas

Upload: fernando-silva-parreiras

Post on 26-Jan-2015

115 views

Category:

Technology


1 download

DESCRIPTION

Ontologies constitute formal models of some aspect of the world that may be used for drawing interesting logical conclusions even for large models. Software models capture relevant characteristics of a software artifact to be developed, yet, most often these software models have limited formal semantics, or the underlying (often graphical) software language varies from case to case in a way that makes it hard if not impossible to fix its semantics. In this contribution, we survey the use of ontology technologies for software modeling in order to carry over advantages from ontology technologies to the software modeling domain. It will turn out that ontology-based metamodels constitute a core means for exploiting expressive ontology reasoning in the software modeling domain while remaining flexible enough to accommodate varying needs of software modelers.

TRANSCRIPT

Page 1: Model-Driven Software Development with Semantic Web Technologies

Web Science & TechnologiesUniversity of Koblenz ▪ Landau, Germany

Model-Driven Software Development with Semantic Web Technologies

Fernando Silva Parreiras, Tobias Walter, Christian Wende and Edward Thomas

Page 2: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial2 of 7

WeST

Tutorial Description

Purpose: to enable attendees to fully appreciate the application of semantic web and ontology technologies in MDSD.

Prerequisites: basic concepts of UML

Page 3: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial3 of 7

WeST

Objectives

We will show you how to: Use semantic web skills across your organization Understand the main concepts of semantic web and

ontology technologies. Identify the valued added by semantic web in MDSD. Identity potential applications of semantic web

technologies in MDSD. Apply semantic web tools to transform or validate software

models.

Page 4: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial4 of 7

WeST

Administrative Information

Facilities Coffee Break

• 10:30 – 11:00• 16:00 – 16:30

Lunch• 12:30 – 14:00

Page 5: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial5 of 7

WeST

Agenda

1. What are ontologies and what can they do for MDSD?Edward, Fernando 30min

2. Demystifying OWL. Edward 90min 3. Reasoning with OWL in Models. Tobias 60min4. Integrating OWL in Model-Driven Software Development -

TwoUse. Fernando 30min. 5. Case Studies 150min Improving Software Design Patterns. Fernando OWLizer and LOD in Model Driven Engineering. Fernando Ontology-based Domain Specific languages. Tobias Validating Process Refinements. Tobias

Page 6: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial6 of 7

WeST

Meet Your Classmates

Name Company name Experience in ontologies Current assignment Your expectations for the class

Page 7: Model-Driven Software Development with Semantic Web Technologies

<is web> Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

What are ontologies and what canthey do for MDSD

Fernando Silva Parreiras, Edward Thomas

Page 8: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial2 of 42

What is this unit about

This unit presents the basic concepts of ontology and ontology technologies and illustrate the application of ontologies with well-kown use cases.

Page 9: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial3 of 42

What You Should Be Able to Do

At the end of this unit you will be able to:• Understand the basic concepts of ontologies• Identify the usage of ontologies in MDE

Page 10: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial4 of 42

Rationale of this Talk

Core Statements:Ontologies are yet another type of Conceptual Models

Ontologies are used differently and with different technology than UML usually is

Hypotheses:1. Ontologies and SE modeling

may be integrated by MDE!

2. New possibilities for SE!

A Generic Process of MDA + Ontology Technologies

Advantages

Page 11: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial5 of 42

Agenda of this Talk

Part 1: What is an ontology? Definition Purpose, Usage, Formality, Type, Communities

Part 2: Two cases of MDA & ontology technologies Model checking Hybrid models

Page 12: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial6 of 42

Definition: What is an ontology?(in computer science)

Based on Gruber 93:

An Ontology is aformal specificationof a sharedconceptualizationof a domain of interest

⇒ Executable, Discussable⇒ Group of persons⇒ About concepts⇒ Between application

and „unique truth“

Page 13: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial7 of 42

Purpose: What is an ontology?

To make domain assumptions explicit Easier to change domain assumptions Easier to understand and update legacy data

To separate domain knowledge from operational knowledge Re-use domain and operational knowledge

separately

A community reference for applications

To share a consistent understanding of what information means

Page 14: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial8 of 42

Usage: What is an ontology?

Front-End

Back-End

Topic Maps

Extended ER-Models

Thesauri

Predicate Logic

Semantic Networks

Taxonomies

Ontologies

Navigation

Queries

Sharing of KnowledgeInformation Retrieval

Query Expansion

Mediation Reasoning

Consistency CheckingEAI

Page 15: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial9 of 42

lightweight heavyweight

Text Corpora

DataDictionaries

(EDI)

Ad-hocHierarchies

(Yahoo!)

Folks-onomies

Glossaries

Thesauri

XMLDTDs

PrincipledInformal

Hierarchies

DBSchema

XMLSchema

Data Models(UML, STEP)

FormalTaxonomies

Frames(OKBC)

DescriptionLogics

Glossaries &Data Dictionaries Thesauri,

Taxonomies

MetaData,XML Schemas,Data Models

Formal Ontologies& Inference

First-order,Higher-order,Modal Logic

F-Logic

Formality: What is an ontology?

Page 16: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial10 of 42

Example: What is an ontology?

Foundational Model of Anatomy Represents structures ranging from macromolecular

complexes to body parts Contains ~70,000 distinct concepts ~ 110,000 terms 140 relations Metaclasses to define class-level properties Attributed relations Different types of part-whole, location, and other spatial

relations Synonyms

Page 17: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial11 of 42

Agenda of this Talk

Part 1: What is an ontology? Definition Purpose, Usage, Formality, Type, Communities

Part 2: Two cases of MDA & ontology technologies Model checking Hybrid models

Page 18: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial12 of 42

Model-driven Architecture

Classical MDA

PIM PSM Code

JAVAUML UML

A Standard Process

Page 19: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial13 of 42

MDA & Ontology Case 1: Model Checking

Reasoning on UML class diagrams

Classical MDA

PIM PSM Code

Translation

OWL

JAVAUML UML

Page 20: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial14 of 42

Model Checking

Reasoning on UML class diagrams allows for checking:

Consistency of the diagram: Can the classes be populated?

Classification to identify the possible omission of an explicit generalization.

Equivalence among classes to discover redundancy.

Refinement of properties to apply stricter multiplicities or typing than the ones explicitly specified in the diagram.

Page 21: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial15 of 42

Model Checking: Example

UserAccount User0..n 10..n 1Owns

Student

Uses {complete, disjoint}

WebPortalAccount Researcher1..n0..1

Researcheris disjoint from

Student

if Researcher is empty, User and Student will be

redundantINCONSISTENT

Page 22: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial16 of 42

Model Checking: Example

UserAccount User0..n 10..n 1Owns

Student

Uses {complete, disjoint}

WebPortalAccount Researcher1..n0..1

INCONSISTENT

Advantage for SE:

Models with provably higher quality

Page 23: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial17 of 42

MDA & Ontology Case 2: Hybrid Models

Integrating UML Models and OWL Ontologies: TwoUseTwoUse: Transforming and Weaving Ontologies and UML for SE

Classical MDA

PIM PSM Code

OWL

JAVAUML UML

Previously:

Ontology Engineering

Software Engineering

TwoUse:

Combined Ontology &

Software Engineering

Page 24: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial18 of 42

MDA & Ontology Case 4: Hybrid Models

Case: Integrating UML Models and OWL Ontologies with TwoUse

PIM PIM Code

. . .

M2

M1

InstanceOf

PIM

UML Profiled Diagram

OWL Ontology

UML Class Diagram Java CodeTwoUse

Model

OWL(ODM)

UML/OCL

TwoUseMetamodel

Page 25: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial19 of 42

FreeTradeZone

Country

Customer PurchaseOrder

getCharges()

ProductName: String

UML

+hasProduct

+hasResident

+memberOfTradeZone+hasMember

+hasOrder

+hasCustomer

+livesIn

Hybrid Model: Example UML

1 0..n1..n

1

Page 26: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial20 of 42

FreeTradeZone

Country

Customer PurchaseOrder

getCharges()+has

Resident+memberOfTradeZone

+hasMember

+hasOrder

+hasCustomer

+livesIn

Hybrid Model: Example OWL

<<owlValue>>+{someValuesFrom = CountryFromEU}

<<owlRestriction>> CountryFromEU

<<owlValue>> {hasValue = eu} memberOfTradeZone : FreeTradeZone

livesIn

<<owlRestriction>> OrderFromEUCustomers

<<equivalentClass>>

+{someValuesFrom= CustomersFromACountry } <<owlValue>>

<<owlRestriction>> CustomerFromEUCountry

DutyFreeOrder = OrderFromEUCustomer

1 0..n1..n

1

<<owlRestriction>> DutyFreeOrder

hasCustomerOrdersFromEUCustomers hasCustomer SOME

CustomerFromEUCountries

OWL (ODM)

Page 27: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial21 of 42

Cases seen today (there are more):1. Model Checking, e.g. Reasoning on UML class diagrams (Berardi, 2005)2. Hybrid Approach, TwoUse: Integrating UML Models and OWL Ontologies

(Parreiras, Staab, Winter, 2007)

MDA with Ontologies

Classical MDA

PIM PSM Code

OWL

JAVAUML UML

Page 28: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial22 of 42

Key Messages for this Unit

Hypotheses:1 Ontologies and SE

modeling integrated by MDE (specifically MDA)!

2 New possibilities for SE!

A Generic Process

Advantages

Classical MDA

PIM PSM Code

OWL

JAVAUML UML

Joint engineering of ontologies and SE models.

Models with provably higher quality.

Page 29: Model-Driven Software Development with Semantic Web Technologies

<is web> Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

Thank You!

Page 30: Model-Driven Software Development with Semantic Web Technologies

Model-Driven Software Development with Semantic Web TechnologiesDemystifying OWL

Edward ThomasUniversity of Aberdeen

Page 31: Model-Driven Software Development with Semantic Web Technologies

Outline Introduction to Description Logic Makeup Syntax and Semantics Reasoning

The OWL family of Ontology Languages OWL 1 OWL 2

Open vs. Closed World Unique Name Assumption Tools and resources

2009-05-26

Page 32: Model-Driven Software Development with Semantic Web Technologies

Introduction OWL is not hard But it makes some assumptions These differentiate it from more

familiar KR formalisms

2009-05-26

Page 33: Model-Driven Software Development with Semantic Web Technologies

INTRODUCTION TO OWL & DESCRIPTION LOGICS

Demystifying OWL

2009-05-26

Page 34: Model-Driven Software Development with Semantic Web Technologies

DL Makeup DL consists of TBox (Terminology) ABox (Assertions)

Consider this to be analogous to Schema (ER Model) Data (database)

2009-05-26

Page 35: Model-Driven Software Development with Semantic Web Technologies

A DL consists of named Concepts Roles Individuals

2009-05-26

Page 36: Model-Driven Software Development with Semantic Web Technologies

TBox A TBox (Terminonagy Box) is a set of

“schema” axioms (sentences), e.g.:{∃≥50goodFriend v Popular,

goodFriend v friend}

i.e., a background theory for the vocabulary

2009-05-26

Page 37: Model-Driven Software Development with Semantic Web Technologies

ABox An ABox (Assertion Box) is a set of

“data” axioms (ground facts), e.g.:goodFriend (John,Kate)Mother (Kate)

2009-05-26

Page 38: Model-Driven Software Development with Semantic Web Technologies

Syntax Several common syntaxes exist

“everyone who has a child who is a doctor who has children who are all female”

DL Syntax:∃hasChild.(Doctor ∧ ∀hasChild.Female)

Manchester SyntaxhasChild some (Doctor and (hasChild only Female))

OWL Functional SyntaxSomeValuesFrom (hasChild IntersectionOf ↲(Doctor AllValuesFrom (hasChild Female))

2009-05-26

Page 39: Model-Driven Software Development with Semantic Web Technologies

TBox Syntax Boolean Operators

2009-05-26

DL Manchester ExampleIntersection ⊓ and Rich and DoctorUnion ⊔ or Doctor or LawyerComplement ¬ not not Lawyer

Page 40: Model-Driven Software Development with Semantic Web Technologies

TBox Syntax Restrictions

2009-05-26

DL Manchester ExampleExistential ∃ some eats some fruitUniversal ∀ only eats only fruitExact value ∋ value eats value bambooMin cardinality ≥ min hasChild min 3Max cardinality ≤ max hasChild max 3Exact cardinality = exactly hasChild exactly 3

Page 41: Model-Driven Software Development with Semantic Web Technologies

TBox Syntax Roles

2009-05-26

DL Manchester ExampleInverse ¯ inverse inverse eatsChain o eats o inhabits

Page 42: Model-Driven Software Development with Semantic Web Technologies

Subsumption TBox contains a set of concept and

role subsumptions

C1 SubClassOf: C2

C1 ⊑ C2

R1 SubPropertyOf: R2

R1 ⊑ R2

2009-05-26

Page 43: Model-Driven Software Development with Semantic Web Technologies

Subsumption These can be complex concepts

“everyone who has a child who is a doctor who has children who are all female is happy”

HappyPerson SubClassOf: hasChild some ↲(Doctor and (hasChild only Female))

HappyPerson ⊑ ∃hasChild.(Doctor ∧ ↲ ∀hasChild.Female)

2009-05-26

Page 44: Model-Driven Software Development with Semantic Web Technologies

Subsumption Complex concepts can appear on either (or

both) sides“everyone who is happy has a child who is a doctor who has children who are all female”

This is different from the previous sentence By adding both these sentences to our

ontology, we make the concepts equivalent A SubClassOf: B

B SubClassOf: A A EquivalentClass: B

2009-05-26

Page 45: Model-Driven Software Development with Semantic Web Technologies

Semantics The semantics for a DL are derived

from its features The semantics of OWL-DL are defined

here http://www.w3.org/TR/owl-

semantics/semantics-all.html#3 The formal definition is concise, but

not easy to understand

2009-05-26

Page 46: Model-Driven Software Development with Semantic Web Technologies

Semantics DLs use a Model Theoretic semantics An interpretation I consists of The domain or universe Mappings from Concepts to sets of instances Roles to pairs of instances

The semantics of a DL tell us how to interpret the domain

2009-05-26

Page 47: Model-Driven Software Development with Semantic Web Technologies

Semantics Given an ontology O, the constraints on

the possible interpretations may lead to consequences in those interpretations. C subsumes D w.r.t. an ontology O iff for

every model I of O, I(D) ⊆ I(C) C is equivalent to D w.r.t. an ontology O iff

for every model I of O, I(C) = I(D) C is satisfiable w.r.t. O iff there exists some

model I of O such that I(C) ≠ ∅ An ontology O is consistent iff there exists

some model I of O.

2009-05-26

Page 48: Model-Driven Software Development with Semantic Web Technologies

Reasoning Reasoning derives new facts from the

ontology Several standard services Consistency Satisfiability Classification Subsumption checking Instance retrieval Query answering Justification

2009-05-26

Page 49: Model-Driven Software Development with Semantic Web Technologies

Consistency Is the ontology semantically

consistent? Inconsistency arises when there is a

conflict in the axioms in the ontology A SubClassOf: not B

A(x), B(x)

2009-05-26

Page 50: Model-Driven Software Development with Semantic Web Technologies

Satisfiability Can some concept description be

instatiated? Given that A SubClassOf: not B (A and B) is not satisfiable (A or B) is!

How about creates only Sculpture and creates

some (Artwork and not Sculpture)

2009-05-26

Page 51: Model-Driven Software Development with Semantic Web Technologies

Classification Find all the named concepts which a

particular instance belongs to Tiger SubClassOf: Cat

Tiger (ShereKhan)Classify (ShereKhan) := [Tiger, Cat, T]

2009-05-26

Page 52: Model-Driven Software Development with Semantic Web Technologies

Subsumption checking For two concept or role descriptions A

and B, is every possible instance of A always an instance of B?

Carnivore SubClassOf: eats only AnimalShark SubClassOf: eats only FishFish SubClassOf: Animal

Given these, a reasoner can infer that Subsumes(Shark Carnivore) := true EVERY shark is a carnivore

2009-05-26

Page 53: Model-Driven Software Development with Semantic Web Technologies

Instance Retrieval Find all the instances of a particular

concept or role description Given A(a,b,c), B(a,c,d) IR(A and B) := [a,c] IR(A or B) := [a,b,c,d] And trivially: IR(A) := [a,b,c]

2009-05-26

Page 54: Model-Driven Software Development with Semantic Web Technologies

Query Answering Query answering is a special form of

instance retrieval Eg: q(x,z) A(x), R1(x,y), R2(y,z), B(z) Find instances x and z, such that x is an

instance of A, x is related to some value y by the role R1, y is related to some value z by the role R2, z is an instance of B

Currently there is no algorithm for complete query answering in OWL-DL

2009-05-26

Page 55: Model-Driven Software Development with Semantic Web Technologies

Justification Given some reasoning result A in

ontology O What is the minimal subset (or

subsets) of the axioms in O which are responsible for that result

2009-05-26

Page 56: Model-Driven Software Development with Semantic Web Technologies

Naming There is an informal naming convention for DLs

AL Attributive languageEL Intersection and existential qualificationF Functional propertiesE Full existential qualificationU Concept unionC Complex concept negationS ALC with transitive rolesO NominalsI Inverse propertiesN Cardinality restrictionsQ Qualified cardinality restrictions(D) Datatype properties

2009-05-26

Page 57: Model-Driven Software Development with Semantic Web Technologies

Naming Under this nomenclature: OWL-Lite is SHIF(D)

OWL-DL is SHOIN(D)

OWL2-DL is SROIQ(D)

2009-05-26

Page 58: Model-Driven Software Development with Semantic Web Technologies

THE OWL FAMILYDemystifying OWL

2009-05-26

Page 59: Model-Driven Software Development with Semantic Web Technologies

The family tree

OWL 2 DL

OWL 1 DL

OWL 2 QL

OWL 2 RL OWL 2 EL

SROIQ

SHOIN

DL-Lite

EL++

OWL 2 Full

In AC0

PTime-Complete

NExpTime-Complete

2NExpTime-Complete

Undecidable

30

Page 60: Model-Driven Software Development with Semantic Web Technologies

OWL 1 Successor to DAML+OIL language Became a W3C recommendation in

2004 Consists of three defined languages OWL-Lite is the DL SHIF(D)

OWL-DL is the DL SHOIN(D)

OWL-Full is first order logic Undecidable

2009-05-26

Page 61: Model-Driven Software Development with Semantic Web Technologies

OWL 1 Three sub langauges OWL-Lite OWL-DL OWL-Full

2009-05-26

Page 62: Model-Driven Software Development with Semantic Web Technologies

OWL-Lite Lightweight, easy to use language Supports most DL features we have

seen Some exceptions Restricted cardinality (0 or 1) Only intersection, no union or

complement Intersection only on named classes

Still worst case NExpTime

2009-05-26

Page 63: Model-Driven Software Development with Semantic Web Technologies

OWL-DL The real OWL 1 language Extends OWL-Lite with Arbitrary cardinality restrictions Boolean operations on class descriptions Property values USPerson SubClassOf: bornIn value USA

While maintaining the same complexity

2009-05-26

Page 64: Model-Driven Software Development with Semantic Web Technologies

OWL 2 OWL 2 working group began in 2005 Advances in DLs Expressivity SROIQ(D) (Horrocks and Sattler, 2006)

Tractability For TBox reasoning, EL++ (Baader et al,

2005) For query answering, DL-Lite (Calvanese et

al, 2004) For rules, DLP (Grosof et al, 2003) and PD*

(Herman et al, 2005)

2009-05-26

Page 65: Model-Driven Software Development with Semantic Web Technologies

Why OWL 2 Problems identified in OWL 1 Complexity for large ontologies OWL-Lite was still NExpTime Expressivity limitations Qualified cardinality restrictions Data ranges Keys etc

2009-05-26

Page 66: Model-Driven Software Development with Semantic Web Technologies

Differences Syntactic sugar Expressivity Punning Annotations Profiles

2009-05-26

Page 67: Model-Driven Software Development with Semantic Web Technologies

Syntactic Sugar DisjointUnion BrainHemisphere SubClassOf: ↲

DisjointUnionOf (LeftBrain RightBrain) Disjoint Classes DisjointClasses (A B C D E)

Negative property assertion NegativeObjectPropertyAssertion NegativeDataPropertyAssertion

2009-05-26

Page 68: Model-Driven Software Development with Semantic Web Technologies

Expressivity Self restriction SelfEmployed SubClassOf: hasBoss Self

Qualified cardinality restriction Allows a class description in cardinality

expressions BusyParent SubClassOf: hasChild ↲

max 3 Female Data property cardinality restrictions Person SubClassOf: hasSSN max 1

2009-05-26

Page 69: Model-Driven Software Development with Semantic Web Technologies

Expressivity Reflexive properties

The property holds true between every individual and itself ReflexiveProperty(livesWith)

Irreflexive properties The property is false between every individual and itself IrreflexiveProperty (smallerThan)

Asymmetric properies The property cannot hold both ways between two

individuals AsymmetricProperty (smallerThan)

Disjoint properties The same pair of individuals cannot share both properties DisjointObjectProperties (smallerThan biggerThan)

Property chain inclusion Properties can be subsumed by chains of properties locatedIn SubPropertyChain: locatedIn o partOf

2009-05-26

Page 70: Model-Driven Software Development with Semantic Web Technologies

Keys OWL 1 did not support keys For example:

“Every street is uniquely identified by a postcode”

In OWL 1 this became undecidable (inverse functional data property)

OWL 2 supports composite keys Street HasKey: postcode Transplant HasKey: donor recipient

organ

2009-05-26

Page 71: Model-Driven Software Development with Semantic Web Technologies

Metamodelling OWL 1 and 2 have disjoint sets of

properties, classes, objects OWL 2 allows these to share names This allows simple metamodelling CheesePizza SubClassOf: Pizza

hasTopping (CheesePizza, Mozzarella)orderFor (John CheesePizza)

Classes and datatypes must still be separate, as must object and data properties

2009-05-26

Page 72: Model-Driven Software Development with Semantic Web Technologies

Profiles Profiles in OWL 2 define fragments of

the language with known tractable properties EL QL RL

This provides a set of constructors for users who need very large ontologies

2009-05-26

Page 73: Model-Driven Software Development with Semantic Web Technologies

OWL 2 QL OWL 2 QL is the fragment targeted at

query answering Very restricted TBox constructs Any query can be rewritten into a

union of relational queries This gives AC0 query performance Same as relational databases

2009-05-26

Page 74: Model-Driven Software Development with Semantic Web Technologies

OWL 2 RL OWL 2 RL is the fragment which is

amenable to implementation using rule-based technologies

Most constructs are supported, but in a limited fashion

Complexity is polynomial VERY scalable reasoners exist Billions of statements, over hundreds of

nodes

2009-05-26

Page 75: Model-Driven Software Development with Semantic Web Technologies

OWL 2 EL OWL 2 EL captures the expressive

power of many very large ontologies SNOMED CT contains millions of classes

Complexity is worst case polynomial (including query answering)

Supports full existential qualification

2009-05-26

Page 76: Model-Driven Software Development with Semantic Web Technologies

OPEN VS. CLOSED WORLDDemystifying OWL

2009-05-26

Page 77: Model-Driven Software Development with Semantic Web Technologies

Open World OWL operates on an open world

assumption Relational databases, Prolog, and

many other KR languages use a closed world assumption

This leads to different behavior in OWL to what you may expect

2009-05-26

Page 78: Model-Driven Software Development with Semantic Web Technologies

Closed World Assumption

The closed world assumption implies that everything we don’t know is false, while the open world assumption states that everything we don’t know is undefined

— Stefano Mazzocchi

2009-05-26

Page 79: Model-Driven Software Development with Semantic Web Technologies

Closed World Assumption Example: Given the following ontology R(a,b) R(a,c):r, R(b,c):r, R(c,d):r X(b), not X(d).

And the following query Q(x) R(?x,?y), R(?y,?z), X(?y), not X(?z)

Under CWA, no results are returned With OWA, individual a will be returned. Although X(c) or not X(c) is unknown, it

does not affect the answer. In either model, answer a always holds.

2009-05-26

Page 80: Model-Driven Software Development with Semantic Web Technologies

Simulated CWA Closed world assumption can be

partially simulated Since OWL supports nominals, an

ontology can be closed by: Finding all named individuals Setting owl:Thing to be equivalent to this

set This prevents the reasoner from inferring

new unnamed individuals

2009-05-26

Page 81: Model-Driven Software Development with Semantic Web Technologies

Local CWA Local CWA goes further than simulated

CWA It allows complete knowledge to be

assumed for parts of an ontology Individuals classes can be closed Cat EquivalentClass:

{Henry,Garfield,James} Closing properties can be done, but it is

more difficult Supported in TrOWL reasoner

2009-05-26

Page 82: Model-Driven Software Development with Semantic Web Technologies

NAF and NOT OWL does not support negation as

failure Negation has to be made explicit This is called true NOT A(a,b,c) B(a,c,d) IR(A and not B) := [] Open world assumption! IR(A and naf B) := [b]

Supported in TrOWL reasoner

2009-05-26

Page 83: Model-Driven Software Development with Semantic Web Technologies

UNIQUE NAME ASSUMPTIONDemystifying OWL

2009-05-26

Page 84: Model-Driven Software Development with Semantic Web Technologies

Unique Name Assumption Unique name assumption assumes that

every object has a unique name For example, if we define a person X

and a person Y, under UNA: X differentFrom Y will hold true

OWL operates without this assumption This means that one object can have

many names Can be explicit using sameAs/differentFrom

2009-05-26

Page 85: Model-Driven Software Development with Semantic Web Technologies

UNA assumptions This lack of UNA can cause problems Unintuitive behavior with keys Street HasKey: postcode AcaciaRoad postcode “NW8 6DN”

BakerStreet postcode “NW8 6DN” Key violation?

Actually, this just entails AcaciaRoad sameAs BakerStreet

2009-05-26

Page 86: Model-Driven Software Development with Semantic Web Technologies

Applying local UNA OWL supports the AllDifferent

construct Pass it sets of individuals which are

different from one another AllDifferent(AcaciaRoad BakerStreet) Combined with the key, this leads to

inconsistancy Key violation!

Therefore UNA can be simulated in OWL

2009-05-26

Page 87: Model-Driven Software Development with Semantic Web Technologies

TOOLS AND RESOURCESDemystifying OWL

2009-05-26

Page 88: Model-Driven Software Development with Semantic Web Technologies

Reasoners Full DL Reasoners

Fact++ HermiT Pellet Racer

Approximation based KAON2 TrOWL

Lightweight CEL OWLGRES Quill REL

2009-05-26

Page 89: Model-Driven Software Development with Semantic Web Technologies

Ontology Editors Protégé Version 3.4 for plugin support Version 4.0 or 4.1 beta for OWL2 support

NeON tookit Eclipse based

Topbraid Composer Commercial tool

2009-05-26

Page 90: Model-Driven Software Development with Semantic Web Technologies

QUESTIONSDEMONSTRATION

Demystifying OWL

2009-05-26

Page 91: Model-Driven Software Development with Semantic Web Technologies

Web Science & TechnologiesUniversity of Koblenz ▪ Landau, Germany

Reasoning with OWL in Software Models

ECMFA Tutorial onModel-Driven Software Development with Semantic Web

Technologies

Tobias Walter

Page 92: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial2 of 45

WeST

Objectives

Context Software Languages Ontology Languages

Language Bridges Transforming Software Languages to OWL Integrating Software Languages with OWL

Services Reasoning Services Querying Services

Page 93: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial3 of 45

WeST

Context (Model Hierarchy)

Model hierarchy

Language User

Language Designer

Page 94: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial4 of 45

WeST

Context (Metametamodel)

Ecore M3 metametamodel

Page 95: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial5 of 45

WeST

Basics (Metamodel)

M2 metamodel (Activity Diagram) conforms to Ecore M3 metametamodel visualized using concrete syntax of UML class diagrams

Language Designer

Page 96: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial6 of 45

WeST

Basics (Metamodel) Ecore-based metamodel (Activity Diagram) conforms to Ecore M3 metametamodel visualized using textual concrete syntax

abstract class ActivityNode {reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

}class ObjectNode extends ActivityNode { }class Action extends ActivityNode {attribute name : String;

}

abstract class ControlNode extends ActivityNode { }class Initial extends ControlNode { }class Final extends ControlNode { }class Fork extends ControlNode { }class Join extends ControlNode { }class Merge extends ControlNode { }class Decision extends ControlNode { }

abstract class ActivityEdge {reference source [1-1] : ActivityNode;reference target [1-1] : ActivityNode;

}class ObjectFlow extends ActivityEdge { }class ControlFlow extends ActivityEdge { }

Language Designer

Page 97: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial7 of 45

WeST

Basics (Model)

Model (Activity Diagram) designed by language user

Language User

Page 98: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial8 of 45

WeST

Description Logics

Description Logics (DLs) are logics designed to represent and reason on structured knowledge

The domain of interest is structured into (TBox): concepts, which correspond to classes, and denote sets of

individuals roles, which correspond to associations, and denote binary

relations on individuals The knowledge is asserted through so-called assertions

(ABox)

They provide formal semantics

DLs provide the foundations for standard ontology languages, like OWL2

Page 99: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial9 of 45

WeST

Ontologies as Software Models

OWL2 Metamodel (excerpt)

Page 100: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial10 of 45

WeST

OWL2 Ontology (Example) Functional Style Syntax (axiom-based)

SubClassOf(ActivityEdge owl:Thing)

SubClassOf(ActivityNode owl:Thing)

ObjectPropertyDomain(to ActivityEdge)ObjectPropertyRange(to ActivityNode)

ObjectPropertyDomain(outgoing ActivityNode)ObjectPropertyRange(outgoing ActivityEdge)

ObjectPropertyDomain(from ActivityEdge)ObjectPropertyRange(from ActivityNode)

ObjectPropertyDomain(incoming ActivityNode)ObjectPropertyRange(incoming ActivityEdge)

ClassAssertion(action1 Action)

Page 101: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial11 of 45

WeST

OWL2 Ontology (Example)

Manchester Style Syntax (frame-based)Class: ActivityEdge

SubClassOf: owl:Thing

Class: ActivityNodeSubClassOf: owl:Thing

ObjectProperty: toDomain: ActivityEdgeRange: ActivityNode

ObjectProperty: outgoingDomain: ActivityNodeRange: ActivityEdge

ObjectProperty: fromDomain: ActivityEdgeRange: ActivityNode

ObjectProperty: incomingDomain: ActivityNodeRange: ActivityEdge

Individual: action1Types: Action

Page 102: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial12 of 45

WeST

Comparing Ecore with OWL

Many similar constructs

Reasoners use logic-based language Representation of software models in a logic-based language

We need bridges!

Ecore OWLpackage ontologyclass classinstance and literals individual and literalsreference, attribute data propertydata types data typesenumeration enumerationmultiplicity cardinalityOpposite reference Inverse object properties

Page 103: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial13 of 45

WeST

Software Language Bridges

2 kinds of Language Bridges M3 Transformation bridge M3 Integration bridge

Page 104: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial14 of 45

WeST

M3 Transformation Bridge

Transformation of Ecore Technical Space with Ontology Language OWL2 Transformation of Ecore-based Metamodels Transformation of conforming Models

Transformation Definition

Transformation Use

Page 105: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial15 of 45

WeST

M3 Transformation Bridge

OWLizer Transforming Software Metamodels to Ontology TBox Transforming Software Models to Ontology ABox

Language User

Language Designer

Page 106: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial16 of 45

WeST

Ecore to OWL - OWLizer

Language User

Language Designer

• Definition of Transformation Bridge• Model transformation rules according to mappings

of similiar constructs

Page 107: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial17 of 45

WeST

Ecore to OWL - OWLizer

Language User

Language Designer

SubClassOf(ActivityEdge owl:Thing)SubClassOf(ActivityNode owl:Thing)

ObjectPropertyDomain(to ActivityEdge)ObjectPropertyRange(to ActivityNode)ObjectPropertyDomain(from ActivityEdge)ObjectPropertyRange(from ActivityNode)

...

ClassAssertion(A Action)ClassAssertion(B Action)ClassAssertion(C Action)

ClassAssertion(e1 ObjectFlow)ClassAssertion(e2 ObjectFlow)

ObjectPropertyAssertion(to e1 B)ObjectPropertyAssertion(from e1 A)

...

use of transformationbrdige

use of transformationbrdige

Page 108: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial18 of 45

WeST

Extending Software Metamodels

Integration of Ecore Technical Space with OntologyLanguage OWL2

Integration of abstract Syntax• OWL2 metamodel + Ecore Metametamodel

Integration of concrete Syntax• OWL2 concrete syntax + Ecore concrete Syntax

Create Ecore-based metamodels with integrated• OWL2 axioms• OWL2 expressions

Page 109: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial19 of 45

WeST

Integration of abstract Syntax

Metamodel Integration by using Integration Operations Merge of concepts

Relation of concepts by• Specialization Relationship

• Association

Page 110: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial20 of 45

WeST

Ecore Metametamodel + OWL2 Metamodel

Integration of abstract Syntax Result: Integrated Metametamodel

Page 111: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial21 of 45

WeST

Textual Concrete Syntax for Coding Metamodels• Simple Syntax, similar to Java

Grammar (concrete Syntax):

Ecore concrete syntax

class ::= ["abstract"] "class" name [supertypes] "{" features "}";...

feature ::= attribute | reference;...

attribute ::= "attribute" name multiplicity ":" typeref ";";...

reference ::= "reference" name multiplicity [iscontainer] ":“ typeref ["oppositeOf" name] ";";

...

Page 112: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial22 of 45

WeST

Example of Ecore Textual Concrete Syntax

(textual) Activity Diagram Metamodelabstract class ActivityNode {

reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

}class ObjectNode extends ActivityNode { }class Action extends ActivityNode {attribute name : String;

}

abstract class ControlNode extends ActivityNode { }class Initial extends ControlNode { }class Final extends ControlNode { }class Fork extends ControlNode { }class Join extends ControlNode { }class Merge extends ControlNode { }class Decision extends ControlNode { }

abstract class ActivityEdge {reference source [1-1] : ActivityNode;reference target [1-1] : ActivityNode;

}class ObjectFlow extends ActivityEdge { }class ControlFlow extends ActivityEdge { }

Page 113: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial23 of 45

WeST

Extension of textual concrete syntax

• New non-terminals:• classAxioms: produces a list of OWL Class Axioms

• objectPropertyAxioms: produces a list of OWL Object Property Axioms

• dataPropertyAxioms: produces a list of OWL Data Property Axioms

class ::= ["abstract"] "class" name [supertypes] [classAxioms] "{" features "}";

classAxioms ::= ClassAxiom { "," ClassAxiom};

reference ::= "reference" name multiplicity iscontainer ":" typeref "oppositeOf“name [objectPropertyAxioms] ";";

objectPropertyAxioms ::= ObjectPropertyAxiom { "," ObjectPropertyAxiom};

attribute ::= "attribute" name multiplicity ":" typeref [dataPropertyAxioms] ";";

dataPropertyAxioms ::= DataPropertyAxiom { "," DataPropertyAxiom};

Page 114: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial24 of 45

WeST

Example

• Extended Metamodel of Activity Diagram (excerpt)class ActivityNode equivalentWith restrictionOn edge with some Final{reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

transitive reference edge [0-*] : ActivityNode isChain(outgoing, target);}

...

class Initial extends ControlNode, subClassOf restrictionOn outgoing with some

(restrictionOn with some (Action or ControlNode)){

}

Page 115: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial25 of 45

WeST

Reasoning Services

Consistency Checking Satisfiability Checking Classification

Subsumption Checking Explanation Querying

Page 116: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial26 of 45

WeST

Consistency Checking

Name Consistency CheckingSignature boolean consistency (Ontology O)Description Checks if the given ontology O is consistent, i.e. if there exists a model

(a model-theoretic instance) for O. If ontology O is consistent, thenreturn true. Otherwise return false.

Pattern b = consistency (O)Input An Ontology OOutput b = true iff o is consistent,

b = false otherwise

Page 117: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial27 of 45

WeST

Consistency Checking in Software Modeling

Accomplished Service Ensures that a Model does not contain any contradictory

facts with regard to its Language Metamodel

Requirements for Language Designers• Possibility to define Constraints and Restrictions• Define Axioms

Benefits for Language User• Qualitative Models

Page 118: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial28 of 45

WeST

Consistency Checking (Example)

class ActivityNode equivalentWith restrictionOn edge with some Final{reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

transitive reference edge [0-*] : ActivityNode isChain(outgoing, target);}

Receive Order

M2 Metamodel

M1 ModelInconsistency:

Missing Edge toFinal Action

Page 119: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial29 of 45

WeST

Satisfiability Checking

Name Satisfiability checkingSignature Set<Concept> GetUnsatisfiable (Ontology O)Description Find all unsatisfiable concepts in given ontology O. A concept in an

ontology is unsatisfiable if it is an empty set. Return NULL if thereis not any unsatisfiable concept.

Pattern b = GetUnsatisfiable (O)Input An Ontology OOutput b = NULL iff there is no unsatisfiable concept

b = a set of unsatisfiable concepts otherwise

Page 120: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial30 of 45

WeST

Satisfiability Checking in Software Modeling

Accomplished Service Finds unsatisfiable classes in a metamodel

Benefits for Language Designers More qualitative metamodels, where all classes can be

instantiated

Benefits for Language Users Less inconsistencies in models (because instances of

unsatisfiable classes lead to inconsistencies)

Page 121: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial31 of 45

WeST

Satisfiability Checking (Example)

class ActivityNode equivalentWith restrictionOn edge with some Final{reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

transitive reference edge [0-*] : ActivityNode isChain(outgoing, target);}

class Final extends ControlNodesubClassOf (restrictionOn edge with some ActivityNode) and

not(restrictionOn edge with some ActivityNode){ }

M2 Metamodel

Unsatisfiable Class:two contradictory

restrictions

Page 122: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial32 of 45

WeST

Classification

Name ClassificationSignature boolean classifiesAs (Ontology O, concept A, individual i)Description Checks if the given individual i is an instance of concept A in the

ontology ref, then return true. Otherwise return false.Pattern b = classifiesAs ( O, A, i)Input An Ontology O, Concept A and Individual iOutput b = true iff i is an instance of A,

b = false otherwise

Page 123: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial33 of 45

WeST

Classification in Software Modeling

Accomplished Service Determines the most specific type an Model Element

belongs to With respect to all Attributes and Properties in the Context

of the Model Element

Requirements for Language Designers Define Axioms Possibility to define Constraints and Restrictions

Benefits for Language Users Automatically Refinement of Model Elements Suggestions of suitable domain concepts to be used

Page 124: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial34 of 45

WeST

Classification (Example)

class ObjectNode extends ActivityNodeequivalentWith ((restrictionOn incoming with some ObjectFlow)

and (restrictionOn outgoing with some ObjectFlow))

{ }

M2 Metamodel

M1 Model

Send Invoice Make PaymentInvoice

Classify Invoice NodeResult: It is of type

ObjectNode

Page 125: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial35 of 45

WeST

Subsumption Checking

Name Subsumption CheckingSignature boolean subsumes (Ontology O, concept A, concept B)Description Checks whether the interpretation of A is a subset of the interpretation

of B in the given ontology O. If the interpretation of A is a subset ofthe interpretation of B, then return true. Otherwise returns false.

Pattern b = subsumes (O,A,B)Input An Ontology O and concepts A, BOutput b = true iff the interpretation of A is a subset of the interpretation

of B in the ontology O,b = false otherwise

Page 126: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial36 of 45

WeST

Subsumption Checking in Software Modeling

Accomplished Service Computes a Subsumption Hierarchy of all Classes based on all Class Expressions and Axioms in the

Ontology

Requirements for Language Designers Define Axioms Possibility to define Expressions and Restrictions

Page 127: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial37 of 45

WeST

Explanation

Name ExplanationSignature Set<Axiom> getExplanation (Ontology O, axiom Ax)Description Retrieve the set of axiom that entail axiom Ax in the given ontology,

then return them.Pattern b = getExplanation (O,Ax)Input An Ontology O and axiom AxOutput b = set of axiom that entail the given axiom Ax.

b = NULL otherwise

Page 128: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial38 of 45

WeST

Explanation for Software Modeling

Accomplished Service Explanations for subsumptions and unsatisfiable classes in

metamodels Explanations for inconsistencies in models

Benefits for Language Designers Debugging of metamodels

Benefits for Language Users Debugging of models

Page 129: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial39 of 45

WeST

Explanation (Example Unsatisfiability)

class ActivityNode equivalentWith restrictionOn edge with some Final{reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

transitive reference edge [0-*] : ActivityNode isChain(outgoing, target);}

class Final extends ControlNodesubClassOf (restrictionOn edge with some ActivityNode) and

not(restrictionOn edge with some ActivityNode){ }

M2 Metamodel

Explanation from TwoUse Toolkit---------------------------------------Unsatisfiability of Final:Explanation:

Final equivalentTo not edge some ActivityNodeand edge some ActivityNode

Page 130: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial40 of 45

WeST

Explanation (Example Inconsistency)

class ActivityNode equivalentWith restrictionOn edge with some Final{reference incoming [0-*] : ActivityEdge oppositeOf target;reference outgoing [0-*] : ActivityEdge oppositeOf source;

transitive reference edge [0-*] : ActivityNode isChain(outgoing, target);}

Receive Order

M2 Metamodel

M1 Model

Explanation from TwoUse Toolkit---------------------------------------CHECK CONSISTENCY

Consistent: No

Explanation: receiveOrder type ActionAction subClassOf ActivityNodeActivityNode equivalentTo edge some Final

Page 131: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial41 of 45

WeST

Querying

Name Query answeringSignature Set answering (Ontology O, query q)Description checks the answer sets of a query q to ontology O.Pattern res = answering (Ontology O, query q)Input An Ontology O, and a query qOutput res = a set of answers of the query to the ontology iff there is a answer

setres = NULL if there is not any answer

Page 132: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial42 of 45

WeST

Querying Service for Software Modeling

Accomplished Service Query for model elements and metamodel element Use of OWL2 entailment regime

Benefits for Language Designers Retrieving information on concepts

Benefits for Language Users Retrieving existing and complex parts of models

Page 133: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial43 of 45

WeST

Querying (Example) Find all actions, that are executed before „Ship Order“:

M1 Model

[orderaccepted]

Receive Order Close Order

Accept Payment

Ship OrderFill Order

Send Invoice Make Payment

Invoice

[orderrejected]

Query ( ClassAssertion(?i Action), ObjectPropertyAssertion(InverseInverseObjectProperties(edge)

?i shiporder))

Results:-----------------| c |=================| fillorder || receiveorder |-----------------

Page 134: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial44 of 45

WeST

Querying (Example)

Find all unsatisfiable classes:

Find all concepts that do not go via edge to Final:

Query ( SubClassOf(?c owl:Nothing) )

Results:------------| c |============| Nothing || Final |------------

Query ( EquivalentClasses(?c Not(ObjectSomeValuesFrom(edge Final))))

Results:-------------------| c |===================| ActivityDiagram |-------------------

Page 135: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial45 of 45

WeST

Discussion…

… Questions?

Page 136: Model-Driven Software Development with Semantic Web Technologies

Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

The TwoUse Toolkit

University of Koblenz-Landau

Page 137: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial2 of 9

ISWeb - Information Systems & Semantic Web

1. What?

2. How?

Page 138: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial3 of 9

ISWeb - Information Systems & Semantic Web

What?Platform for developing ontology-based applications

Page 139: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial4 of 9

ISWeb - Information Systems & Semantic Web

Yes, you can!

• Design ontologies with UML, graphically,

with Functional Syntax, add SWRL rules,

• Design DSLs, Software Design Patterns

• Validate BPMN

• Reasoning explanation

• Query with SPARQL, SPARQLAS

• And More…

Page 140: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial5 of 9

ISWeb - Information Systems & Semantic Web

Design

Page 141: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial6 of 9

ISWeb - Information Systems & Semantic Web

Validate

Page 142: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial7 of 9

ISWeb - Information Systems & Semantic Web

Query

Page 143: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial8 of 9

ISWeb - Information Systems & Semantic Web

Explanation

Page 144: Model-Driven Software Development with Semantic Web Technologies

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial9 of 9

ISWeb - Information Systems & Semantic Web

Other Functionalities

• Specify Ontology Mappings

• Specify Ontology APIs

• Generate Code

Page 145: Model-Driven Software Development with Semantic Web Technologies

<is web> Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

Improving Design Patterns by Description Logics: A Use Case with Abstract Factory and

Strategy Pattern

Fernando Silva Parreiras

EU STReP MOST

Page 146: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial2 of 12

This Talk is about

Software Design Patterns

Cla

ssifi

catio

n

Infe

renc

e

Varia

ntM

anag

emen

t

Factorization of common functionality

Algorithm Encapsulation

Choice of implementations

Sel ec tor

Pa tter n

Description Logics(OWL)

Weaving features of Description Logics into the Strategy Pattern under the variant management subset of software design patterns.

Page 147: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial3 of 12

Running Example

An order-processing system for an international e-commerce company in the United States

This system must be able to process sales orders in many different countries, like the USA and Germany, and handle different tax calculations.

Page 148: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial4 of 12

Strategy Pattern

How to improve it?

TaskController

so : SalesOrder

getRulesForCountry() : Taxprocess()

USTax GermanTaxCountry

name : String

TaxtaxAmount()

Customer

SalesOrderprocess(tax : Tax)

context TaskController::getRulesForCountry():Taxbody:if so.customer.country.name = 'USA' then

USTax.new()elseif so.customer.country.name = 'GERMANY' then

GermanTax.new()endif

endif

Drawbacks:

Tangling

Coupling

Context

StrategiesClient

2. 3.

4.

1.

Page 149: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial5 of 12

Building Blocks

- The TwoUse solutionUses an Ontology to describe Context and StrategiesClassifies dynamically the Context- Hybrid Diagram- Metamodel- Transformation Process

TaskController

so : SalesOrder

getRulesForCountry(): Taxprocess()

USTax GermanTaxCountry

name:String

TaxtaxAmount()

Customer

SalesOrderprocess(tax : Tax) Context

Strategies

Client

Page 150: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial6 of 12

Hybrid Diagram: Strategy Pattern + OWL

TaskController process()

(USSalesOrder)«owlClass»

USTax

«owlClass»Country

«owlClass»

Customer«owlClass»

TaxtaxAmount()

SalesOrder«owlClass»

process()getRulesForCountry()

«rdfSubClassOf»«rdfSubClassOf»

context SalesOrder::getRulesForCountry():OclTypebody:Select ?T where ?self directType ?T

USCustomer«owlRestriction»

«owlValue» {hasValue = USA} country : Country

«owlValue» {someValuesFrom=USCustomer} hasCustomer

GermanCustomer«owlRestriction»

«owlValue» {hasValue = GERMANY} hasCountry : Country«owlValue» {someValuesFrom=GermanCustomer} hasCustomer

«owlRestriction»

«equivalentClass»

«owlRestriction»

«equivalentClass»

UML

OWL

TwoUse

Dynamic Classification

GermanTax(GermanSalesOrder)

Reuse

Flexibility

No Coupling

No Tangling

Page 151: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial7 of 12

TwoUse Metamodels Organization

UML

SPARQL

TwoUse

MOFM3

M2

OWL

InstanceOf

Page 152: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial8 of 12

Transformation Process

PIM PSM Source Code

Java

UMLProfiled 4TwoUse

Con

cret

e S

ynta

xA

bstra

ct S

ynta

x M2

M1

UMLProfiled4Java

TwoUseJava Java

InstanceOf

Java MetamodelTwoUse

Metamodel

Metamodel Grammar Ontology

RDF XMLSyntax

OWL

OWLUML

Profiled4 OWL

OWL

PSM

1.

2.

2.

3.

OWL Metamodel

UML

UMLMetamodel

ReasonerAPI

Page 153: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial9 of 12

Key Messages

The Ontology can be: reused independently of platform; modeled and evolved independently of the execution logic; tested automatically by logical unit tests.

Changes required for adoption are minor.

Page 154: Model-Driven Software Development with Semantic Web Technologies

<is web> Information Systems & Semantic WebUniversity of Koblenz ▪ Landau, Germany

Thank You!

EU STReP MOST: http://www.most-project.eu

http://isweb.uni-koblenz.de/Projects/twouse

Page 155: Model-Driven Software Development with Semantic Web Technologies

<is web>

ISWeb - Information Systems & Semantic Web

Fernando Silva [email protected]

ECMFA Tutorial11 of 12

Related Publications

Silva Parreiras, F., Staab, S., Winter, A.: On marrying ontological and metamodeling technical spaces. In: ESEC/FSE’07, ACM Press

Silva Parreiras, F., Staab, S., Winter, A.: TwoUse: Integrating UML models and OWL ontologies. Technical Report 16/2007.

Download at http://isweb.uni-koblenz.de

Page 156: Model-Driven Software Development with Semantic Web Technologies

Web Science & TechnologiesUniversity of Koblenz ▪ Landau, Germany

Ontology-based Domain Specific languages

ECMFA Tutorial onModel-Driven Software Development with Semantic Web

Technologies

Tobias Walter

Page 157: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial2 of 15

WeST

Objectives

Motivation• Scenario• Requirements

Ontology-based DSL Frameworks• Design DSLs• Use DSLs

Conclusion

Page 158: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial3 of 15

WeST

Scenario (Roles)

DSL User

DSL Designer DSLMetamodel

uses

specifies

Domain Modelbuilds

Metamodeling Language

uses

specifies

requires

Guidanceand services

Constraints

based on

defined in

Framework Developer

Page 159: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial4 of 15

WeST

Scenario• Modeling physical devices, e.g. Cisco network devices

Cisco 7603:

Restrictions modeling a Cicso7603 device:• Every Cisco7603 has at least 1 Configuration7603• Every Configuration has at least 1 Slot in which a

SupervisorEngine card is plugged in• A Configuration7603 has exactly 3 Slots in which either a

HotSwappableOSM or SPAInterface card is plugged in.

SupervisorEngine

HotSwappableOSMSlot

Slot

Slot

Configuration

Device

Domain Model:

DSL Designer

Page 160: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial5 of 15

WeST

Scenario (DSL User)

• Requirements of DSL User:• Consistency Checking

• Debugging of domain models

HotSwappableOSM

Configuration

Device

• Domain Model:DSL User

(inconsistent)

Error

Page 161: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial6 of 15

WeST

HotSwappableOSM

Scenario (DSL User)

• Requirements of DSL User:• Consistency Checking

• Debugging of domain models• Validate incomplete models

• Guidance and explanations how to complete the model

Slot

Slot

Slot

Configuration

Device

• Domain Model:DSL User

(consistent)

Page 162: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial7 of 15

WeST

SPAInterface

HotSwappableOSM

HotSwappableOSM

Scenario (DSL User)

• Requirements of DSL User:• Consistency Checking

• Debugging of domain models• Validate incomplete models

• Guidance and explanations how to complete the model

Slot

Slot

Slot

Configuration

Device

• Domain Model:DSL User

(inconsistent)

ErrorErrorErrorExplanation:Configuration hasSlot some Slot and hasCard some SupervisorEngine

Page 163: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial8 of 15

WeST

SupervisorEngine

Scenario (DSL User)

• Requirements of DSL User:• Consistency Checking

• Debugging of domain models• Validate incomplete models

• Guidance and explanations how to complete the model• Suggestions of suitable domain concepts• Use of services without any extra effort

HotSwappableOSMSlot

Slot

Slot

Configuration

• Domain Model:DSL UserConfiguration7603

Device

Cisco7603

(consistent)

Page 164: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial9 of 15

WeST

State of the Art Metamodel of Physical Device DSL (PDDSL) (M2 layer)• Implemented using KM3 (a Java-like syntax)• Simple to use and understandable• But: Not effectual to define configurations with valid cards and slots

class Device {reference hasConfiguration [1-*]: Configuration;

}

class Cicso7603 extends Device{}

class Configuration {reference hasSlot [1-*]: Slot;

}

class Configuration7603 extends Configuration{}

class Slot {reference hasCard [1-*]: Card;

}

class Card {}

DSL Designer

Page 165: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial10 of 15

WeST

Proposed Solution

Integrate KM3 with ontology language OWL2• Provide a metamodeling language to specify

further DSLs

Design Domain Specific Languages• Develop new DSL with integrated constraints

and axioms

Use domain-specific languages• Builds domain models and uses servicesDSL User

DSL Designer

Ontology-based framework for domain-specific languages

Framework Developer

Page 166: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial11 of 15

WeST

Model-based Integration Architecture

• Framework Developer• Provide framework for designing and using DSLs

• DSL Designer• Defines abstract Syntax, concrete Syntax, semantics

• DSL User• Builds domain models

Integrated Metametamodel

:M3

:M2Integrated Model(Abstract Syntax)

Domain Model

instanceOf

instanceOf

KM3Metametamodel

OWL Metamodel

Constraints / AxiomsOWL

Ontology

instanceOf

ABox

TBox

Reasoning Service

M2':

M1':

Domain Definition Metamodel

(Concrete Syntax)transform

transform

Development Environment

Ontology Definition

Visualization

DSL User

DSL Designer

FrameworkDeveloper

Page 167: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial12 of 15

WeST

Integrated Modeling• Metamodel of PDDSLclass Device {reference hasConfiguration [1-*]: Configuration;}

class Cisco7603 extends Device

}

class Configuration

reference hasSlot : Slot;}

class Configuration7603 extends Configuration

}

class Slot {reference hasCard [1-*]: Card;

}

, equivalentWith restrictionOn hasConfigurationwith min 1 Configuration7603 {

{

equivalentWithIntersectionOf(restrictionOn hasSlot with min 1 Slot,

restrictionOn hasSlot somerestrictionOn hasCard some SupervisorEngine) {

{

,equivalentWith IntersectionOf(restrictionOn hasSlot with exactly 3 Slot,

restrictionOn hasSlot with somerestrictionOn hasCard with some

UnionOf(HotSwappableOSM, SPAInterface) {

{

DSL Designer

Page 168: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial13 of 15

WeST

Benefits of DL in Domain Modeling

Open World Assumption• assumes incomplete information by default• guidance and validation of incomplete models

Joint semantic definitions at 2 layers• M1- and M2 layer affect each other• simultaneously reasoning at M1- and M2 layer

Debugging and reasoning explanation• identifying debugging-relevant facts (e.g. model elements)

which lead to inconsistency with regard to the metamodel• explanations of errors in domain models

Page 169: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial14 of 15

WeST

Conclusion Framework Developer• Integration of KM3 and OWL at the M3 layer• Provide metamodeling language that allows

designing metamodels with embedded OWL Constructs

DSL Designer• Specifies new DSLs with additional, integrated

constraints

DSL User• Builds domain models• Gets services and guidance for freeDSL User

DSL Designer

Framework Developer

Page 170: Model-Driven Software Development with Semantic Web Technologies

Tobias [email protected]

ECMFA Tutorial15 of 15

WeST

Discussion…

… Questions?

Page 171: Model-Driven Software Development with Semantic Web Technologies

Web Science & TechnologiesUniversity of Koblenz ▪ Landau, Germany

OWLizer and Linked Data in Model Driven Engineering

Fernando Silva Parreiras

Page 172: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial2 of 45

WeST

What You Should Be Able to Do

At the end of this unit you will be able to:• Translate multiple software languages into OWL• Write queries over multiple software artifacts• Address problems like impact analysis with ontology

technologies.

Page 173: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial3 of 45

WeST

Scenario

Page 174: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial4 of 45

WeST

Linked Data

„Linked Data is about using the Web to connect related data that wasn't previously linked, or using the Web to lower the barriers to linking data currently linked using other methods. “

Page 175: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial5 of 45

WeST

Requirements

Extend modeling languages with new capabilities Identification of same or similar concepts in different

languages: Integration Management

Page 176: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial6 of 45

WeST

Features

Consistent view over multiple MOF Models Integrated well-formedness constraints Dependency checking Query Answering

Page 177: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial7 of 45

WeST

Integrating OWL and Ecore

Page 178: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial8 of 45

WeST

OWLizer: Mapping MOF and OWL

Page 179: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial9 of 45

WeST

OWLizer Example

Page 180: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial10 of 45

WeST

SPARQLAS Queries

Which Tasks realize Use Case Querying?

Namespace: = <http://www.eclipse.org/uml2/3.0.0/UML#>Select ?nameWhere: _:u name "Querying"^^xsd:string

_:u includeUseCases ?uc?uc ownedBehavior ?act?act node ?node?node type OpaqueAction?node name ?name

Page 181: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial11 of 45

WeST

SPARQLAS Queries

What Use Cases do I have to test If I update the componentwest.twouse.reasoner?

Namespace: uml = <http://www.eclipse.org/uml2/3.0.0/UML#>Namespace: srs = <http://west.uni-koblenz.de/SRS#>Namespace: mf = <http://west.uni-koblenz.de/EclipseManifest#>

Select ?nameWhere: ?component mf:name"west.twouse.reasoner"^^xsd:string

?component srs:requirement ?requirement?requirement srs:useCase ?uc?uc uml:name ?name

Union:?uc (inverse uml:addition o uml:includingCase) ?iuc?iuc uml:name ?name

Page 182: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial12 of 45

WeST

Key Message

With OWLizer, you can transform any Ecore-basedsoftware language into OWL

With OWL constructs like sameAs and EquivalentWith, youconnected similar concepts and instances over different languages

With SPARQLAS queries, you query multiple softwareartifacts

Page 183: Model-Driven Software Development with Semantic Web Technologies

Fernando Silva [email protected]

ECMFA Tutorial13 of 45

WeST

THANK YOU!

Page 184: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Feature-based Derivation of Ontology-Enabled Tool Environments

Page 185: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Christian Wende, TU Dresden 2

Motivation

Ontology-driven Software Development

• ODSD denotes our vision to address current MDSD challenges by contribution of ontology services

• ODSD is a generic approach with several variability dimensions • Languages used in development processes• Customisation of ontology technology for scalable reasoning• Customised guidance for specific development processes• Techniques for bridging modelling and ontology technology spaces• Repository infrastructure• …

• Tool environments are a vital factor of productivity and applicability of ODSD

• MOST demonstrators are organised in a product-line of ODSD tool environments – MOST TOPF

• reuse & customisation of generic infrastructure• Derivation of use-case specific variants

Page 186: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Development Process MOST TOPF

MOST Tool Product Family Engineering

Workbench Instantiation

MOST TOPF Architecture

Feature Model for Most TOPF

MOST Mapping Model

(1) VariabilitySpecification (2) Feature Realisation (3) Feature Mapping

(4) VariantSpecification

Variant Model forSoftware Process Guidance System

(5) Variant Derivation

OSGS

Feature-driven Workbench Instantiation

< variant of >

Application of ODSD in the development of the MOST TOPF• Ontology-driven software product line engineering• MOST TOPF development is itself a case study for ODSD

Page 187: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(1) Variabilty Specification: MOST TOPF Feature Model

Modelling Language

BPMN

UML

Metamodelling Language

ADOxx

EMF

TGraphs/GrUML

MOST Tool Product Family

Metamodelling Technical Space

FODA

BE-DSL

PDI-DSL

PD-DSL

Variability of Languages

Page 188: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(1) Variabilty Specification: MOST TOPF Feature Model

Ontology Language

RDFS

RDFS(FA)

OWL Full

OW2

OWL FA

Reasoner

Pellet

Fact+

TrOWL

MOST Tool Product Family

REL

Ontological Technical Space

World Assumption

Open World

Closed World

Variability of Ontology Technology

Page 189: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(1) Variabilty Specification: MOST TOPF Feature Model

MOST Tool Product Family

Software Process Guidance

MDE Process

SAP Process

Comarch Process

MOST Process

Tracing

Semantic Validation

Variability of Guidance

Page 190: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(1) Variabilty Specification: MOST TOPF Feature Model

Transformation Technology Mediation

Integration

CompositionModelling Level

M0 - System

M1 - Model

M2 - Metamodel

M3 - Metametamodel

Mapping/Transformation

ATL

QVT

Plain Java

Environment

Runtime

Design Time

Directionality

Bi-directional

Unidirectional

MOST Tool Product Family

Variability of Bridging Technology

Page 191: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(1) Variabilty Specification: MOST TOPF Feature Model

MOST Tool Product Family

Repository Infrastructure

Database

File System

Variability of Repository Infrastructure

Page 192: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(2) Feature Realisation: Generic Architecture for ODSD Tools

Page 193: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(2) Feature Realisation: Configuration of TrOWL

// trowl.properties

TODO include Edwards example config

I send him an email

TrOWL Customisation of Reasoning Technology

• TrOWL is a configurable, transformation based, tractable reasoner for OWL2

• Supports configuration of:• OWL dialect• Reasoner• Approximation techniques• OWA/CWA/CDA

• Configuration affects• Characteristics of reasoning services

(completeness, soundness)• Performance• Expressiveness• Ontology size scalability

Page 194: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(3) Feature Mapping: Mapped OSGS Component Architecture

* Feature modelexcerpt

Manual featuremapping

Page 195: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

// trowl.properties

TODO include Edwards example config

I send him an email

(3) Feature Mapping: Mapped TrOWL Configuration

* Feature modelexcerpt

Manual featuremapping

Page 196: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(4) Variant Specification: Feature model constraints ensure validity

* Feature modelexcerpt

Manual variantrefinement

Page 197: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

(5) Variant Derivation: Automatic derivation of MOST TOPF Instance

Derivation Steps• Variant model is used together with feature mapping and component diagram to

derive variant specific component diagram

Automatic VariantDerivation

// custom trowl.properties

Page 198: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Christian Wende, TU Dresden 15

Application of Ontology Technology in Software Product Line Engineering

Variability Modelling

• Extended Feature Models (Kang, 1990) for variability modeling• Mandatory and optional features

• E.g. Tracing, MDE Process

• Feature groups (and, or, xor)• E.g. SAP Process, Comarch Process, MOST Process

• Feature constraints (requires, conflicts)• E.g. SAP Process requires BPMN Language

• Ontology-based feature models verification (Pan, 2007)• Generate ontology that encodes variability constraints

and use reasoning to check for consistency• Report contradicting constraints, etc.

Software Process Guidance

MDE Process

SAP Process

Comarch Process

MOST Process

Tracing

Semantic Validation

OntologyConsistency

Page 199: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Christian Wende, TU Dresden 16

Application of Ontology Technology in Software Product Line Engineering

Feature Mapping

• Mapping Model stores mappings of features/feature terms to solution space artefacts (e.g., UML components)

• Mappings are checked for completeness (feature exists, component exists)

• Ontology-based feature term verification• Feature Terms: logical expressions on features

(and, or, not) that are mapped to solution space artifacts• Verified against feature model constraints• Invalid terms are reported and can not be mapped

Software Process Guidance

MDE Process

SAP Process

Comarch Process

MOST Process

Tracing

Semantic Validation

Ontology

Consistency

SAP Process andComarch Process

UML Component X

Page 200: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Christian Wende, TU Dresden 17

Application of Ontology Technology in Software Product Line Engineering

Variant Configuration

• Variant models describe a subset of the features in a feature model required for a specific use case

• Need to conform to variability defined in feature model• Mandatory features• Group constraints• Feature constraints

• Ontology-based variant verification (Pan, 2007)• Generate ontology that encodes variability constraints

of feature model and a specific variant model• Report inconsistencies in variant configurations

Software Process Guidance

MDE Process

SAP Process

Comarch Process

MOST Process

Tracing

Semantic Validation

OntologyConsistency

Software Process Guidance

MDE Process

SAP Process

Tracing

Semantic Validation

Page 201: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Christian Wende, TU Dresden 18

Application of Ontology Technology in Software Product Line Engineering

Comprehensible Product Line Validation

• Outline/Idea Models PapierSoftware Process Guidance

MDE Process

SAP Process

Comarch Process

MOST Process

Tracing

Semantic Validation

OntologyConsistency

Software Process Guidance

MDE Process

SAP Process

Tracing

Semantic Validation

Page 202: Model-Driven Software Development with Semantic Web Technologies

Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

DEMO

Page 203: Model-Driven Software Development with Semantic Web Technologies

Validating Process Refinement with Ontologies

ISWeb – Information Systems & Semantic Web

University of Koblenz-Landau, Germany

Yuan Ren1, Gerd Gröner2, Jens Lemcke3, Tirdad Rahmani3, Andreas Friesen3, Yuting Zhao1, Jeff Z. Pan1 and Steffen Staab2

1University of Aberdeen, 2University of Koblenz-Landau and 3SAP AG

Page 204: Model-Driven Software Development with Semantic Web Technologies

Agenda

• Background

• Motivation & Research Question

• Process and Process Refinement

• Ontological Process Refinement Validation

• Summary & Future Work

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 2

Page 205: Model-Driven Software Development with Semantic Web Technologies

Background (1)

• Model Driven Software Development (MDSD)• General Problems from Knowledge Representation

(KR) perspective:

Representational ViewLack of formal semantics in modeling languages

e.g. metamodel to check syntax but not semantics of a model Operational View

Reasoning tasks are not well automated

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 3

Page 206: Model-Driven Software Development with Semantic Web Technologies

Background (2)

• Ontology Driven Software Development (ODSD) Using ontologies to formalize models Modeling relationships between artifacts Inferring relationships between artifacts, e.g.

traceability relationships Ensuring semantic correctness by constraint

validation Guiding the development by reasoning (reasoning in

process/model development)

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 4

Page 207: Model-Driven Software Development with Semantic Web Technologies

Background (3)

• Process modeling and management plays an important role in software development Process is general representation for control flow,

data flow and workflows Process as the planning and abstraction of

procedures Process as an interaction network of tasks, artifacts

and actors

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 5

Page 208: Model-Driven Software Development with Semantic Web Technologies

Motivation

• Process refinement is a crucial task in process modeling and management

• Problems during development

Processes are developed by multiple people in various steps

A change might impact the overall consistency

(Current) manual checking is time-consuming and error-prone

Errors are expensive: Remodeling

Hidden errors

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 6

Page 209: Model-Driven Software Development with Semantic Web Technologies

Research Question

• Can ontologies capture the dynamic aspects of the domain, particularly the changing of a process model Formalization of graph-based models Interpretation of refinement constraints Representation and validation of refinement

constraints

• Challenges Ensuring the specific process preserving the

intended meaning of the generic process Providing efficient reasoning service

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 7

Page 210: Model-Driven Software Development with Semantic Web Technologies

Process in BPMN

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 8

A simple flow:

Loop:

Flow can go back to previous activity or gateway

Parallel gateway:

Flow go through all the branches

Exclusive gateway:

Flow go through one and only one of the branches

Page 211: Model-Driven Software Development with Semantic Web Technologies

Execution Set Semantics

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 9

Parallel gateway:

{a1b1b2a2, a1b1a2b2, a1a2b1b2, a1a3}

Simple Flow:

{AB}

Loop:

{C, D, CC, CD, DC, DD, CCC, CCD, CDC, CDD,…}

Exclusive gateway:

{E, EF}

Page 212: Model-Driven Software Development with Semantic Web Technologies

Process Refinement (horizontal)

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 10

{AB}1. Getting the execution sets

{a1b1b2a2, a1b1a2b2, a1a2b1b2, a1a3}

{AB}2. Renaming {ABBA, ABAB, AABB, AA}

{AB}3. Decomposition {ABA, ABAB, AB, A}

4. Validation: invalid

How to represent and reason in an ontology?

Page 213: Model-Driven Software Development with Semantic Web Technologies

Process Normalization

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 11

1. Eliminating parallel gateways: Executions remain the same

Predecessor sets:

PS(b11) = {a11};

PS(a21) = {b11}, etc.

Successor sets:

SS(b11) = {a21,b22};

SS(a21) = {b21}, etc.

Execution sets subsumption can be reduced to PS/SS sets subsumptions [Theorem2];

Exponential complexity (O(n!))

2. Reduce execution sets to predecessor and successor sets:

Page 214: Model-Driven Software Development with Semantic Web Technologies

Refinement Representation (horizontal)

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 12

• In pre-refinement process:Component_A subclassOf to only (Component_A or Component_B);Component_B subclassOf from only (Component_B or Component_A);

• In post-refinement process:a31 subclassOf to some Endb11 subclassOf (to some b22) and (to some a21);

3. Renaming:a31 subclassOf Component_A;

b23 subclassOf Component_B;

Invalid

4. Uniqueness:Disjoint(Start, End, Component_A, Component_B)

Page 215: Model-Driven Software Development with Semantic Web Technologies

Refinement Representation

• A process refinement step is represented in the refinement ontology

Normalize the process (only XOR-gateways)

Represent activities as concepts

Represent orderings and composition relations as properties

Pre-refinement relations by universal restrictions

Post-refinement relations by existential restrictions

Uniqueness of activities by disjointness

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 13

Page 216: Model-Driven Software Development with Semantic Web Technologies

Refinement Checking

• Given a refinement ontology an activity is valid iffits concept is satisfiable

A process refinement is valid iff all the concepts in the refinement ontology are satisfiable

A path is unexecutable iff any of its activity is unsatisfiable in the refinement ontology

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 14

Page 217: Model-Driven Software Development with Semantic Web Technologies

Computational Property

• Complexity of refinement ontology: ALC

• Unsatisfiability checking

Worst-case: ExpTime-complete Improvement: Approximation

• Transformation/Normalization

Worst-case: n!• Evaluation result: reasoning more complex than

transformation (order of magnitude 3)

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 15

Page 218: Model-Driven Software Development with Semantic Web Technologies

Comparison to other Approaches – Related Work

• Temporal Logic and Model Checking

Refinement specification in LTL

• Process Algebra and Model Checking

Refinement specification in process algebra

• Communication and Transition System Calculus, e.g. ∏-calculus

• OWL and DL models

Modeling of activity pre- and postconditions

Ontologies for annotations

Process refinement and validation is not (directly) considered

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 16

Page 219: Model-Driven Software Development with Semantic Web Technologies

Summary & Future Work

• Results

Ontologies are used to compensate the lack of formal semantics in models (BPMN models)

Reasoning is used to check semantic constraints

• Next Steps

Optimization of reasoning (PTIME via approximation)

Extended process models (further gateways)

Non-pairwised gateways (e.g. nested gateways)

Generalized refinement solution for other models

ISWeb – Information Systems& Semantic Web

Gerd Grö[email protected] 17