Book a Demo

Author Topic: XSD to DDL issue  (Read 3191 times)

hender

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
XSD to DDL issue
« on: September 12, 2020, 12:29:45 am »
I have imported a NeTEx (CEN Technical Standard for exchanging Public Transport schedules and related data) XSD structure to EA in order to create a DDL script for an Oracle DB using EA 14.
http://netex-cen.eu/wp-content/uploads/2016/02/NeTEx-XML-master-1-03.zip
Unfortunately the imported diagrams contain elements with different kind of XSD stereotype (XSDcomplexType, XSDtopLevelElement, XSDattributeGroup, XSDany, XSDschema, XSDsequence, XSDelement, etc.) which are not suitable for generating DDL thus it requires Table elements with Table stereotype if I am not mistaken.
Some advice would be much appreciated.
Thanks in advance!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: XSD to DDL issue
« Reply #1 on: September 13, 2020, 03:40:51 am »
You can't simply translate an xml message model into a database model I'm afraid.

You could automate some stuff with scripts, or a transformation template but it will not be a trivial task.
If this is a one time thing, you might be better off to create the database model manually.

Geert

horszasz

  • EA User
  • **
  • Posts: 22
  • Karma: +6/-0
  • My name is Gergely :)
    • View Profile
Re: XSD to DDL issue
« Reply #2 on: September 14, 2020, 10:31:38 pm »
Hello hender,

Transform an XSD into a DDL model is unfortunately not a trivial thing. There are a lot of quite hard modeling issues, you have to solve before this transformation.

The base problem is, that XSD and relational have two different approach of data modeling. If you have a general, platform independent logical datamodel (e.g. class model), then you are able to generate an XSD model and also a table model from it; but the two models will have some fundamental differences. For example:  in XSD you are not able to use two directional connectors because the navigation will always move from the parent to the child; you need decide, which direction you want to have in XSD. And more: in XSD you are not able to model n:m relations! There are some more differences, I won't detail them now.

Actually, as you generate an XSD (or even a relational) model from the platform independent logical data model (PIM), you make the model impoverished. The platform specific model will always have less information in it, as the PIM have! As XSD model and relational model are specific to two different platforms, it is not possible to derive one from the other!

If you have only an XSD specific model, you have first enrich the model and compose a general logical view, and after that you can generate a platform specific model for the relational platform. It is  unfortunatelly quite difficult. Of course, there are some tools, that can make this steps (for example XMLSpy from Altova), but the relational model generated this way will never be ideal for programmer's work... It is just for storing the XML data in relational DB.

QUESTION: Why don't you use the XML DB functionality of Oracle? In this case you do not need to generate relational model, and Java (or other) classes can easily be generated from the XSD.

Hope, this helps!

Regards,
Gergely
« Last Edit: September 14, 2020, 10:42:40 pm by horszasz »