Skip to content

Commit

Permalink
documentation for delete data implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 8, 2023
1 parent d56b54f commit 9540452
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Binary file modified docs/assets/baskets_dataset_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/workflow_wizard_data_import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions docs/background_info/basket_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ VERSION "2020-06-22" =
OID AS INTERLIS.UUIDOID;
CLASS Buildings =
Code : MANDATORY TEXT*15;
Description : MANDATORY TEXT*99;
Address : Address;
Geometry: Surface;
Description : TEXT*99;
Geometry : Surface;
END Buildings;
CLASS Street =
Code : MANDATORY TEXT*15;
Description : MANDATORY TEXT*99;
Address : Address;
Geometry: Line;
Name : MANDATORY TEXT*99;
Geometry : Line;
END Street;
END Constructions;
Expand Down Expand Up @@ -101,7 +98,10 @@ These are basicly the data in a dataset. You might already notice the `BID` fiel

We need to import the data of Ul Qoma now into our physical model with the ili2db parameter `--dataset "Ul Qoma"`. When the dataset already exists in the physical database we do not make an `--import`, but an `--update` instead. This means all the data in this dataset are updated with the data from the `xtf` file (and removed if not existent there).

With the Model Baker we do make generally an `--update`, because we import only into exiting datasets.
With the Model Baker we do make generally an `--update`, , as we only import into existing datasets. If you want to delete all the data from this dataset first (even from baskets other than those contained in the transfer file), you can check the corresponding box. In this case, a `--replace` command will be executed instead.

!!! Note
The difference between a `--replace` and an `--update` is that the one hand with an `--update` the baskets that are not contained in the transferfile remain untouched and on the other hand the technical ids remain the physical database (because we "update"), whereas with a `--replace` the are freshly created (because here we "delete" and "insert"). This means these two commands could trigger different backend functions (e.g. trigger functions on PostgreSQL).

### Dataset Manager

Expand Down
8 changes: 7 additions & 1 deletion docs/user_guide/import_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ If this option is activated, circular arcs are stroked when importing the data.
### SQL Scripts

You can define `sql` scripts that runs before and after the (schema) import.

### Extra Meta Attribute File

A `toml` or `ini` file can contain values for [meta attributes](../../background_info/meta_attributes/) (like `qgis.modelbaker.dispExpression`) instead of having them directly in the `ili` file.
Expand Down Expand Up @@ -121,7 +122,8 @@ After the physial model is generated or you selected an existing database to imp
![wizard data import](../assets/workflow_wizard_data_import.png)

### Import order
While the order to import the INTERLIS models are not important (usually, see [exceptions](../../background_info/catalogues/Multiple-selection-with-BAG-OF)), the data import often requires the correct order. Transfer data often depends on existing catalogue / codelist data. Drag and drop your files with ![datafile arrow button](../assets/drag_arrows_button.png) to the right order.

While the order to import the INTERLIS models are not important (usually, see [exceptions](../../background_info/catalogues/#multiple-selection-with-bag-of)), the data import often requires the correct order. Transfer data often depends on existing catalogue / codelist data. Drag and drop your files with ![datafile arrow button](../assets/drag_arrows_button.png) to the right order.

### Dataset Handling

Expand All @@ -141,6 +143,10 @@ Not only meta data for ili2db and styling can be received over the ilidata.xml f

Check more information about the catalogues on the *UsabILIty Hub* [here](../../background_info/usabilityhub/modelbaker_integration/#directly-referenced-catalogues).

### Delete data first

If you want to delete the data in the database first, you can check the corresponding box. On using baskets, the ili2db parameter `--replace` is executed instead of `--update`. On not using baskets, the parameter `--deleteData` is added to the command. Note that on using baskets, only the data from the corresponding dataset is deleted, whereas on not using baskets all data from the schema is deleted.

## Generate the QGIS Project

In case you want to generate your project from an existing database, you will need to [set the connection parameters](#database-selection) first.
Expand Down

0 comments on commit 9540452

Please sign in to comment.