Standard UML file format - uml

I have designed UML diagrams in different tools (StarUML, BoUML, Papyrus, Omondo, Rational Rose, etc.) depending on the project and the date (rose was first, after Omondo, then starUMl, ..., now papyrus). However, I see that I cannot open my old UML diagrams because the tool is obsolete.
I would like to know if there is a standard format for UML diagrams. Probably not in production, but at least to know if there is proposal of standard format.
Probably, Eclipse is doing something like that with the M2 project, but do the other tools (not eclipse based) are interested in reading this format.?
Each UML tool uses its own format, but I think the era of proprietary format is over, and open format for diagrams like this should exist.

I have two answers to this:
In theory the standard exchange format for UML models is XMI but it´s true that each vendor implements a slightly different version so interchange is not a reality. Nevertheless, most tools are converging to at least support the Eclipse MDT-UML2 XMI implementation which in my opinion is becoming de facto XMI standard.
The OMG is working on a new standard : Diagram Definition that is supposed to fix the problems with the current XMI one (they are working a lot with many of the top vendors to make sure that this time they all go in the same direction) and, also important, it will allow to interchange not only the data (i.e. the info about the model elements) but also the layout and graphical representation so that after the import you get a model exactly as the same you exported in the first place

Have you heard of XMI?
#JordiCabot here adds some interesting details about it.

Besides Jordi's reference to the Diagram Definition standardization activity, please note that there is another action ongoing from OMG:
a request for comments has been issued in June 2011 for a CANONICAL XMI format, which is basically a subset and a set of additional rules for writing XMI documents that should limit the possibility of creating different XMI dialects, or at least should allow tools to understand a common dialect (the canonical one).

Related

Saving UML model as XMI ambiguity

I found this sentence in article about XMI on wikipedia:
At the moment there are several incompatibilities between different
modeling tool vendor implementations of XMI, even between interchange
of abstract model data.
I wondered how it is possible that, despite using a well-documented standard, tools are not compatible. After looking through documentations of UML and XMI and through other people's questions I found out that there is no XML scheama or DTD for UML models saved as XMI.
According to the best answer to this question -https://stackoverflow.com/a/36885550/9329778 -the correct approach to check if XMI is well formed should be to validate/process it through a conforming UML model.
I also found this in XMI 2.5.1 documentation in section "7.3.2 Model Class Representation":
By default, XMI allows you to serialize features using either XML
elements or XML attributes; however, XMI allows you to specify how to
serialize them if you wish.
This looks to me like a source of the problem.
My questions are:
Is there an official guide that strictly describes how to save UML model using XMI? I don't mean the UML syntax meatamodel (which can be downloaded from OMG website).
If the answer to the first question is "no" - does it mean that different modeling tools can perform serialization of the same UML model differently even if they use the same version of XMI?
the reference is this current document by OMG
Though there is a "standard" the people which defined it are from different vendors under the hat of OMG. Of course every vendor tries to keep his sheep dry and warm (and likely if possible leave those of others in the rain - well). This simply lead to a standard which is open to anyone. While OMG ("trying" to holding its hand over such standards) allowed the addition of vendor individual extensions to pass, each vendor took advantage and used this addendum to his own favor. And that's what we see in different fora: why can't I import my model (completely/at all) from vendor A's tool into vendor B's tool. It's a cross.
Note: regarding 1: No. You can not take this document and create XMI from a model. It's not written that way. What I did was to create a simple model, export it (from my favorite tool) and see what had been created. Then I tried to import that into another tool (finding to where it fails). Or even export and import in the same tool to find what was missing afterwards.

Converting UML to OWL Ontology

I am trying to develop an OWL ontology based on different UML file resources presented in XMI format. Reading through the internet for a while now, it seems that almost all the available tools or approaches are outdated and even when trying some of them they don't provide the expected outcome.
Since this ontology plays a really important role in our project, I wanted to know what is the best approachs/tools to be used in order to convert UML to OWL ?
I have looked into this myself as well and I have found no tools that can do this satisfactory. Problems I ran into were either the tools used an old version of UML, did not support all UML features, used OWL 1 rather than OWL 2 and was supported by only an old version of Protege.
I resorted by doing the translation by hand, which for most UML constructs are not too difficult. For this purpose I have done a write-up on UML vs OWL, which gives an intuitive explanation for why some of the translation is done in a certain why, as well as provide a reference for translating UML to OWL.
There's an OMG spec now available at https://www.omg.org/spec/MOF2RDF/
I haven't yet found an open-source tool implementing this directly (i.e. convert from UML/XMI to OWL/RDF), but there are EMF related activities, that may be relevant (haven't tried), e.g.:
https://github.com/ghillairet/emftriple
You'll probably never get exactly what you want unless you do it by hand, as Henriette mentioned. One viable option is using COGS, which I've found to work pretty well.
The catch is that it's related to Rot's answer by supporting the OMG specification. If it's not much work to make sure that your UML conforms to that specification, it may save some time in the long run. Here's an example of an OWL file produced by COGS.

Standard file format for describing hierarchical (nested) finite state machines?

I have a need to describe a hierarchical finite state machine in a standard and portable format. Is there a widely-accepted and supported file format that I should use?
I see that the Graphviz DOT language supports sub-graphs that may be referenced by directed edges. (Although rendering connected clusters using Graphviz is a bit of a problem.) Interpreting the text label on a generic directed edge as a transition event/criterion seems like a slight semantic stretch, but not unusable.
I see that a UML Statechart has support for hierarchically nested states. However, the accepted answer to this question implies that describing a statechart in XMI myself may not actually be properly interoperable with tools that nominally support UML.
I see the W3C SCXML Standard. However, this is still a working draft (and has been for almost 7 years), and I'm not certain if any tool supports this format (other than through conversion).
Is there a more widely-acceptable alternative than one of the above? Should I use one or the other of the above?
One of the examples of portability is that I would like for the graph to be able to be read and used by an HSM simulator like Matlab Stateflow.
There is an OMG standard for UML diagram interchange. But I don't thing it is widely accepted. You can also use the eclipse EMF UML2 format, for which you can develop yourself translators for other formats.

How do I view UML in XML format in a diagrammatical format?

I am running UBUNTU. Linux and have tried BOUML, which can show the project in a tree structure, but I am unable to get a diagrammatical over view of the whole system.
I think this is not a direct programming question, but hopefully it can be answered here anyway. :)
Also, would appreciate a good place to start to learn more about UML as it is becoming increasingly important in my project management.
I am not sure what format you have at hand, but I assume, you have XMI and that format does not contain any diagram specific information, it is only about the model, which is represented usually using tree structure, because it is the easiest way. For a diagram you would need to visualize the model and most importantly use some sort of layout algorithm. Layout for large models is quite hard especially with many associations and automatic layout might produce diagrams, which are misleading.
There are many books and places where to start with UML. I would recommend a book, e.g. one from Martin Fowler or Ila Neustadt and Jim Arlow. Recently modeling languages portal released list of UML cheatsheets.

How to design a UML diagram with a scripting language?

I'm designing a software component which will get instructions from other components on how the UML diagram should look like, and then will produce this UML diagram in different presentation ways (in SVG, GIF, etc.), for example (in Java):
DiagramDesigner designer = new DiagramDesigner();
designer.setStyle('Use Cases')
designer.addActor('User');
designer.addUseCase('Print Document');
// etc.
String svg = designer.getSvg();
I don't want to re-invent the wheel and want to use some industry-standard language/interface for interconnection between my DiagramDesigner and other components. I'm looking for an interface similar to DOM, but for UML, not for XML.
Can anyone help? Thanks in advance.
ps. Besides the example above I would like to make my diagrams inter-operable and transferrable between servers, e.g.:
// first server
String script = designer.getScript();
// second server
DiagramDesigner desiger2 = DiagramDesigner.import(script);
So if I understand you right, you are looking for a way to work with UML on the metamodel level. You should look at the MOF standard and its implementation the EMF (Eclipse Modeling Framework), which is used by almost all Eclipse based UML tools and this framework is used by many other modeling projects, it even somewhat influenced the standardization of MOF (resulting in SMOF and EMOF split) and therefore I would declare it industry standard.
Probably only loosely related but anyhow: PlantUML. It is open source, built in Java and likely contains already parts of what you want to do.
You can inspire from these scripts to generate any output you want:
http://askuml.com/
Currently examples are given in yUML because they're nice but could be anything.
At least for the syntax part, you could get some inspiration from the large set of textual UML tools (theses tools allow designers to textually specify the model and then they automatically show the model graphically using the standard UML notation).
At least of such tools here: http://modeling-languages.com/content/uml-tools#textual

Resources