opengisch / QgisModelBaker

Create QGIS projects from database schemas or Interlis models
https://opengisch.github.io/QgisModelBaker/
GNU Lesser General Public License v3.0
55 stars 17 forks source link

Missing basket variable for Catalogue Dataset used with BAG OF #875

Open signedav opened 9 months ago

signedav commented 9 months ago

Having this

TOPIC Codeliste =
[...]
    CLASS Massnahmen_Code
      EXTENDS CatalogueObjects_V1.Catalogues.Item =
        /** Attribute werden aus bestehendem Katalog importiert */
        Massnahmen : MANDATORY TEXT*50;
      /** Optional */
        Beschreibung : TEXT*200;
      /** Zwingende Massnahmenzuordnung */
      Wiffe : MANDATORY BOOLEAN;
     [...]
        UNIQUE Massnahmen;
    END Massnahmen_Code;

    STRUCTURE Massnahmen_CodeRef
    EXTENDS CatalogueObjects_V1.Catalogues.CatalogueReference =
        /** Lediglich ein Hilfsmittel */
      Reference (EXTENDED) : MANDATORY REFERENCE TO (EXTERNAL) Massnahmen_Code;
    END Massnahmen_CodeRef;
[...]

TOPIC Unterhalt =
    [...]
    CLASS Instandsetzung EXTENDS Erfassung =
          /** SH: Zwingende Angabe wenn kein Beobachtungsstatus */
          Massnahmen : BAG {1..*} OF SH_Binnenschifffahrt_V1_0.Codeliste.Massnahmen_CodeRef;
    [...]

in https://models.geo.sh.ch/TSH/SH_Binnenschifffahrt_V1_0.ili

Creates the *ref table as linking table.

This linking table has a t_basket column and the default value there is linking to a project variable that does not exist.

signedav commented 9 months ago

Was this ever working? The ref-tables should be in the basket of the catalog. Means in the following test-model:

INTERLIS 2.3;
MODEL Unterhaltung_V1 (en) AT "https://modelbaker.ch" VERSION "2024-02-07" =
  IMPORTS CatalogueObjects_V1;

  TOPIC Codeliste =
    CLASS Massnahmen_Code
      EXTENDS CatalogueObjects_V1.Catalogues.Item =
        Massnahmen : MANDATORY TEXT*50;
        Beschreibung : TEXT*200;
    END Massnahmen_Code;

    STRUCTURE Massnahmen_CodeRef
    EXTENDS CatalogueObjects_V1.Catalogues.CatalogueReference =
      Reference (EXTENDED) : MANDATORY REFERENCE TO (EXTERNAL) Massnahmen_Code;
    END Massnahmen_CodeRef;
  END Codeliste;

  TOPIC Unterhalt =
    DEPENDS ON Unterhaltung_V1.Codeliste;

    CLASS Instandsetzung =
      Massnahmen : BAG {1..*} OF Unterhaltung_V1.Codeliste.Massnahmen_CodeRef;
    END Instandsetzung;
  END Unterhalt;
END Unterhaltung_V1.

... it should be default_basket_unterhaltung_v1_codeliste -> the basket of the topic Unterhaltung_V1.Codeliste...

signedav commented 9 months ago

@claeis Is it conceptional required, that a CatalogueReference extension needs to be assigned to a basket?