Skip to content

Conversation

@signedav
Copy link
Member

@signedav signedav commented Jun 13, 2025

In INTERLIS you can define three types of strengths in an ASSOCIATION:

  • Association .. : objects exist independently
  • Aggregation .<> : Child objects belong to one (or no) parent. They should be copied with the parent, but not deleted.
  • Composition .<#>: Child objects belong to a parent. They should be copied with the parent and also deleted.

Normally the QGIS relations of such compositions also become compositions in QGIS and associations become associations. Aggregations - i.e. the use case with copying but not deleting - are not supported in QGIS, which is why they also become associations.

However, new associations or aggregations sometimes also become compositions in QGIS.

  1. if the cardinality is exactly 1:
    ASSOCIATION fakecomp1 =
      fakecomp_1a -- {1} ClassA1;
      fakecomp_1b -- {0..*} ClassB1;
    END fakecomp1;

or

    ASSOCIATION fakecomp2 =
      fakecomp_2a -<> {1} ClassA1;
      fakecomp_2b -- {0..*} ClassB1;
    END fakecomp2;

Because such an object cannot exist without a parent. This fixes

  1. if it is a linking table:
    ASSOCIATION assoc =
      assoc_a -- {0..*} ClassA1;
      assoc_b -- {0..*} ClassB1;
    END assoc;

Which results in two QGIS relations (normalized) with a linking table.

If one of the parents is deleted, the linking table entry is also deleted (but not the other linked parent).

signedav added 4 commits June 13, 2025 10:04
…ons in QGIS. Like --{1} and -<>{1} as well as links from linking tables (to avoid orphans). Resolves opengisch/QgisModelBaker#832
…ions - and linking tables that become compositions (here we update existing tests).

As well it's no provided to have one-to-one relations settings done on associations {1} and {1}
@signedav signedav marked this pull request as ready for review June 13, 2025 11:14
@signedav signedav force-pushed the composition_strength branch from e394bd5 to ad1500d Compare June 13, 2025 11:14
@signedav signedav changed the title Specific combinations of assocciations should be handled as compositi… Specific assocciations should be handled as compositions in QGIS Jun 13, 2025
@signedav signedav requested a review from gacarrillor June 13, 2025 11:24
Copy link
Member

@gacarrillor gacarrillor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have too much to say here :)

Looks solid with the unit tests!

@signedav signedav merged commit 2187909 into main Jun 13, 2025
5 checks passed
@signedav signedav deleted the composition_strength branch June 13, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants