Book a Demo

Author Topic: Translate FeatureType with self-referencing association to GML XSD  (Read 6006 times)

joerg.klausen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Dear Forum
we have a UML model in EA 13.5 that defines es a FeatureType with an association that refers back to the same FeatureType. The purpose of this is to allow a hierarchy of parent-child relationships to model Equipment with sub Equipment. The UML looks fine, however, when we express this as a GML 3.2 Schema, the association is simply ignored. Any advice would be much appreciated.
Thanks!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #1 on: December 02, 2018, 10:41:08 pm »
I guess the acronym GML is not very common. Can you translate it, please?

q.

joerg.klausen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #2 on: December 03, 2018, 05:16:22 pm »
Hi qwerty
GML = Geography Markup Language (https://en.wikipedia.org/wiki/Geography_Markup_Language)
I don't think that this has much to do with GML itself, though ...
Kind regards
Jörg

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #3 on: December 03, 2018, 05:46:55 pm »
Hi,

I'm not sure what type of export exactly you are using, but I think I would try to replace the association with an attribute.
Not sure if that's going to work, but it's worth a shot.

Geert

joerg.klausen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #4 on: December 03, 2018, 07:01:22 pm »
Hi Geert
we have created an "Application Schema" UML model that can be exported using right-click > Extensions > GML > Generate GML Applications Schema.
The association has the same Source and Target, and in the "Role(s)" tab of the Association Properties, we have mentioned the name of the association in the Dropdown. This name Shows up in the UML model, but not in the XSD.
I wished I could send screenshots or the entire model to make this clearer ... and I don't understand how an Attribute could be used to enable a self-reference.
Kind regards
Jörg

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #5 on: December 03, 2018, 07:11:25 pm »
Jörg,

Every association can be modeled as an attribute.
They are actually more or less the same thing.
Create a new attribute and give it the association rolename as name.
Then select the same class as type.
Set the multiplicity if needed (standard is [1..1])

Geert

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #6 on: December 05, 2018, 11:38:40 am »
I admit that I don't really understand what this process is doing, but does the setting of the 'Ignore Element and Property Visibility' option make a difference?  Or the Scope of the Association Ends?

From the Help:
"Click on this option to include all Classes, Attributes and Association End roles in the GML Application Schema, irrespective of their visibility (or Scope). Otherwise, only those with Public visibility will be considered for generation."
Best Regards, Roy

joerg.klausen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #7 on: December 05, 2018, 10:54:54 pm »
Hi Geert, RoyC
I didn't find the 'Ignore Element and Property Visibility' Option, I am afraid, but using the Attribute Approach did the trick, and the Schema now Show this self-reference. Now I have an Attribute *and* and association. Before I remove the association from the diagram (I like the visual of it, because it Shows immediately the fact that the FeatureType can reference itself), is there a way to *hide* the Attribute from the model?
Thanks
Jörg

BTW: This is modeled after the ISO19156 OM_Observation FeatureType (+relatedObservation), if that helps to understand what we are trying to do.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #8 on: December 05, 2018, 11:03:49 pm »
You can hide the attribute from a diagram, but not from the model.

Geert

joerg.klausen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Translate FeatureType with self-referencing association to GML XSD
« Reply #9 on: December 06, 2018, 12:54:28 am »
Okay, I found it ;-)
So, to help others with EA 13.5:
- a self-reference is best established as an Attribute of the type of class one wants to reference
- an named association can be drawn on the diagram to to Show this, but it may not materialize in an XSD created from the model (it didn't, in my case)
- to hide the Attribute from the diagram, right-click on the class, select "Features&Properties" > "Feature and Compartment Visibility" > "Attribute visibility" > Custom, then select the attributes to hide.
Thanks for everyone's help.