solutions for semantic web (OWL ontologies, SPARQL, reasoning) and model driven development (metamodel, model design, model transformation, code generation)
solutions for semantic web (OWL ontologies, SPARQL, reasoning) and model driven development (metamodel, model design, model transformation, code generation)
Since MDE and OWL provide complementary benefits, contemporary software development should make use of both approaches. This demo presented at the Sixth European Conference on Modeling Foundations and Applications enlightens the improvements from an integrated approach.
The OWLizer transforms software language (Ecore Metamodel/Model) into OWL ontologies. In the following we present an extension of this simple model transformation approach. It is extended by transforming specific EAnnotations to specific OWL constructs. For example by annotating elements in the metamodel with „#Class“- as well as „#ObjectProperty“, EClassifiers and EReferences can be marked as appropriate OWL -Entities. Starting at the „#Class“-EAnnotation, further OWL-Classaxioms can be annotated, that means, by creating further nested EAnnotations.
An example is given in the following:
Here the OWLizer transforming the metamodel (depicted in figure 1) would result the following OWL ontology axioms and class expressions. EquivalentClasses(Cisco7603 ObjectMinCardinality(1 hasConfiguration. Configuration7603)).
Here the OWLizer is able to interpret the annotations and creates corresponding axioms in ontology (e.g. #ObjectMinCardinality means the creation of the corresponding class expressions in the ontology; #EquivalentClasses means the creation of the corresponding axiom).
In general we have built an annotation profile for annotating Ecore-based metamodels. The metamodel itself and in addition its annotations are transformed to a pure ontology by the OWLizer . Thus we extended the expressivity of the Ecore metamodeling language to a new comprehensive approach that combines standard metamodeling with using ontology-based expressions and axioms in an integrated manner.
Since model driven engineering and semantic web provide complementary benefits, contemporary software development and code generation should make use of both approaches. This talk enlightens the improvements on both fields from an integrated approach: the TwoUse approach.
Software development consists of multiple phases, from inception to production. During each software development phase, developers and other actors generate many artifacts, eg. documents, models, diagrams, code, tests and bug reports. Although some of these artifacts are integrated, they are usually handled as islands inside the software development process.
Many of these artifacts (graphical or textual) are written using a structured language, which has a defined grammar. In a model-driven environment, concepts of software languages are represented by metamodels, whereas the artifacts written in those software languages are represented by models, which are described by the language metamodel. Thus, by transforming software metamodels and models into OWL and by aligning the OWL ontologies corresponding to software languages, we are able to link multiple data sources of a software development process, creating a linked-data repository for software development.
Let us consider an example of integrating two data sources: UML diagrams and Java Code. Regardless of generating Java code from UML diagrams, developers would like to have a consistent view of corresponding classes and methods in UML and Java, i.e., developers might want to consult UML diagrams looking for a corresponding Java class. In this scenario, OWL and ontology technologies play an important role.
Fig. 1 depicts the usage of M3 transformations together with ontology technologies [1]. UML metamodel and model as well as Java grammar (metamodel) and java code (model) are transformed into OWL ontologies. Ontology alignment techniques [] might identify some concepts in common between the two ontologies (UML and Java), e.g., package, class, method. Moreover, individuals with the same name in these two ontologies are likely the same.
Once the two ontologies are aligned, queries against the Java ontology also retrieve elements defined in UML diagrams. Now it is possible to retrieve sequence diagrams including a given Java class, since the two artifacts (UML diagrams and Java code) are now linked. This is only one example of the great potential provided by linking software engineering artifacts using OWL technologies.
[1] Gröner, G., Silva Parreiras, F., Staab, S., Walter, T.: Software Modeling Using Ontology Technologies. In: Rudi Studer - A Review on Semantic Web Research. Springer Verlag (2011)
The OWL Editor allows to create UML-like Templates for OWL Ontologies. Templates are parameterised elements which identify the pattern for a group of model elements of a particular type. You can generate new classes or elements with the same characteristics as the Template by binding classes or other elements to the Template.
The OWL Editor allows to bind Classes, ClassExpressions, ObjectProperties, DataProperties and Individuals.
Example
This example shows an Ontology using Templates
In this example 2 Classes and 1 ObjectProperty are bound to a Template. The Template (on the right site) named AgentRole has 3 Elements (Role, Agent, hasRole) needing a binding. The Pattern (on the left site) named Music binds elements to the Template.
After the generation the Class "Agent" is transformed to "Musician", "Role" is transformed to "Position" and the ObjectProperty "hasRole" is transformed to "plays". All other elements are not changed so that the generated Ontology looks like this.
By using more patterns and bindings to the Template, the Template is used to generate more than one instance.
SWRL Rules could also be created with the OWL Editor. This Editor allows a graphical creation of Ontologies and their SWRL Rules.
Example:
The image shows an Example of a SWRL Rule in the OWL Editor. The Example is the Uncle Rule.
The Uncle Rule in the Syntax Protege is using looks like this: Person(?x1), Person(?x2), Person(?x3), hasBrother(?x2, ?x3), hasParent(?x1, ?x2) -> Person(?x1), Person(?x3), hasUncle(?x1, ?x3)
Since it's already possible to create ontologies using the UML Profile for OWL , a new UML Profile for SWRL was developed to enhance ontologies with SWRL Rules. SWRL combines OWL (DL and Lite) and RuleML, so therefore the set of OWL Axioms will be extended to include Horn-like rules. It thus enables Horn-like rules to be combined with an OWL knowledge base, so that reasoning against those rules will be possible.
Example
This image depicts a sample UML diagram using the UML Profile for OWL .
This image depicts a sample UML diagram using both the UML Profile for OWL and UML Profile for SWRL .
This sample file is part of the offered examples when using the TwoUse Toolkit. More information on http://twouse.googlecode.com/