Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » What is the status of XSD roundtrip ?(How achievable is XSD -> Ecore -> XSD ?)
What is the status of XSD roundtrip ? [message #901449] Sun, 12 August 2012 09:32 Go to next message
Seref Arikan is currently offline Seref Arikan
Messages: 61
Registered: August 2010
Member
Greetings,
Looking at the google search results, I have a feeling that if I start with an XSD to generate Ecore model, and make changes to model and save as XSD again, the resulting schema contains EMF specific namespaces.

Is this all that is added to resulting XSD? Surely the namespaces must be there for a reason. Is it possible to create an Ecore based tool for modifying existing XSDs, so that nothing related to EMF will exist in the resulting XSD? A simple example would be creating an Ecore model from the XSD and simply changind the name of an attribute, and exporting the model back to XSD

Regards
Seref
Re: What is the status of XSD roundtrip ? [message #901483 is a reply to message #901449] Mon, 13 August 2012 00:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25950
Registered: July 2009
Senior Member
Seref,

Comments below.

On 12/08/2012 3:32 PM, Seref Arikan wrote:
> Greetings,
> Looking at the google search results, I have a feeling that if I start
> with an XSD to generate Ecore model, and make changes to model and
> save as XSD again, the resulting schema contains EMF specific namespaces.
Ecore -> XSD -> Ecore is designed to be a round trip, so if necessary,
non-schema namespace annotations (conforming to what's permitted by the
XML Schema specification) are used to capture information that would
otherwise be lost.
>
> Is this all that is added to resulting XSD?
XSD -> Ecore -> XSD is not designed to be round trip. XSD -> Ecore is a
lossy transformation so while you'll generally get something close to or
equivalent to the original schema is most common cases, it's not
generally to be expected.
> Surely the namespaces must be there for a reason.
Yes. Do you have specific examples?
> Is it possible to create an Ecore based tool for modifying existing
> XSDs, so that nothing related to EMF will exist in the resulting XSD?
If every detail of the original XSD is important, you should modify it,
not the transformed Ecore and then transform it back.
> A simple example would be creating an Ecore model from the XSD and
> simply changind the name of an attribute, and exporting the model back
> to XSD
Can you be more explicit with an actual example? Then I can explain why
annotations are needed for that case...
>
> Regards
> Seref
Re: What is the status of XSD roundtrip ? [message #901499 is a reply to message #901483] Mon, 13 August 2012 03:35 Go to previous messageGo to next message
Seref Arikan is currently offline Seref Arikan
Messages: 61
Registered: August 2010
Member
Hi Ed,
Thanks for the response. This is my use case: there is an XML schema which contains all types from an information model. Various clinical concepts are designed by using these types, such as a blood pressure measurement model. There is no limit to clinical concepts that can be designed; this is the very reason the information model has been created.

When a clinical concept is created, it uses a subset of types from the information model, not all of them. What I want is to use EMF for this clinical concept designer, letting users mix and match types from the information model (imported from XSD to ECore), and then I'd like to let the user create a new XSD that defines the specific clinical model. In this case, the resulting XSD should reference the original XSD(s) for types, and it would be just a restructuring of some types from the main information model (XSD).

Does this sound feasible for an EMF based implementation?

Kind regards
Seref
Re: What is the status of XSD roundtrip ? [message #901509 is a reply to message #901499] Mon, 13 August 2012 04:07 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25950
Registered: July 2009
Senior Member
Seref,

Comments below.

On 13/08/2012 9:35 AM, Seref Arikan wrote:
> Hi Ed, Thanks for the response. This is my use case: there is an XML
> schema which contains all types from an information model. Various
> clinical concepts are designed by using these types, such as a blood
> pressure measurement model. There is no limit to clinical concepts
> that can be designed; this is the very reason the information model
> has been created.
> When a clinical concept is created, it uses a subset of types from the
> information model, not all of them. What I want is to use EMF for this
> clinical concept designer, letting users mix and match types from the
> information model (imported from XSD to ECore), and then I'd like to
> let the user create a new XSD that defines the specific clinical
> model. In this case, the resulting XSD should reference the original
> XSD(s) for types, and it would be just a restructuring of some types
> from the main information model (XSD).
Does this new model have a different namespace than the information
model that's being reused? Each different namespace results in a
different Ecore EPackage and such a package will export to a schema that
imports the namespace of the other models so at worst, you'd need to
update the schema location to refer to the original schema's location.
>
> Does this sound feasible for an EMF based implementation?
It sounds feasible. Perhaps you'll need to tweak the resulting schema a
bit. E.g., swizzle schema location or strip out unwanted
non-schema-namespace attributes.
>
> Kind regards
> Seref
>
Previous Topic:EMF Resources transactional safe?
Next Topic:How can I enumerate all of the generated classes?
Goto Forum:
  


Current Time: Fri Aug 01 18:45:34 EDT 2014

Powered by FUDForum. Page generated in 0.01535 seconds