Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Â
OWL2+SWRL to EMF+IQPL
1. Ontology Driven Design of EMF
Metamodels and Well-formedness
Constraints
Benedek IzsĂł, ZoltĂĄn SzatmĂĄri, GĂĄbor
Bergmann, Ăkos HorvĂĄth, IstvĂĄn RĂĄth, and
DĂĄniel VarrĂł
Budapest University of Technology and Economics MODELS Conference â OCL Workshop 2012
Fault Tolerant Systems Research Group Innsbruck, Austria, 2012. 09. 30.
2. Overview
ï§ Motivation
ï§ Ontology based language engineering process
ï§ Ontology to DSL mapping
ï§ Results and future work
3. Motivation
Textual
Requirements ? DSM Editor
«instance of»
âą early prototyping
âą Every Switch is supervisedBy
âą satisfy requirements
at least two Sensors.
âą (re)validation
4. Motivation
Formalized Prototype
Requirements Auto-derive DSM Editor
«instance of»
satisfy
Automatically build a
DSM editor to design
instance models
satisfying all requirements
5. Modeling techniques
Requirements Ontology DSL spec.
âą Textual âą Mathematically âą Great tool support
âą Can be ambiguous, precise semantics âą Wide industry usage
inconsistent âą Efficient meta level âą Efficient instance
âą Expectations of consistency checking model validation
stakeholders âą Easy schema merg-
ing and refactoring
6. Modeling techniques
Requirements Consistent translation?
Ontology DSL spec.
âą Textual âą Mathematically âą Great tool support
âą Can be ambiguous, precise semantics âą Wide industry usage
inconsistent âą Efficient meta level âą Efficient instance
âą Expectations of consistency checking model validation
stakeholders âą Easy schema merg-
ing and refactoring
10. Mapping OWL2 to Ecore (example)
Mapping
Ontology DSL spec.
Every Switch is a TrackElement.
Every TrackElement is supervisedBy a Sensor.
OWL2 Ecore
SWRL IQPL
11. Mapping OWL2 to Ecore (example)
Mapping
Ontology DSL spec.
Every Switch is a TrackElement.
Every TrackElement is supervisedBy a Sensor.
Switch â TrackElement
Switch â
OWL2 (Web Ontology Language):
â supervisedBy.Sensor
âą W3C Standard for describing
semantic web
âą Axiomatic language: decidable
description logic
âą Here used for metamodel
constraint description
OWL2 Ecore
SWRL IQPL
12. Mapping OWL2 to Ecore (example)
Mapping
Ontology DSL spec.
Every Switch is a TrackElement.
Every TrackElement is supervisedBy a Sensor.
Switch â TrackElement
Switch â
â supervisedBy.Sensor
OWL2 Ecore
SWRL IQPL
14. Mapping OWL2 to IQPL (example)
Mapping
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
OWL2 Ecore
SWRL IQPL
15. Mapping OWL2 to IQPL (example)
Mapping
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
Switch â
â„2 supervisedBy.Sensor
OWL2 Ecore
SWRL IQPL
16. Mapping OWL2 to IQPL (example)
Mapping
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
IQPL (IncQuery Pattern Language):
âą Graph pattern based model query
language
âą EMF-IncQuery evaluates incrementally
Switch â
NEG
supervisedBy
â„2 supervisedBy.Sensor s1:Sensor
OWL2 Ecore s2:Sensor supervisedBy
sw:Switch
SWRL IQPL
17. Mapping OWL2 to IQPL (example)
Mapping
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
Consequent is negated
to match violating
elements
Switch â
NEG
supervisedBy
â„2 supervisedBy.Sensor s1:Sensor
OWL2 Ecore s2:Sensor supervisedBy
sw:Switch
SWRL IQPL
19. Mapping SWRL to IQPL (example)
Mapping
Ontology DSL spec.
Two track elements with same signal must be connected.
OWL2 Ecore
SWRL IQPL
20. Mapping SWRL to IQPL (example)
Mapping
Ontology DSL spec.
Two track elements with same signal must be connected.
TrackElement(?te1),
TrackElement(?te2),
Signal(?sig),
hasSignal(?te1, ?sig),
hasSignal(?te2, ?sig), SWRL (Semantic Web Rule Language):
DifferentFrom (?te1, ?te2) âą Extension of OWL2
->
connectedTo(?te1, ?te2) âą Variables and property expressions
can be used
OWL2 Ecore âą DL-Safe rules maintain decidability
SWRL IQPL
21. Mapping SWRL to IQPL (example)
Mapping
Ontology DSL spec.
Two track elements with same signal must be connected.
TrackElement(?te1),
TrackElement(?te2),
Signal(?sig),
hasSignal(?te1, ?sig),
hasSignal(?te2, ?sig),
DifferentFrom (?te1, ?te2) ?te1:TrackElement
hasSignal
-> NEG
connectedTo(?te1, ?te2) ?sig:Signal connectedTo
hasSignal
OWL2 Ecore ?te2:TrackElement
SWRL IQPL
22. Mapping SWRL to IQPL (example)
Mapping
Ontology DSL spec.
Two track elements with same signal must be connected.
pattern invalidWiring(te1, te2, sig) {
TrackElement(?te1), TrackElement(te1);
TrackElement(?te2), TrackElement(te2);
Signal(?sig), Signal(sig);
hasSignal(?te1, ?sig), TrackElement.hasSignal(te1, sig);
hasSignal(?te2, ?sig), TrackElement.hasSignal(te2, sig);
DifferentFrom (?te1, ?te2) te1 != te2;
-> neg find connected(te1, te2);
connectedTo(?te1, ?te2) }
pattern connected(te1, te2) {
OWL2 Ecore TrackElement.connectedTo(te1, te2);
}
SWRL IQPL
23. Language Differences
OWL2+SWRL Ecore + IQPL Solution
Multityped instances Object has exactly one Multiple inheritance
direct type can be used
Relation inheritance No relation Mapped to GP,
allowed inheritance relation instances
must be inserted
Multiple syntax can Transformed to Ecore
have one semantics or GP depending on
the syntax
Open world Closed world OWA â tolerates
assumption assumption incomplete models
CWA â complete
knowledge assumed
24. Language Differences (OWA â CWA)
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
s2:Sensor supervisedBy
sw:Switch
25. Language Differences (OWA â CWA)
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
Open World Assumption:
Tolerates incomplete knowledge
â Valid
s2:Sensor supervisedBy
sw:Switch
26. Language Differences (OWA â CWA)
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
Open World Assumption: Closed World Assumption:
Tolerates incomplete knowledge Complete knowledge assumed
â Valid âInvalid
s2:Sensor supervisedBy
sw:Switch
27. Language Differences (OWA â CWA)
Ontology DSL spec.
Every Switch is supervisedBy at least two Sensors.
Open World Assumption: Closed World Assumption:
Tolerates incomplete knowledge Complete knowledge assumed
â Valid âInvalid
s2:Sensor supervisedBy
sw:Switch
Mapped graph patterns return invalid elements
following the close world assumption
28. Implementation
Transform
Ontology DSL spec.
ï§ Large part of the language was mapped (~50 axioms
and 45 expressions)
ï§ Transformation is implemented in the VIATRA2
framework with the required ontology importer,
Ecore and IQPL exporter
ï§ Traceability between source and target model
ï§ An Eclipse plug-in automates the process
o Converts ontology with 50 axiom in 30 sec. (code
generation dominates)