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

Working with base model data in the extended model instance #723

Open signedav opened 2 years ago

signedav commented 2 years ago

Reanimation of this issue (on 03-2023)

Reopened this issue because it's a valid problem / use case for some users.

Exporting from extended model instance and importing into base model instance

Well possible. Just collect the data in the extended model instance, export the data with --exportModels basemodelname like #665 (exports data in the format of base model) and import it into your base model instance. See "I can create lower-authority-data and provide them to the top-authority" below...

Exporting from base model instance and importing into extended model instance

Not possible. No function provides us to export data in the format of an extended model. The base model instance does not know about the extended model anyway.

So the questions is: Why I cannot import the data from the base model to the extended model?

Well, because an extended model has:

  1. more restrictive constraints
  2. additional attributes that have constraints (e.g. mandatory) So the data of the base model would be invalid or cannot even be imported, because of database constraints.

But in my case it would work

In lot's of cases the mentioned issues won't encounter because the extended models do not have more restrictive constraint or mandatory additional attributes. There the "hacky" way would work. See "Conclusions - Another hacky approach..." or the XSL Approach here https://github.com/opengisch/QgisModelBaker/issues/723#issuecomment-1491542164

Background (from 09-2022)

Topic

Not really a Model Baker issue, but needs to be discussed to be able to solve issues like https://github.com/opengisch/QgisModelBaker/issues/665 and https://github.com/opengisch/QgisModelBaker/issues/461

It's about the question how I do work on data coming from a base model on my extended model.

Test model:

Base Model

INTERLIS 2.3;

MODEL Bund_City_V1_1 (en) AT "mailto:localhost" VERSION "2021-07-20" =

  TOPIC Constructions =
    CLASS Building  =
      Name : MANDATORY TEXT*99;
    END Building;
    CLASS Street  =
      Name : MANDATORY TEXT*99;
    END Street;
    CLASS Cooperation  =
      Name : MANDATORY TEXT*99;
    END Cooperation;
  END Constructions;

END Bund_City_V1_1.

Extended Model

MODEL KantonOne_City_V1_1 (en) AT "mailto:localhost" VERSION "2021-07-20" =
  IMPORTS Bund_City_V1_1;

  TOPIC Constructions EXTENDS Bund_City_V1_1.Constructions =
    CLASS Building (EXTENDED) =
      Description : TEXT*99;
    END Building;
  END Constructions;

END KantonOne_City_V1_1.

Problem

When I get data from the top authority, I would like to work on this data in my extended model form. But they are imported into the table based on the base model.

Cannot work on top-authority-data in the extended model way

  1. Import of Model Bund_City_V1_1 to bund.gpkg
  2. Import of Model of KantonOne_City_V1_1 to kantonone.gpkg
  3. Collect data on bund.gpkg: entry on buliding "name=Bundeshaus", entries on cooperation "name=swisstopo" and "name=bafu"
  4. Export bund.gpkg to bund_export.xtf
    <?xml version="1.0" encoding="UTF-8"?><TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
    <HEADERSECTION SENDER="ili2gpkg-4.9.0-eb3a0d51869bd2adeeb51fe7aba4b526fe002c1a" VERSION="2.3"><MODELS><MODEL NAME="Bund_City_V1_1" VERSION="2021-07-20" URI="mailto:localhost"></MODEL></MODELS></HEADERSECTION>
    <DATASECTION>
    <Bund_City_V1_1.Constructions BID="e3866564-1051-4457-83eb-086d7a347991">
    <Bund_City_V1_1.Constructions.Building TID="c6f0d390-e427-4c55-896c-ae57f1cd7fb4"><Name>Bundeshaus</Name></Bund_City_V1_1.Constructions.Building>
    <Bund_City_V1_1.Constructions.Cooperation TID="e02169aa-20e6-495c-9d7f-dc0c07fc5256"><Name>swisstopo</Name></Bund_City_V1_1.Constructions.Cooperation>
    <Bund_City_V1_1.Constructions.Cooperation TID="f6172c86-9c84-4910-9054-eefbe2d84897"><Name>bafu</Name></Bund_City_V1_1.Constructions.Cooperation>
    </Bund_City_V1_1.Constructions>
    </DATASECTION>
    </TRANSFER>
  5. Import bund_export.xtf to kantonone.gpkg > the data of building is stored in the building layer of Bund_City_V1_1 (not of KantonOne_City_V1_1).

So I cannot add any description to the data I got from the top authority. Is this normal?

I can create lower-authority-data and provide them to the top-authority

(I think this is the use case of most people)

  1. Collect data on kantonone.gpkg: entry on buliding of KantonOne_City_V1_1 "name=Kantonshaus, description=Wunderschön", entry on cooperation "name=opengisch"
  2. Export kantonone.gpkg to kanton_export.xtf
    <?xml version="1.0" encoding="UTF-8"?><TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
    <HEADERSECTION SENDER="ili2gpkg-4.9.0-eb3a0d51869bd2adeeb51fe7aba4b526fe002c1a" VERSION="2.3"><MODELS><MODEL NAME="KantonOne_City_V1_1" VERSION="2021-07-20" URI="mailto:localhost"></MODEL><MODEL NAME="Bund_City_V1_1" VERSION="2021-07-20" URI="mailto:localhost"></MODEL></MODELS></HEADERSECTION>
    <DATASECTION>
    <Bund_City_V1_1.Constructions BID="177f13d0-e5b0-449a-a60b-0d694e5e8b65">
    <Bund_City_V1_1.Constructions.Cooperation TID="101fe568-8a6a-45a4-967d-f0c4195205e1"><Name>opengisch</Name></Bund_City_V1_1.Constructions.Cooperation>
    </Bund_City_V1_1.Constructions>
    <KantonOne_City_V1_1.Constructions BID="01080c04-80e9-403a-b242-60919fde56c8">
    <KantonOne_City_V1_1.Constructions.Building TID="f75019b0-597b-4229-afad-2b6ae44fcf80"><Name>Kantonshaus</Name><Description>Wunderschön</Description></KantonOne_City_V1_1.Constructions.Building>
    </KantonOne_City_V1_1.Constructions>
    <Bund_City_V1_1.Constructions BID="e3866564-1051-4457-83eb-086d7a347991">
    <Bund_City_V1_1.Constructions.Building TID="c6f0d390-e427-4c55-896c-ae57f1cd7fb4"><Name>Bundeshaus</Name></Bund_City_V1_1.Constructions.Building>
    <Bund_City_V1_1.Constructions.Cooperation TID="e02169aa-20e6-495c-9d7f-dc0c07fc5256"><Name>swisstopo</Name></Bund_City_V1_1.Constructions.Cooperation>
    <Bund_City_V1_1.Constructions.Cooperation TID="f6172c86-9c84-4910-9054-eefbe2d84897"><Name>bafu</Name></Bund_City_V1_1.Constructions.Cooperation>
    </Bund_City_V1_1.Constructions>
    </DATASECTION>
    </TRANSFER>
  3. Importing it into bund.gpkg would work, but create the KantonOne_City_V1_1 structure and import there.
  4. So we better export kantonone.gpkg with --exportModels Bund_City_V1_1 to kantonbund_export.xtf
    <?xml version="1.0" encoding="UTF-8"?><TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
    <HEADERSECTION SENDER="ili2gpkg-4.9.0-eb3a0d51869bd2adeeb51fe7aba4b526fe002c1a" VERSION="2.3"><MODELS><MODEL NAME="Bund_City_V1_1" VERSION="2021-07-20" URI="mailto:localhost"></MODEL></MODELS></HEADERSECTION>
    <DATASECTION>
    <Bund_City_V1_1.Constructions BID="177f13d0-e5b0-449a-a60b-0d694e5e8b65">
    <Bund_City_V1_1.Constructions.Cooperation TID="101fe568-8a6a-45a4-967d-f0c4195205e1"><Name>opengisch</Name></Bund_City_V1_1.Constructions.Cooperation>
    </Bund_City_V1_1.Constructions>
    <Bund_City_V1_1.Constructions BID="01080c04-80e9-403a-b242-60919fde56c8">
    <Bund_City_V1_1.Constructions.Building TID="f75019b0-597b-4229-afad-2b6ae44fcf80"><Name>Kantonshaus</Name></Bund_City_V1_1.Constructions.Building>
    </Bund_City_V1_1.Constructions>
    <Bund_City_V1_1.Constructions BID="e3866564-1051-4457-83eb-086d7a347991">
    <Bund_City_V1_1.Constructions.Building TID="c6f0d390-e427-4c55-896c-ae57f1cd7fb4"><Name>Bundeshaus</Name></Bund_City_V1_1.Constructions.Building>
    <Bund_City_V1_1.Constructions.Cooperation TID="e02169aa-20e6-495c-9d7f-dc0c07fc5256"><Name>swisstopo</Name></Bund_City_V1_1.Constructions.Cooperation>
    <Bund_City_V1_1.Constructions.Cooperation TID="f6172c86-9c84-4910-9054-eefbe2d84897"><Name>bafu</Name></Bund_City_V1_1.Constructions.Cooperation>
    </Bund_City_V1_1.Constructions>
    </DATASECTION>
    </TRANSFER>
  5. Importing kantonbund_export.xtf to bund.gpkg works properly.

Conclusion:

Exporting from top model to minor model - adding stuff on minor model and export back to top model, seems to work fine and as expected. But working in the minor model on data of the top model, seems to limit them on the top level structure.

I would expect, that I can use the data from the base model in the way of the extended model. Like: How can I achieve, that I can set a description for the entry "Bundeshaus"?

signedav commented 2 years ago

When I would do the hacky way updating my existing data, the attribute description of my extendeded building would be overwritten with NULL.

signedav commented 2 years ago

Well the simple response to "why I cannot import the data from the base model to the extended model" is, that the extended model can have 1. more restrictive constraints and 2. additional attributes that have constraints. So the data of the base model would be invalid or cannot even be imported, because of database constraints.

signedav commented 1 year ago

A less hacky transformation approach

It has to be a transformation

While an extended model contains the base model, the export into the base model format is something that can be properly achieved. The other way is a real transformation of two different models - it's just that the format is mostly very similar. But this is the reason why it most possibly won't be a default integration in ili2db.

Using XSLT Trafo Files

The approach with XSL we know from the successful project MGDM2OEREB: https://github.com/openoereb/mgdm2oereb XSLT is a way of transform XML structured files. It's solid and well integrated in all the popular programming languages.

PoC

Base Model

INTERLIS 2.3;

/* Ortsplanung as national model */
MODEL Ortsplanung_V1_1 (en) AT "https://modelbaker.ch" VERSION "2023-03-29" =

  IMPORTS LocalisationCH_V1,GeometryCHLV95_V1;
  DOMAIN
      CHSurface = SURFACE WITH (STRAIGHTS) VERTEX GeometryCHLV95_V1.Coord2 WITHOUT OVERLAPS > 0.001;

  TOPIC Konstruktionen =
    CLASS Gebaeude  =
      Name : MANDATORY TEXT*99;
      Geometrie : MANDATORY Ortsplanung_V1_1.CHSurface;
    END Gebaeude;

    CLASS BesitzerIn =
        Vorname : MANDATORY TEXT*99;
        Nachname : MANDATORY TEXT*99;
    END BesitzerIn;

    ASSOCIATION Gebaeude_BesitzerIn =
      BesitzerIn -- {0..1} BesitzerIn;
      Gebaeude -- {0..*} Gebaeude;
    END Gebaeude_BesitzerIn;
  END Konstruktionen;

END Ortsplanung_V1_1.

Base Data

<?xml version="1.0" encoding="UTF-8"?><TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
<HEADERSECTION SENDER="ili2pg-4.10.0-c2af4b50c5475f788286f974812b52bb0f9b19bc" VERSION="2.3">
<MODELS>
<MODEL NAME="Ortsplanung_V1_1" VERSION="2023-03-29" URI="https://modelbaker.ch"></MODEL>
<MODEL NAME="AnotherModel_V1_2" VERSION="2021-04-05" URI="https://modelbaker.ch"></MODEL>
</MODELS>
</HEADERSECTION>
<DATASECTION>
<Ortsplanung_V1_1.Konstruktionen BID="bff5ec3c-4851-4de4-9527-75115aa4ea89">
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="8803af6d-ac97-48a9-9bfe-99ea543b8f80"><Vorname>Uma</Vorname><Nachname>Thurman</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"><Vorname>Bill</Vorname><Nachname>Murray</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.Gebaeude TID="5cdad41d-2bd6-45a8-a0cb-904ff5a8a611"><Name>Kino Rex</Name><Geometrie><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699839.636</C1><C2>1262336.345</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699822.808</C1><C2>1262352.067</C2></COORD><COORD><C1>2699828.189</C1><C2>1262333.300</C2></COORD><COORD><C1>2699839.636</C1><C2>1262336.345</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn REF="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"></BesitzerIn></Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Ortsplanung_V1_1.Konstruktionen.Gebaeude TID="f0cd1933-ed97-409c-b8e8-7249f4b76fe1"><Name>Bills Eckkneipe</Name><Geometrie><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699831.336</C1><C2>1262370.085</C2></COORD><COORD><C1>2699819.095</C1><C2>1262366.784</C2></COORD><COORD><C1>2699822.808</C1><C2>1262352.067</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn REF="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"></BesitzerIn></Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Ortsplanung_V1_1.Konstruktionen.Gebaeude TID="eb3e8054-ccf5-4067-8dc6-7875b2316e0f"><Name>Mini Alien Pub</Name><Geometrie><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD><COORD><C1>2699852.475</C1><C2>1262360.010</C2></COORD><COORD><C1>2699852.509</C1><C2>1262364.205</C2></COORD><COORD><C1>2699847.351</C1><C2>1262365.271</C2></COORD><COORD><C1>2699843.672</C1><C2>1262363.036</C2></COORD><COORD><C1>2699843.122</C1><C2>1262359.425</C2></COORD><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn REF="8803af6d-ac97-48a9-9bfe-99ea543b8f80"></BesitzerIn></Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="414dc948-1f37-4000-ad36-43e604755ae6"><Vorname>Moritz</Vorname><Nachname>Bleibtreu</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="7fb847fd-9af9-495c-a900-9eb4998af9a8"><Vorname>Tom</Vorname><Nachname>Hanks</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.Gebaeude TID="4560b33e-c880-4eb5-91ce-8ab4231340d1"><Name>Bubba Gump Halle</Name><Geometrie><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699847.874</C1><C2>1262313.436</C2></COORD><COORD><C1>2699841.505</C1><C2>1262336.842</C2></COORD><COORD><C1>2699826.539</C1><C2>1262332.861</C2></COORD><COORD><C1>2699832.589</C1><C2>1262307.226</C2></COORD><COORD><C1>2699846.282</C1><C2>1262310.411</C2></COORD><COORD><C1>2699845.486</C1><C2>1262312.640</C2></COORD><COORD><C1>2699847.874</C1><C2>1262313.436</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn REF="7fb847fd-9af9-495c-a900-9eb4998af9a8"></BesitzerIn></Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Ortsplanung_V1_1.Konstruktionen.Gebaeude TID="5742c809-73da-4445-bc0f-d5a5d5c5f539"><Name>Alte Metzg</Name><Geometrie><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD><COORD><C1>2699843.122</C1><C2>1262359.425</C2></COORD><COORD><C1>2699843.672</C1><C2>1262363.036</C2></COORD><COORD><C1>2699847.351</C1><C2>1262365.271</C2></COORD><COORD><C1>2699852.509</C1><C2>1262364.205</C2></COORD><COORD><C1>2699852.475</C1><C2>1262360.010</C2></COORD><COORD><C1>2699868.980</C1><C2>1262363.861</C2></COORD><COORD><C1>2699865.266</C1><C2>1262379.541</C2></COORD><COORD><C1>2699831.336</C1><C2>1262370.085</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn REF="414dc948-1f37-4000-ad36-43e604755ae6"></BesitzerIn></Ortsplanung_V1_1.Konstruktionen.Gebaeude>
</Ortsplanung_V1_1.Konstruktionen>
</DATASECTION>
</TRANSFER>

Extended Model

INTERLIS 2.3;

/* Extended Ortsplanung as cantonal model importing national model */
MODEL Kantonale_Ortsplanung_V1_1 (en) AT "https://modelbaker.ch" VERSION "2023-03-29" =
  IMPORTS Ortsplanung_V1_1;

  TOPIC Konstruktionen EXTENDS Ortsplanung_V1_1.Konstruktionen =
    CLASS Gebaeude  (EXTENDED)=
      Beschreibung: TEXT;
      Referenzcode: TEXT;

      !!@ ilivalid.msg = "Beschreibung and/or Referenzcode must be defined."
      SET CONSTRAINT DEFINED (Beschreibung) OR DEFINED (Referenzcode);
    END Gebaeude;
  END Konstruktionen;

END Kantonale_Ortsplanung_V1_1.

XSLT trafo file

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ili="http://www.interlis.ch/INTERLIS2.3"
                version="1.0">
    <!-- generic template for all nodes -->
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <!-- base model needs to be renamed -->
    <xsl:template match="ili:MODEL">
        <xsl:choose>
            <xsl:when test="@NAME='Ortsplanung_V1_1'">
                <MODEL NAME="Kantonale_Ortsplanung_V1_1" VERSION="{@VERSION}" URI="{@URI}"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:copy-of select="."/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="ili:Ortsplanung_V1_1.Konstruktionen.Gebaeude">
        <Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
            <xsl:apply-templates select="@*|node()"/>
            <!-- default value to fulfill constraint -->
            <Referenzcode>xxxx-000</Referenzcode>
        </Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
    </xsl:template>
</xsl:stylesheet>

Result

<?xml version="1.0"?>
<TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
<HEADERSECTION SENDER="ili2pg-4.10.0-c2af4b50c5475f788286f974812b52bb0f9b19bc" VERSION="2.3">
<MODELS>
<MODEL xmlns="" NAME="Kantonale_Ortsplanung_V1_1" VERSION="2023-03-29" URI="https://modelbaker.ch"/>
</MODELS>
</HEADERSECTION>
<DATASECTION>
<Ortsplanung_V1_1.Konstruktionen BID="bff5ec3c-4851-4de4-9527-75115aa4ea89">
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="8803af6d-ac97-48a9-9bfe-99ea543b8f80"><Vorname>Uma</Vorname><Nachname>Thurman</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"><Vorname>Bill</Vorname><Nachname>Murray</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude xmlns="" xmlns:ili="http://www.interlis.ch/INTERLIS2.3" TID="5cdad41d-2bd6-45a8-a0cb-904ff5a8a611"><Name xmlns="http://www.interlis.ch/INTERLIS2.3">Kino Rex</Name><Geometrie xmlns="http://www.interlis.ch/INTERLIS2.3"><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699839.636</C1><C2>1262336.345</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699822.808</C1><C2>1262352.067</C2></COORD><COORD><C1>2699828.189</C1><C2>1262333.300</C2></COORD><COORD><C1>2699839.636</C1><C2>1262336.345</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn xmlns="http://www.interlis.ch/INTERLIS2.3" REF="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"/><Referenzcode>xxxx-000</Referenzcode></Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude xmlns="" xmlns:ili="http://www.interlis.ch/INTERLIS2.3" TID="f0cd1933-ed97-409c-b8e8-7249f4b76fe1"><Name xmlns="http://www.interlis.ch/INTERLIS2.3">Bills Eckkneipe</Name><Geometrie xmlns="http://www.interlis.ch/INTERLIS2.3"><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699831.336</C1><C2>1262370.085</C2></COORD><COORD><C1>2699819.095</C1><C2>1262366.784</C2></COORD><COORD><C1>2699822.808</C1><C2>1262352.067</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn xmlns="http://www.interlis.ch/INTERLIS2.3" REF="1011e8e4-bfc5-4e40-b732-3ac38c0e2be6"/><Referenzcode>xxxx-000</Referenzcode></Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude xmlns="" xmlns:ili="http://www.interlis.ch/INTERLIS2.3" TID="eb3e8054-ccf5-4067-8dc6-7875b2316e0f"><Name xmlns="http://www.interlis.ch/INTERLIS2.3">Mini Alien Pub</Name><Geometrie xmlns="http://www.interlis.ch/INTERLIS2.3"><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD><COORD><C1>2699852.475</C1><C2>1262360.010</C2></COORD><COORD><C1>2699852.509</C1><C2>1262364.205</C2></COORD><COORD><C1>2699847.351</C1><C2>1262365.271</C2></COORD><COORD><C1>2699843.672</C1><C2>1262363.036</C2></COORD><COORD><C1>2699843.122</C1><C2>1262359.425</C2></COORD><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn xmlns="http://www.interlis.ch/INTERLIS2.3" REF="8803af6d-ac97-48a9-9bfe-99ea543b8f80"/><Referenzcode>xxxx-000</Referenzcode></Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="414dc948-1f37-4000-ad36-43e604755ae6"><Vorname>Moritz</Vorname><Nachname>Bleibtreu</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Ortsplanung_V1_1.Konstruktionen.BesitzerIn TID="7fb847fd-9af9-495c-a900-9eb4998af9a8"><Vorname>Tom</Vorname><Nachname>Hanks</Nachname></Ortsplanung_V1_1.Konstruktionen.BesitzerIn>
<Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude xmlns="" xmlns:ili="http://www.interlis.ch/INTERLIS2.3" TID="4560b33e-c880-4eb5-91ce-8ab4231340d1"><Name xmlns="http://www.interlis.ch/INTERLIS2.3">Bubba Gump Halle</Name><Geometrie xmlns="http://www.interlis.ch/INTERLIS2.3"><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699847.874</C1><C2>1262313.436</C2></COORD><COORD><C1>2699841.505</C1><C2>1262336.842</C2></COORD><COORD><C1>2699826.539</C1><C2>1262332.861</C2></COORD><COORD><C1>2699832.589</C1><C2>1262307.226</C2></COORD><COORD><C1>2699846.282</C1><C2>1262310.411</C2></COORD><COORD><C1>2699845.486</C1><C2>1262312.640</C2></COORD><COORD><C1>2699847.874</C1><C2>1262313.436</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn xmlns="http://www.interlis.ch/INTERLIS2.3" REF="7fb847fd-9af9-495c-a900-9eb4998af9a8"/><Referenzcode>xxxx-000</Referenzcode></Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
<Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude xmlns="" xmlns:ili="http://www.interlis.ch/INTERLIS2.3" TID="5742c809-73da-4445-bc0f-d5a5d5c5f539"><Name xmlns="http://www.interlis.ch/INTERLIS2.3">Alte Metzg</Name><Geometrie xmlns="http://www.interlis.ch/INTERLIS2.3"><SURFACE><BOUNDARY><POLYLINE><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD><COORD><C1>2699845.503</C1><C2>1262357.843</C2></COORD><COORD><C1>2699843.122</C1><C2>1262359.425</C2></COORD><COORD><C1>2699843.672</C1><C2>1262363.036</C2></COORD><COORD><C1>2699847.351</C1><C2>1262365.271</C2></COORD><COORD><C1>2699852.509</C1><C2>1262364.205</C2></COORD><COORD><C1>2699852.475</C1><C2>1262360.010</C2></COORD><COORD><C1>2699868.980</C1><C2>1262363.861</C2></COORD><COORD><C1>2699865.266</C1><C2>1262379.541</C2></COORD><COORD><C1>2699831.336</C1><C2>1262370.085</C2></COORD><COORD><C1>2699835.325</C1><C2>1262355.230</C2></COORD></POLYLINE></BOUNDARY></SURFACE></Geometrie><BesitzerIn xmlns="http://www.interlis.ch/INTERLIS2.3" REF="414dc948-1f37-4000-ad36-43e604755ae6"/><Referenzcode>xxxx-000</Referenzcode></Kantonale_Ortsplanung_V1_1.Konstruktionen.Gebaeude>
</Ortsplanung_V1_1.Konstruktionen>
</DATASECTION>
</TRANSFER>

And this can be imported properly with ili2db... image

Limitations

These are not limitations of this approach but limitations of a base-data2extended-data transformation in general:

Integration in Model Baker (ideas)

Local XSLT

Being able to choose a trafo file from the local system at the same moment like we choose the data file. image (Sketch link: https://excalidraw.com/#json=0uLIHVrP_adBNmcBArGdv,ZR3KK6cB4WKQyWnhwvZGOg)

UsabILIty Hub

An integration into ilidata / UsabILIty Hub would be an interesting approach as well.

But this requires a redesign of the Wizard workflow. Some ideas already noted here https://gist.github.com/signedav/7c9e2c8e895003bd1f7a9b4dd80797c0#redesign-idea