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

[question] Can a model also be loaded from a schema definition #103

Open
rscharp opened this issue Mar 17, 2021 · 9 comments
Open

[question] Can a model also be loaded from a schema definition #103

rscharp opened this issue Mar 17, 2021 · 9 comments

Comments

@rscharp
Copy link

rscharp commented Mar 17, 2021

Hi,
I try to extract information from AUTOSAR XML (arxml) files. These are defined in Eclipse as ecore. I was able to organize the ecore and it loads fine (after some minimal textural replacements required for Python compatibility).

Unfortunately, I am not able to load the arxml using the ecore model. There seems to be another intermediate level in use, e.g. the classes referred in the arxml do not use the names of the classes as defined in the ecore. Instead, the class names are translated as found in the model below the annotation "TaggedValues" in the detail "xml.name". E.g. the class "adminData" in the ecore is mapped to the name "ADMIN-DATA" in the arxml. Also, there are some structure issues when loading the ecore as is. (I found some workaround that is doable by myself.)

Before I start to further to elaborate on the interpretation of the annotations by pyecore, I think loading an xsd (I have an xsd to the arxml, too) as a model would be really the simpler alternative. In the xsd, the name transformation is applied already.

This leads to my question: Is there planned a feature to load a model from a schema definition?

It seems that EMF can load models from xsd, too. But using Eclipse is always so heavy and cumbersome, so perhaps you have an idea how this could be done by just using Python.

Regards and many thanks for pyecore

@aranega
Copy link
Member

aranega commented Mar 17, 2021

Hi @rscharp ,

Thanks for your question, indeed at the moment, pyecore is not able to read/use xsd directly and information took from. Regarding the issue with the name expressed differently, that's a little bit the same as the one presented in this issue #29. At the moment, it's not supported right away, but there is tricks you can use by providing "aliases" in the metamodel. If it's only a naming problem, that should do it, but I'm aware that it's far from ideal.

Regarding the loading of an xsd, it's on the roadmap, but I cannot tell you when I will work on it (it will imply a lot of changes). There is more chances that I deal with the annotations in the .ecore sonner.

At the same time, could you link me the autosar .ecore files? I could use them as reference for the next developments.

Thanks :)

@rscharp
Copy link
Author

rscharp commented Mar 18, 2021

Hi Vincent,

thx for the very fast feedback. The issue #29 really seems to describe the same issue. I am a bit concerned in being dependent on informal annotations but it seems that this is what the EMF technology is really using.

With the xsd loading I found some tips in the web that Eclipse is able to convert a xsd into a model. I gave this a try yesterday, installing all the needed things and finally went into the process. After 3h hours of having the noise of the Laptop fan in my ears, I gave up as only 20% of the progress bar were done, while the first 10% were done after 5 Minutes. So not sure when things would have come to an end, but it seems the on the fly conversion is really too complex and the whole idea of having an xsd model loading is not really feasible.

The problem with the world of autosar is that these things are not allowed to be shared. Everything is closed, beside the specification which can be downloaded. Sorry for this, but the automotive market is driven by these closed standards and the rules are really strict. I also hate to ask FOSS projects for supporting and at the end the things are not allowed to be shared or extensions to be given back as this would disclose the IP.

@aranega
Copy link
Member

aranega commented Mar 18, 2021

Hi @rscharp ,

I think one of the issues of importing a full xsd is the fact that it can give way more semantic than Ecore (I'm no expert in xsd, but I think you can be very precise on the ints or the format of strings you are using), so... perhaps it comes from that. From the experimentations I made few years back, I wasn't able also to have something working properly with EMF, but I didn't push so much.

Regarding the close format, no problem, I understand. However, do you think you could provide like a kind of example with the same "head", meaning that instead of AUTOSAR metamodel a really small metamodel for Pizza or something else, with the same kind of annotations (and different names, relations...etc), and a really small model related to this one (manually made) with same naming. Just to place myself in the same context.

@frosch01
Copy link

Yes, sure, I can prepare something. It'll be based on a single node. I think this should be sufficient.

@rscharp
Copy link
Author

rscharp commented Mar 23, 2021

Hi again,

I prepared some "Pizza". Do you have an idea how to deliver?

Thx

Ralph

@aranega
Copy link
Member

aranega commented Mar 23, 2021

Hi Ralph,

I think you can share files here directly (drag and drop), or you can send the pizza to my personal email, do as it is the more convenient for you :)

Vince

@rscharp
Copy link
Author

rscharp commented Mar 24, 2021

Hi Vince,

now I also see the comment at the lover corner of the edit field. I never recognized that...

I hope you enjoy the Pizza. If somethings is bad, let me know and I'll try to fix it.

I needed to give a txt extension to let gibhub accept the attachment.

pizza_ecore.txt
margarita_prxml.txt

@aranega
Copy link
Member

aranega commented Mar 24, 2021

Hi Ralph,

Thanks so much for the Pizza! I will check all of that as soon as I can (I got a lot going on)

Vince

@shinyathena
Copy link

a

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

No branches or pull requests

4 participants