Converting XSD file to UML Model - xsd

We have an application that generates a XSD file that represents database tables.
I now need to convert the XSD in to a UML model. This will allow clients to change the model using a modelling tool (such as Magicdraw, RSA, Eclipse, ct) and then run another of our tools to generate other artifacts.
How can I convert from XSD to UML ?
We own MagicDraw so I was looking in to the Transformations functionality that should do this for me but for some reason I can't import the XSD, although it is valid.
I'm also confused when it talks about XML Schemas and XMI format. How do these differ from my XSD file?
Thanks.
Sarah

The best tool that I have found for this purpose is the XML modelling tool. Its been a while since it was updated, but it works. I blogged about it at Modelling wsdl as uml

There are some tools able to transform XML schemas into UML diagrams (see a list here, read the comments in the post) but the XML/XMI import of MagicDraw (and in general of any other UML tool) will not work in your schema since they expect a specific type of XML file (XMI format) which is the standard used to provide a XML-based definition of a UML model.
That is, XMI files are used to store UML models in XML and they follow a predefined XSD. In theory UML tools should be able to exchange UML models stored in XMI but unfortunately, this "model once open anywhere" is not true (but this is another story)

You can try to use the Eclipse Dali plugin which would generate a java code directly from your database. Once you get the code you can reverse into UML.
From UML to database you could try to add java persistence annotations in your code coming from your UML class diagram. When you have the annotated code then try hibernate to create your database.
This would do the job but having multiple layers means that you loose tracability between your original data model and UML and back. This is called the pojo cycle.

Related

Is there tutorial available for Agro Uml Xmi

Have created the Sequence diagram using ArgoUML and exported it as XMI.
I need to identify the class,function and their relationships by parsing the XMI.
I can able to parse the class and their corresponding operation and attribute as explained in http://www.ibm.com/developerworks/library/x-wxxm24/#resources
Can any one help me in parsing the association role and classifier role in order to obtain their relationship?
The main thing that you need to know is that it's UML 1.4/1.5 serialized using XMI 1.2. ArgoUML uses the NetBeans UML/XMI support for writing these files, but it's been long since retired.
Good luck!

phpstorm, create custom UML diagram

PhpStorm has a feature to create UML diagrams based on existing classes
But I need to create and save my own diagrams, that will have objects for not existing classes. For example, I need to create a database diagram and a UML diagram for some classes of new feature.
Can I do it via phpstorm?
No, going by the Documentation Jetbrains Confluence on UML Diagrams in Phpstorm and this post phpstorm only allows you to create different UML diagram views of your code base, the only model is your code base itself. Thus you cannot have classes just in a diagram.
If it is still of your interest, you can use an extension like this to write your custom UMLs. You can find the documentation here

What is the canonical document schema for representing UML?

I want to represent UML models in a serialized document using the most standard conventions available. I am looking for a canonical schema document that explicitly dictates the best way to do this. I suspect that, if such a document exists, then it would be written in either XSD, RDF and OWL. So far, I have only been able to find OMG specification documents and academic papers on the subject. I have found some XSD schemas, but they only apply to a particular aspect of the implementation.
Is there a canonical document schema? Where can I find it? If not, what are the most common representation formats and where can I find their schemas?
Are there any libraries that facilitate the generation of mappings from well-formed documents of this kind to graphical representations (e.g. SVG)? The library would ideally be .NET compatible, but this is not a requirement.
Are you looking for XMI (XML Metadata Interchange)? It's an OMG spec for XML representations of UML models; the current version appears to be 2.4.1, and the spec page links to two XSD schema documents.
In theory, XMI should answer part of your first question. XMI is not, however, without perils. From my own experience trying to achieve exactly the same, I would think that the first thing to do is to understand what others did about it, and how these standard documents would be used. These days I would suggest a system setup that involves IBM RSA and Sparx Enterprise Architect (eval versions available, registration may be required, and I am not affiliated with any of these companies). Build at least one comprehensive UML model which would give you the coverage you need, in one tool, then use the XMI export/import function to move the model between them. See what happens. Take a look at a company such as this (the makers of TOOLBUS, not affiliated with them) and think how XMI should affect their business model, and yet it seems that it doesn't...
I would think that success is achievable, but may prove feasible for a (very) narrow scope - scoping is key here.
As for the second part, I don't think you're going to find it, particularly for .NET.
XMI is the keyword you need. But XMI specifies only the document format. It does specify the document structure or contents. The UML metamodel does this. A library which does both for you is org.eclipse.uml2 - it implements the UML 2.4 metamodel and allows to store and restore it in XMI. IBM RSA uses this library as well. As several other Java Tools do.
I'm not aware of a UML2 implementation in a .NET language.

Generate UML from a conceptual data model

I have an conceptual data model (Relational model) created using powerAMC for my database but i wanted to generate DAO from it using acceleo and for that i need it in UML , is there a way to generate UML from a conceptual data model model ?
Acceleo can generate code from any models defined with any EMF based metamodel. The UML project of the Eclipse Foundation defines an UML metamodel based on EMF so that users can create UML models based on EMF and Acceleo can thus generate code from those models.
If you want to use another metamodel, you can do it, so if you want to create a metamodel that matches more closely your data structure, feel free to do so. As an example, you can see here a metamodel that I have created of the Scala language and my generator uses models defined from this metamodel to generate the code. You can find an example of a generator using this metamodel here. You can see in this example that the Acceleo generator is defined on my scala metamodel "http://github.com/sbegaudeau/acceleo/scalametamodel/2011/01" (contrary to an Acceleo generator that would be defined on UML that would be using the standard UML metamodel "http://www.eclipse.org/uml2/3.0.0/UML") and I can manipulate in Acceleo some concepts from this metamodel directly like traits (if you are familiar with Scala).
So you can:
create a metamodel that matches your concepts
create a small converter in java to create an EMF model (instance of your metamodel defining the concepts of your database) and then transform the data in your database to an EMF model that you just have to save.
use Acceleo with your models :)
Regards,
Stephane Begaudeau
Disclaimer: I am the leader of Acceleo.
PowerAMC has a data model which is not object like UML. It is therefore impossible to transform it to UML.
If you have directly the generated database then you can create the UML model from the code but not from database modeler.

Can I use Eclipse-EMF's internal data structure?

In EMF, a user can draw UML diagram and that UML model can be transformed into Java code. As far as I know EMF has its own internal data structure to capture the UML model user draws. And what I want to do is to make UML model by coding, not by drawing, i.e., by using EMF's internal data structure representing UML metamodel(Class, Package, Attribute, etc). Like,
UmlClass myClass = new UmlClass();
UmlAttribute myAttr = new UmlAttribute();
myClass.addAttribute(myAttr);
Is this possible(not even by EMF)? Anyway, I want to use a robust data structure that exactly reflects OMG's standard UML specification.
Thanks in advance.
EMF is a modelling framework designed to support modelling in general, not just UML.
If it is UML in particular you're after, there is indeed such an implementation built on top of EMF. Check out UML2.
There are no classes exactly reflecting the OMG specification, but EMF ECore is a meta model for models. Therefore you can do what you want using EMF ECore. There is lots of doc at http://www.eclipse.org/modeling/emf/docs/#overviews and an excellent book. The link has a picture and link to the book.
An example:
EcoreFactory ecoreFactory = EcoreFactory.eINSTANCE;
EClass myClass = ecoreFactory.createEClass();
myClass.setName("MyClass");
EAttribute myAttr = ECoreFactory.createEAttribute();
myAttr.setName("myAttr");
myAttr.setEType(EcorePackage.Literals.ESTRING);
myClass.getEStructuralFeatures().add(myAttr);

Resources