Skip to content
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

Open
Zongru-Wang opened this issue Nov 19, 2024 · 4 comments
Open

Questions about how to load .xmi files in the raw data set #6

Zongru-Wang opened this issue Nov 19, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Zongru-Wang
Copy link

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

@Zongru-Wang Zongru-Wang added the question Further information is requested label Nov 19, 2024
@jesusc
Copy link
Contributor

jesusc commented Nov 20, 2024

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.

@Zongru-Wang
Copy link
Author

Zongru-Wang commented Nov 21, 2024 via email

@Zongru-Wang
Copy link
Author

Zongru-Wang commented Nov 21, 2024 via email

@jesusc
Copy link
Contributor

jesusc commented Dec 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants