Information Systems University of Koblenz Landau, Germany Joint Metamodels for UML and OWL
Ontologies & Software Tech: Starting Point @Koblenz IST Institute for Software Technology @Koblenz OWL Model theory MDA Fernando Parreiras Metamodeling RDF Semantics UML Ontologies F-Logic Well-founded semantics XMI Andreas Winter Grammar 2of 48
Schism? @Koblenz IST Institute for Software Technology @Koblenz OWL Model theory MDA Fernando Parreiras Metamodeling RDF Semantics UML Ontologies F-Logic Well-founded semantics XMI Andreas Winter Grammar 3of 48
Synthesis! @Koblenz IST Institute for Software Technology @Koblenz OWL Model theory MDA Fernando Parreiras Metamodeling RDF Semantics QVT F-Logic Ontologies Well-founded semantics It s the process! XMI Andreas Winter UML Grammar 4of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 5of 48
Model-driven Architecture MDA is an instance of Model-Driven Engineering Transformations: Adapt to the target platform Add additional modeling UML UML JAVA PIM PSM Code Classical MDA 6of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 7of 48
Definition: What is an ontology? (in computer science) Based on Gruber 93: An Ontology is a formal specification of a shared conceptualization of a domain of interest Executable, Discussable Group of persons About concepts Between application and unique truth 8of 48
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 9of 48
Usage: What is an ontology? Thesauri Topic Maps Front-End Taxonomies Navigation Information Retrieval Query Expansion Sharing of Knowledge Queries Ontologies Mediation EAI Semantic Networks Consistency Checking Reasoning Extended ER-Models Predicate Logic Back-End 10 of 48
Formality: What is an ontology? Ad-hoc Hierarchies Text (Yahoo!) Corpora Glossaries lightweight XML DTDs DB Schema Data Models (UML, STEP) Frames (OKBC) F-Logic heavyweight Folksonomies Data Dictionaries (EDI) Thesauri Principled Informal Hierarchies XML Schema Formal Taxonomies Description Logics First-order, Higher-order, Modal Logic Glossaries & Data Dictionaries Thesauri, Taxonomies MetaData, XML Schemas, Data Models Formal Ontologies & Inference 11 of 48
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 12 of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 13 of 48
MDA & Ontology Case: Model Checking Reasoning on UML class diagrams OWL Translation UML UML JAVA PIM PSM Code Classical MDA 14 of 48
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. 15 of 48
Model Checking: Example UserAccount 0..n 1 INCONSISTENT Owns WebPortalAccount 0..1 Uses 1..n User {complete, disjoint} Researcher Every WebPortalAccount is used by at most one Researcher if Researcher is empty, User and Student will be redundant Student Researcher is disjoint from Student 16 of 48
Model Checking: Example UserAccount 0..n 1 INCONSISTENT Owns User Uses {complete, disjoint} WebPortalAccount 0..1 1..n Researcher Student Advantage for SE: Models with provably higher quality 17 of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels: TWOUSE Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 18 of 48
Structure: Metamodels TWOUSE: Transforming and Weaving Ontologies and UML for Software Engineering 19 of 48
TwoUse Models (excerpt) Classifier M2 DataType Class AnyType OWLClass TUClass M1 InstanceOf OclAny ocliskindof() oclistypeof() CustomerFromEUCountry Product OwlAny owlisinstanceof() PuchaseOrder getcharges() context PurchaseOrder::getCharges() : Real body: if self.owlisinstanceof(dutyfreeorder) then 0.00 else 0.60 endif} 20 of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels: TWOUSE Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 21 of 48
Running Example: E-Commerce Shop 7% 7% 7% 22 of 48
Running Example: E-Commerce Shop 35% 19% 5% Free trade zones 23 of 48
Hybrid Model: Example UML +hascustomer FreeTradeZone 1..n 1 0..n Customer +hasorder +memberoftradezone +has Resident +hasmember Country +livesin UML 1 Purchase Order getcharges() +hasproduct Product Name: String 24 of 48
Hybrid Model: Example OWL +hascustomer FreeTradeZone 1..n 1 0..n Customer +hasorder +memberoftradezone +has Resident +hasmember Country +livesin 1 Purchase Order getcharges() <<owlrestriction>> CountryFromEU <<owlvalue>> {hasvalue = eu} memberoftradezone : FreeTradeZone <<owlvalue>> +{somevaluesfrom = CountryFromEU} livesin ISWeb - Information <<owlrestriction>> Systems CustomerFromEUCountry <<owlrestriction>> DutyFreeOrder DutyFreeOrder <<equivalentclass>> = OrderFromEUCustomer <<owlrestriction>> OrderFromEUCustomers <<owlvalue>> +{somevaluesfrom= OrdersFromEUCustomers CustomersFromACountry hascustomer SOME} hascustomer 25 of 48 CustomerFromEUCountries OWL (ODM)
Hybrid Model: Example TwoUse TwoUse <<ocldlexpression>> {context PurchaseOrder::getCharges() : Real body: if self.isowlinstanceof(dutyfreeorder) then 0% else 60% endif} FreeTradeZone Country Customer UML Purchase Order getcharges() Product Name: String <<owlrestriction>> CountryFromEU <<owlvalue>> {hasvalue = eu} memberoftradezone : FreeTradeZone <<owlvalue>> +{somevaluesfrom = CountryFromEU} livesin ISWeb - Information <<owlrestriction>> Systems CustomerFromEUCountry <<owlrestriction>> DutyFreeOrder <<equivalentclass>> <<owlrestriction>> OrderFromEUCustomer <<owlvalue>> +{somevaluesfrom= CustomerFromACountry } hascustomer 26 of 48 OWL
OCL-DL in TWOUSE Co-generation of OWL models from UML Generation & OCL-DL OWL Java calls to reasoner UML PIM UML PSM JAVA Code Classical MDA 27 of 48
Transformation Process UML Metamodel Metamodel Grammar Ontology Abstract Syntax M2 M1 TwoUse Metamodel UML TwoUse OWL Metamodel InstanceOf OWL 2. 2. Java Metamodel Java 3. Java OWL 1. Concrete Syntax UML Profiled 4TwoUse UML Profiled 4 OWL UML Profiled 4Java Java Reasoner API PIM PSM PSM Source Code OWL RDF XML Syntax 28 of 48
OCL-DL can do more! OCL-DL Queries OWL UML PIM UML PSM JAVA Code Classical MDA 29 of 48
OCL-DL Example TwoUse <<ocldlexpression>> {context PurchaseOrder::getCharges() : Real body: if self.isowlinstanceof(dutyfreeorder) then 0.00 else 0.60 endif} 0..1 +memberoftradezone <<owlclass>> FreeTradeZone +hasmember <<owlclass>> 2..n Country name : String +hasresident +livesin 1 1..n <<owlclass>> Customer +hasorder <<owlclass>> +hascustomer 0..n PurchaseOrder 1 getcharges() 1..n UML 1..n Product name : String +hasproduct <<owlclass>> DutyFreeOrder <<owlrestriction>> CountriesFromEU <<owlvalue>> {hasvalue = eu} memberoftradezone : FreeTradeZone <<owlvalue>> +{somevaluesfrom = CountriesFromEU } livesin <<equivalentclass>> <<owlrestriction>> OrdersFromEUCustomers OWL <<owlrestriction>> CustomersFromEUCountries <<owlvalue>> +{somevaluesfrom= CustomersFromACountry } hascustomer self.owlisinstanceof(dutyfreeorder) self.owlalltypes() self.owlallinstances() Type (?self, DutyFreeOrder) Type (?self,?x) Type (?self,?x), Type (?y,?x) 30 of 48
Summary of OCL-DL Dialect of OCL Specification of Queries Invariants Guards OCL Library with new operations owlisinstanceof(typespec: OclType) owlalltypes() owlallinstances() OWL Support OWL-DL OWL2, DL Rules 31 of 48
Agenda of this Talk Model-driven Engineering Ontology A Use Case of Ontology Technology in MDE Joint Metamodels Case 1: Use Ontology Technology in a Design Pattern Case 2: Using MDE for Translating between Ontologies 32 of 48
UseCase2: Using MDE for Translating between Ontologies Translation of ontology datasets Input Translation Semantic F-Logic Lexical + Ontobroker Syntactic, MBOTL Lexical SPARQL (Java) + Semantic Jena(Java) Output 33 of 48
State of the Art: Neon Toolkit Input Output visual mapping of ontologies Plug-ins must be written separately 34 of 48
Problem Layers Semantic { Syntactic { Lexical { Input InBook Chapter gmonth title Tools SPARQL F-Logic Jena Ontobroker (Java) (Java) Output Inbook String uppercase(title) MDA Modeling PIM Transf. Code A PIM focus on the operation of a system and hides the details necessary for a particular platform (MDA Guide) All three layers are platform independent Problem: Why to use two languages? Instead of general purpose programming language, specific language? 35 of 48
The MBOTL Solution MDA Modeling Layers Semantic { Syntactic { Lexical { Input InBook Chapter gmonth title Output } uppercase(title) Inbook String mbotl: PIM Transformation or f-logic java sparql jena Advantages: Productivity: focus on business and not on platform details Portability: Same PIM can be automatically transformed into multiple PSMs for different platforms Maintenance: higher level of abstraction than code (MDA) 36 of 48
Addressing the Semantic Layer Usage of OCL-like expressions to formulate queries. Concrete Syntax of a Ontology Translation Rule: 37 of 48
Addressing the syntax and lexical layers Application of predefined operations or helpers Unified Representation 38 of 48
Metamodel Reference Layer (EU STReP MOST) MBOTL Extension 39 of 48
Translation Process ATL Model Transformation ATL Model Transformation mbotl.ecore Platform Independent Model java.ecore sparql.ecore Platform Specific Model query.java builtins.java Code Jena Framework Target Ontology Source Ontology 40 of 48
Screenshot: Editing a MBOTL Translation 41 of 48
Screenshot: Generated SPARQL Model 42 of 48
Screenshot: Java Code with Jena API 43 of 48
Screenshot: Java Code of Built-In 44 of 48
Summary of Case 2 MBOTL provides an unified language to model different layers of ontology dataset translation problems. At semantic level: OCL as query language. At syntactic and lexical levels: OCL predefined operations and user-defined helpers. Improvements: productivity, portability, maintenance. Implementation: Eclipse, ATL Transformation Language, Jena. Future Work: plug-in, SPARQL-like syntax, evaluation. Download and test: isweb.uni-koblenz.de/research/mbotl 45 of 48
Conclusion Joint metamodels allow for joint querying of UML & OWL provide synchronized reasoning calls extend the power of UML with UWL extend the power of SPARQL (or other ontology services) by programming language competencies 46 of 48
Information Systems Thank You! University of Koblenz Landau, Germany http://isweb.uni-koblenz.de/projects/twouse http://isweb.uni-koblenz.de/projects/most Fernando Silva Parreiras,, Andreas Winter: Improving Design Patterns by Description Logics: A Use Case with Abstract Factory and Strategy. in Modellierung 2008, 12.-14. März 2008, Berlin. 2008. GI. LNI. 127. Fernando Silva Parreiras,, Simon Schenk, Andreas Winter: Model Driven Specification of Ontology Translations. In: Conceptual Modeling - ER 2008, 27th International Conference on Conceptual Modeling, 2008. Springer. Fernando Silva Parreiras,, Andreas Winter: On Marrying Ontological and Metamodeling Technical Spaces. 2007. ACM Press. Proceedings of the 6th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2007. Fernando Silva Parreiras,, Andreas Winter: TwoUse: Integrating UML Models and OWL Ontologies. Universität Koblenz-Landau, Fachbereich Informatik. 2007. Arbeitsbericht.
Expressiveness of OCL, UML and DLs FOL OCL n-ary relations, functional dependencies on n-ary relations, and identification constraints on concepts DLRifd (UML Class Diagrams) limited complex role inclusion, ALCQI reflexivity and irreflexivity, role disjointness qualified cardinality restrictions DL-Lite cardinality restrictions role hierarchy nominals SHOIN(D) (OWL-DL) transitive properties SROIQ(D) (OWL 2) 48 of 48
OCL-DL Dialect FOL OCL-DL OCL n-ary relations, functional dependencies on n-ary relations, and identification constraints on concepts DLRifd (UML Class Diagrams) limited complex role inclusion, ALCQI reflexivity and irreflexivity, role disjointness qualified cardinality restrictions DL-Lite cardinality restrictions role hierarchy nominals SHOIN(D) (OWL-DL) transitive properties SROIQ(D) (OWL 2) 49 of 48