Skip to content
Alvaro Ortiz-Troncoso edited this page Oct 23, 2017 · 13 revisions

Table of Contents

Introduction

Ontologies are abstract representations of specific domains of the real world: these representations are constructed by naming relevant concepts and identifying the constraints that rule their use; as ontologies embody shared human knowledge in a machine-readable format, they are the cornerstones of knowledge- management and retrieval (Studer, Benjamins and Fensel, 1998).

UML (unified modelling language) provides a set of standardized diagrammatic notations to conceptualize a system design. UML can be extended through "profiles", allowing to customize basic UML notations for specific tasks. Profiles consist mainly of a collection of "stereotypes", used to tag UML elements, allowing to apply specific constraints to these elements.

An ontology can be modelled in a UML class diagram using the provided profile: classes, attributes and associations can be tagged using the stereotypes defined in the profile. These stereotypes are documented in the section "Supported stereotypes". Example models are provided in the directory test/testdata (see section "Prerequisites" for how to open the files).

Installation

see https://github.com/AlvaroOrtizTroncoso/UML-ODM-to-OWL-XML/blob/master/README.md

ODM Profile

The file profiles/ODM1.xmi contains a UML profile for ODM. The profile proposed in ODM.xmi is based (in a derived form) on the work by Gaševic, Djuric and Devedžic (2009) and on the Ontology Definition Metamodel specification (Object Management Group, 2009). The OWL files produced should be compliant with the OWL web ontology language reference, version 1 (Dean, 2004).

Before you start modelling, you should load the profile in your UML editor.

e.g. in ArgoUML:

  • Launch ArgoUML and go to Edit -> Settings -> Profiles (on OSX, this is ArgoUML -> Preferences -> Profiles)
  • Click on Add and specify your _profiles_ directory.
  • Click on "refresh list" (or close and relaunch ArgoUML and go back to Edit -> Settings -> Profiles)
  • ArgoUML should have listed the new profile. Add it to the defaults profiles.
  • You can now load one of the test ontologies provided in test/testdata/*.zargo

Supported stereotypes

ODM1.xmi provides the following stereotypes

UML Stereotype UML Base Class Transformed into OWL
OntClass Class owl:Class
ObjectProperty Class owl:ObjectProperty
DatatypeProperty Class owl:DatatypeProperty
range Association, Attribute rdfs:range
domain Association, Attribute rdfs:domain

ODM1.xmi provides the following data types

  • boolean
  • dateOWL
  • double
  • integer
  • string

Creating an ontology model

The following examples assume that you are using ArgoUML as visual editor for your UML files. Other editors might work as well.

Open ArgoUML and load the profile if you haven't done so already.

Create a new model and record the namespace of your ontology.

Creating a class

In the tree view, make sure you have the "Diagram-centric" perspective open, and open the class diagram.

Add a class. Make sure the class is selected. Open the "stereotypes" tab and apply the "OntClass" stereotype.

Adding data properties

Any attribute of a class tagged with a "OntClass" stereotype will be treated as a owl:DatatypeProperty.

Adding object properties

Add a second class "Class B", tag it with the "OntClass" stereotype. To create an owl:ObjectProperty relationship from Class A to Class B, create a new association class. The association class' name is the name of the object property. Tag the association class with the "ObjectProperty" stereotype. Add attributes for the range and domain of the object property, and mark them with the corresponding stereotypes "range" and "domain" (see image).

Inheritance

Add a "parent" class, tag it with the "OntClass" stereotype. Create a generalization from the "child" class to the "parent" class.

Converting the model into an ontology

To convert the UML model into a machine-readable ontology in RDF/XML format, do:

 cd UML-ODM-to-OWL-XML
 ./odm2owl.sh inputFile.zargo outputFile.rdf

To convert a UML file created with another editor than ArgoUML, you will need to export the model to xmi. The script can handle xmi input files.

The result is an ontology in RDF/XML format, that can be opened in e.g. Protege.

References

Dean, M., Schreiber, G., Bechhofer, S., van Harmelen, F., Hendler, J., Horrocks, I., McGuinness, D.L., Patel-Schneider, P.F. and Stein, L.A., 2004. OWL web ontology language reference. W3C Recommendation February, 10. Available at: https://www.w3.org/TR/owl-ref/ (accessed 20 September 2017)

Gaševic, D., Djuric, D. and Devedžic, V., 2009. The Ontology UML Profile. In Model Driven Engineering and Ontology Development (pp. 235-243). Springer Berlin Heidelberg.

Object Management Group, 2009. Ontology Definition Metamodel. Available at http://www.omg.org/spec/ODM/1.1/ (accessed 14 September 2017)

Studer, R., Benjamins, V.R. and Fensel, D., 1998. Knowledge engineering: principles and methods. Data & knowledge engineering, 25(1-2), pp.161-197.

Clone this wiki locally