Converting OWL To UML

NOTE: Update April 2008 - these instructions appear to no longer work, since the Protege group has removed some of the necessary components from the web. If you need to convert OWL to UML, you should contact the Protege group via their mailing lists

This recipe uses Protege and a plugin to convert OWL to UML. The only thing not converted is cardinality constraints, which must be manually added from the original OWL file.

  1. Install [WWW] Protege 2.1.2 (make sure it is starting with enough memory e.g. -Xmx1000M) On my windows machine, I run Protege from the run_protege.bat file, but first I need to edit that file to remove the path to Java, since java is automatically in my path on Windows i.e. change the run line to java %OPTIONS% -cp %JARS% %MAIN_CLASS% %1. Note also that Protege 2.1.2 seems to ship with a buggy plugin. To fix this, move the "uk.ac.man.cs.mig.coode.owlwizard" directory in the plugins folder somewhere else. If you don't do this, your OWL file may fail to load.

  2. Install [WWW] UML backend plugin

  3. Load OWL file

  4. Save project (Project->Save). A .pprj file will be created in the directory where your OWL file is.

  5. Convert to UML (Project->Convert Project to Format->UML). You must specify a UML name e.g. myfile.xmi (xmi is the extension for the XML version of UML). Protege will save the new UML file in the protege program directory, not where your OWL file is. You should move the UML (.xmi) file to your project directory. Protege will also fail to load the ontology back in and throw lots of exceptions. These can be safely ignored.

  6. Load back into Protege (Project->Build new project->UML 1.4 Class Diagrams). Just specify the UML file (usually you have to select the "All files" file filter). You don't need to specify a project file.

  7. During the conversion, many OWL and RDF classes are converted. Typically, you want to remove all of this OWL, RDF meta-information within Protege to remove clutter and just see the classes defined directly in your OWL file.

    • First check that all of your top-level classes are present on the top level of the class diagram you are viewing. If some aren't, find them under the class ":OWL-ANONYMOUS-ROOT" and move them up to be a subclass of :THING (just click and drag)

    • Delete classes that start with rdfs:, owl:, rdf:

    • Remove "ExternalResource", ":OWL-ALL-DIFFERENT" and ":OWL-ANONYMOUS-ROOT" classes

    • You can't delete ":SYSTEM-CLASS", but make sure to delete all the OWL and rdfs classes under ":THING->SYSTEM-CLASS->META-CLASS->CLASS->STANDARD-CLASS" - just select them all and hit delete.

  8. Project->Save as... (to resave the modified xmi file). Give your XMI file a new name to make sure you can start again if it doesn't work. Your new file should be smaller because it doesn't have all of the RDF and OWL classes defined.

  9. Load into a UML tool like [WWW] Poseidon and rename the model and package (optional step). You can also rename the package by directly editing the .xmi file in a text editor. The strings to change are "ProtegeModel" and "ProtegeOntology"

Example file: biopax-level2.xmi

Recipe by Gary Bader - Dec.23.2005. If you have questions or comments, please let me know - below.

Note: A [WWW] thorough comparison of UML and OWL is available from OMG (the creators of UML).

last edited 2008-04-17 15:23:34 by bader