-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about how to load .xmi files in the raw data set #6
Comments
Hi, I don't know exactly how PyUML works. I guess it doesn't support all models. In EMF (with Java) you can do something like the following:
It is important to register the file extension with ( <dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.36.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.37.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.types</artifactId>
<version>2.0.0.v20140910-1354</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.uml</artifactId>
<version>5.0.1.v20140910-1354</version>
</dependency> I hope this helps. |
Thank you for your time and information,
My project based on the LLM, users provide their idea in nature language and the model will output a .xmi file that satisfies users' needs.
The performance of the workflow is very good but I want to train it with more data.
Here is my workflow to deal with the .xmi files in the Modelset.
Change the .xmi extension to .uml, and use MagicDraw 2022x application/MagicDraw 2022x OpenAPI to import the .uml file using (MagicDraw -> import -> Eclipse UML2(V5.X )), Then export the file to. Clean UML 2.5 .xmi file. Then change the name space to <xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/2.5.1" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
Finally this .xmi can be read by MagicDraw, Eclipse Papyrus, PyUML and ModelIO. Use [ MagicDraw 2022x - diagram- create diagram wizard ] can generate the diagrams by the model definition.(I am new to these software and I am not sure if other software would have similar function)
This data processing idea is to create a training DataSet that is a Easy to use ( Can be imported by multiple platforms with single .xmi file).
Which means the output of the LLM is ready to use.
Best,
ZONGRU
…________________________________
From: Jesús Sánchez Cuadrado ***@***.***>
Sent: Wednesday, November 20, 2024 07:39
To: modelset/modelset-dataset ***@***.***>
Cc: Zongru Wang ***@***.***>; Author ***@***.***>
Subject: Re: [modelset/modelset-dataset] Questions about how to load .xmi files in the raw data set (Issue #6)
Hi,
I don't know exactly how PyUML works. I guess it doesn't support all models. In EMF (with Java) you can do something like the following:
ResourceSetImpl impl = new ResourceSetImpl();
impl.getResourceFactoryRegistry().getExtensionToFactoryMap().put("uml", new UMLResourceFactoryImpl());
impl.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new UMLResourceFactoryImpl());
impl.getPackageRegistry().put(UMLPackage.eINSTANCE.getNsURI(), UMLPackage.eINSTANCE);
Resource r = impl.getResource(URI.createFileURI(file.getAbsolutePath()), true);
It is important to register the file extension with (impl.getResourceFactoryRegistry()...) when you execute the program in standalone mode (i.e., not as an Eclipse plug-in). If this is the case, don't forget to add the EMF dependencies to your pom.xml. Something like this:
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.36.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.37.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.types</artifactId>
<version>2.0.0.v20140910-1354</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.uml</artifactId>
<version>5.0.1.v20140910-1354</version>
</dependency>
I hope this helps.
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGTLBKQL5ILFGWJSWVLQ4WL2BQ4B5AVCNFSM6AAAAABSBJXEU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBXG4ZTSOBVHE>.
You are receiving this because you authored the thread.
|
BTW,
Your python example
dataset = ds.load(MODELSET_HOME, modeltype = 'ecore', selected_analysis = ['stats'])
# You can just use: ds.load(MODELSET_HOME, modeltype = 'ecore') to speedup the loading if you don't need the stats
I look up your model-set.py/src, and the dataset-txt files, I assumes that the txt files are tags for each element in a model. But
dataset = ds.load(MODELSET_HOME, modeltype = 'uml', selected_analysis = ['genmymodel'])
Will only show 4 columns, I don;t know how to check the labeled tags in each element.
[cid:201ae7ad-107d-4337-96d2-7f53a34bb6b2]
[cid:b3d24783-9a7f-4447-b21c-e787a9c58b28]
And for the graphic presentation, I notice that they are all .json files. How to load and show them in graphic?
…________________________________
From: ZONGRU WANG ***@***.***>
Sent: Thursday, November 21, 2024 02:55
To: modelset/modelset-dataset ***@***.***>; modelset/modelset-dataset ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [modelset/modelset-dataset] Questions about how to load .xmi files in the raw data set (Issue #6)
Thank you for your time and information,
My project based on the LLM, users provide their idea in nature language and the model will output a .xmi file that satisfies users' needs.
The performance of the workflow is very good but I want to train it with more data.
Here is my workflow to deal with the .xmi files in the Modelset.
Change the .xmi extension to .uml, and use MagicDraw 2022x application/MagicDraw 2022x OpenAPI to import the .uml file using (MagicDraw -> import -> Eclipse UML2(V5.X )), Then export the file to. Clean UML 2.5 .xmi file. Then change the name space to <xmi:XMI xmlns:xmi="http://www.omg.org/spec/XMI/2.5.1" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
Finally this .xmi can be read by MagicDraw, Eclipse Papyrus, PyUML and ModelIO. Use [ MagicDraw 2022x - diagram- create diagram wizard ] can generate the diagrams by the model definition.(I am new to these software and I am not sure if other software would have similar function)
This data processing idea is to create a training DataSet that is a Easy to use ( Can be imported by multiple platforms with single .xmi file).
Which means the output of the LLM is ready to use.
Best,
ZONGRU
________________________________
From: Jesús Sánchez Cuadrado ***@***.***>
Sent: Wednesday, November 20, 2024 07:39
To: modelset/modelset-dataset ***@***.***>
Cc: Zongru Wang ***@***.***>; Author ***@***.***>
Subject: Re: [modelset/modelset-dataset] Questions about how to load .xmi files in the raw data set (Issue #6)
Hi,
I don't know exactly how PyUML works. I guess it doesn't support all models. In EMF (with Java) you can do something like the following:
ResourceSetImpl impl = new ResourceSetImpl();
impl.getResourceFactoryRegistry().getExtensionToFactoryMap().put("uml", new UMLResourceFactoryImpl());
impl.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new UMLResourceFactoryImpl());
impl.getPackageRegistry().put(UMLPackage.eINSTANCE.getNsURI(), UMLPackage.eINSTANCE);
Resource r = impl.getResource(URI.createFileURI(file.getAbsolutePath()), true);
It is important to register the file extension with (impl.getResourceFactoryRegistry()...) when you execute the program in standalone mode (i.e., not as an Eclipse plug-in). If this is the case, don't forget to add the EMF dependencies to your pom.xml. Something like this:
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.36.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.37.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.types</artifactId>
<version>2.0.0.v20140910-1354</version>
</dependency>
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>org.eclipse.uml2.uml</artifactId>
<version>5.0.1.v20140910-1354</version>
</dependency>
I hope this helps.
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGTLBKQL5ILFGWJSWVLQ4WL2BQ4B5AVCNFSM6AAAAABSBJXEU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBXG4ZTSOBVHE>.
You are receiving this because you authored the thread.
|
Hi! I'm sorry for the delay in answering this, I didn't see the notification. Actually, the .txt files are 1-grams of the models, that is, a textual representation of the model extracting the strings in the models. The tags and the labels are stored in the .db files. They can be opened with SQLite. When you load a dataframe with the load method, then you need to use to_normalized_df() to obtain a dataframe to manipulate the dataset. Please, have a look a this tutorial: https://models-lab.github.io/blog/2021/modelset/ Regarding the graphical representation, there is currently no graphical representation for the models. |
Estimado Profesor Sánchez,
I am doing a project and need UML models with written in .xmi.
I looked at the raw data .xmi files in the data set and try to validate and load them in batches.
I am new to the MBSE area and I tried modelio 5.4, eclipse payaras, eclipse uml 2.5 and magicdraw 2022x.
For now some .xmi files can be loaded and view by magicdraw 2022x when changing the .xmi to .uml and choose eclipse uml eclipse.
It there any tutorial that shows how to load these .xmi filles correctly?
The best way for me is to use python to validate and represent the model, even generate graphic, I tried
pyecore and pyuml2 python package which still show errors.
Please let me know if you have any suggestions for me.
Atentamente
Cordialmente
The text was updated successfully, but these errors were encountered: