Skip to content

Commit

Permalink
Merge pull request #862 from moflexch/ux-view
Browse files Browse the repository at this point in the history
suggested changes in documentation regarding OID Manager
  • Loading branch information
signedav authored Dec 8, 2023
2 parents fea7f64 + 9e06ddc commit 476b03e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion QgisModelBaker/ui/dataset_manager.ui
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<item row="0" column="2">
<widget class="QToolButton" name="basket_manager_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;To create a &lt;span style=&quot; font-weight:600;&quot;&gt;basket&lt;/span&gt; per &lt;span style=&quot; font-weight:600;&quot;&gt;topic&lt;/span&gt; and &lt;span style=&quot; font-weight:600;&quot;&gt;dataset &lt;/span&gt;in the &lt;span style=&quot; font-style:italic;&quot;&gt;t_ili2db_basket&lt;/span&gt; table or not.&lt;/p&gt;&lt;p&gt;While a dataset is just an entry in the &lt;span style=&quot; font-style:italic;&quot;&gt;t_ili2db_dataset&lt;/span&gt; table, there must be baskets for each entry that can be selected. Usually there exists only one basket topic and per dataset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;To create a &lt;span style=&quot; font-weight:600;&quot;&gt;basket&lt;/span&gt; per &lt;span style=&quot; font-weight:600;&quot;&gt;topic&lt;/span&gt; and &lt;span style=&quot; font-weight:600;&quot;&gt;dataset &lt;/span&gt;in the &lt;span style=&quot; font-style:italic;&quot;&gt;t_ili2db_basket&lt;/span&gt; table or not.&lt;/p&gt;&lt;p&gt;While a dataset is just an entry in the &lt;span style=&quot; font-style:italic;&quot;&gt;t_ili2db_dataset&lt;/span&gt; table, there must be baskets for each entry that can be selected. Usually there exists only one basket per topic and dataset.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Manage baskets of selected dataset</string>
Expand Down
28 changes: 14 additions & 14 deletions docs/background_info/oid_tid_generator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## OID, TID, BID, t_ili_tid, tid... Sorry, what?

Often the models definition requires a cross-system unique identificator. The so called **OID**.
Often the models definition requires a cross-system unique identifier. The so called **OID**.

```
[...]
Expand All @@ -26,7 +26,7 @@ Often the models definition requires a cross-system unique identificator. The so

... those OIDs are written to the column `t_ili_tid`.

... while the `t_id` column contains just a ***schema-internal*** sequence used for foreign keys etc. Those `t_id`s are ***not*** the cross-system unique identificator.
... while the `t_id` column contains just a ***schema-internal*** sequence used for foreign keys etc. Those `t_id`s are ***not*** the cross-system unique identifier.

![oid physical data](../assets/oid_physical_data.png)

Expand All @@ -41,7 +41,7 @@ There are different types of OID domains. In Model Baker we try to set default v
- I32OID
- STANDARDOID
- ANYOID
- User defined OID
- user-defined OID

#### `UUIDOID`

Expand Down Expand Up @@ -74,7 +74,7 @@ It requires an 8 char prefix and 8 char postfix:

- **Postfix (8 chars):** Sequence (numeric or alphanumeric) of your system as *local identification part*

Model Baker does not know what your *global identification part* is and uses a placeholder-prefix `%change%`. It's important that replace this part with your own prefix.
Model Baker does not know what your *global identification part* is and uses a placeholder-prefix `%change%`. It's important that you replace this part with your own prefix.

As *local identification part* Model Baker suggests the counter provided by the `t_id` sequence.

Expand All @@ -88,13 +88,13 @@ In the QGIS Project the default value expression for `t_ili_tid` is therefore th

The `ANYOID` does not define a format of the OID but just that an OID needs to be defined in all the extended models. This domain is only used on topics that need to be extended. This solution has some [limitations](#limitations).

#### User defined OIDs and not defined OIDs
#### User-defined OIDs and not defined OIDs

For user defined OIDs or when OIDs are not defined, Model Baker tries to suggest something reasonable.
For user-defined OIDs or when OIDs are not defined, Model Baker tries to suggest something reasonable.

If there is no definition with OID AS, ili2db assumes TEXT and therefore they need to fulfill the rules of the XML-ID-type. This means the **first character** must be a **letter or underscore**, followed by letters, numbers, dots, minus signs, underscores; no colons (!), see [www.w3.org/TR/REC-xml](http://www.w3.org/TR/REC-xml).
If there is no definition with OID AS, ili2db assumes TEXT and therefore identifiers need to fulfill the rules of the XML-ID-type. This means the **first character** must be a **letter or underscore**, followed by letters, numbers, dots, minus signs, underscores; no colons (!), see [www.w3.org/TR/REC-xml](http://www.w3.org/TR/REC-xml).

In the QGIS Project the default value expression for `t_ili_tid` is therefore this:
In the QGIS Project the default value expression for `t_ili_tid` therefore is:

```
'_' || uuid('WithoutBraces')
Expand All @@ -105,10 +105,10 @@ In the QGIS Project the default value expression for `t_ili_tid` is therefore th
|---|---|
| INTERLIS.UUIDOID | `uuid('WithoutBraces')` |
| INTERLIS.I32OID | `t_id` |
| INTERLIS.STANDARDOID | `'%change%' \|\| lpad( t_id, 8, 0 )` |
| INTERLIS.ANYOID | `'_' \|\| uuid('WithoutBraces')` |
| City_V1.TypeID | `'_' \|\| uuid('WithoutBraces')` |
| not defined | `'_' \|\| uuid('WithoutBraces')` |
| INTERLIS.STANDARDOID | <code>'%change%' &#124;&#124; lpad( t_id, 8, 0 )</code> |
| INTERLIS.ANYOID | <code>'_' &#124;&#124; uuid('WithoutBraces')</code> |
| City_V1.TypeID | <code>'_' &#124;&#124; uuid('WithoutBraces')</code> |
| not defined | <code>'_' &#124;&#124; uuid('WithoutBraces')</code> |

### TID (OID) Manager

Expand All @@ -132,11 +132,11 @@ This solution covers a lot, but not everything.

#### ANYOID

If a class is designed in a topic with an OID definition `ANYOID` and it's extended in multiple other topics with other OID definitions, we cannot say what should be the default value, since it could divert depending in what basket you work.
If a class is part of a topic with an OID definition of `ANYOID` and it's extended in multiple other topics with other OID definitions, we cannot say what should be the default value, since it could divert depending in what basket you work.

#### OIDs on another system

When the OIDs are not UUIDs but e.g. `STANDARDOID`s instead, it's not possible to know in a system, wheter in other systems the same OIDs are generated. This means it's in the responsibility of the user to set the expressions (and the counters) in a way, that they don't conflict with OIDS of object generated some where else.
When the OIDs are not UUIDs but e.g. `STANDARDOID`s instead, it's not possible to know in a system, wheter in other systems the same OIDs are generated. This means it's in the users responsibility to set the expressions (and the counters) in a way that they don't conflict with OIDs of objects generated somewhere else.

#### T_Id conflicts

Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/import_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Then, with a simple click you generate your project. All the toppings received f

### TID (OID) Values

Often the models definition requires cross-system unique identificators. So called OIDs or TIDs, what are represented in the physical database as the `t_ili_tid` column. Find a clear definition and more details about them in the [corresponding chapter](../../background_info/oid_tid_generator).
Often the models definition requires cross-system unique identifiers. So called OIDs or TIDs, what are represented in the physical database as the `t_ili_tid` column. Find a clear definition and more details about them in the [corresponding chapter](../../background_info/oid_tid_generator).

On creating a QGIS Project with Model Baker, there are preset default value expression generated for the `t_ili_tid` field on the attribute form. But often those default value expressions need to be edited by the user (like e.g. the prefix in the `STANDARDOID`).

Expand Down

0 comments on commit 476b03e

Please sign in to comment.