Skip to content

Commit

Permalink
Merge pull request #852 from opengisch/metaattrprefix
Browse files Browse the repository at this point in the history
Docu für Extra Meta Attr Prefix
  • Loading branch information
signedav authored Nov 30, 2023
2 parents 5f670ab + 4167ccd commit 80aff1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions docs/background_info/meta_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ VERSION "2017-02-08" =
!!@ topicInformation="Route-Type"
TOPIC TypeOfRouteCatalogue
EXTENDS CatalogueObjects_V1.Catalogues =
!!@ dispExpression="CONCAT(type, ' sometext')"
!!@ qgis.modelbaker.dispExpression="CONCAT(type, ' sometext')"
CLASS TypeOfRoute
EXTENDS CatalogueObjects_V1.Catalogues.Item =
```

`furtherInformation` is referenced to `ExceptionalLoadsCatalogues_V1`, `topicInformation` to `TypeOfRouteCatalogue` and `dispExpression` to `TypeOfRoute`.
`furtherInformation` is referenced to `ExceptionalLoadsCatalogues_V1`, `topicInformation` to `TypeOfRouteCatalogue` and `qgis.modelbaker.dispExpression` to `TypeOfRoute`.

For more complex usage see the [INTERLIS 2-Metamodell](https://www.interlis.ch/download/interlis2/ili23-metamodel_2008-08-29_d.pdf)

### Meta Attributes in the Database

When importing the data from the INTERLIS file to the DB, with ili2db integrated in the Model Baker, the meta attributes are stored in the table **t_ili2db_meta_attrs**:

| ilielement | attr_name | attr_value |
|----------------------------------------------------------------|--------------------|-----------------------------|
| ExceptionalLoadsCatalogues_V1 | furtherInformation | https://www.astra.admin.ch/ |
| ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue | topicInformation | Route-Type |
| ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue.TypeOfRoute | dispExpression | CONCAT(type, ' sometext') |
| ilielement | attr_name | attr_value |
|----------------------------------------------------------------|--------------------------------|-----------------------------|
| ExceptionalLoadsCatalogues_V1 | furtherInformation | https://www.astra.admin.ch/ |
| ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue | topicInformation | Route-Type |
| ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue.TypeOfRoute | qgis.modelbaker.dispExpression | CONCAT(type, ' sometext') |

## Model Baker Specific Meta Attributes

Some additional non standard meta attributes are understood by the Model Baker as properties in the QGIS project.

### List of specific Attributes

- **dispExpression**
- **qgis.modelbaker.dispExpression**
Used as the display expression for a layer. The display expression is the *name* that is used to identify a feature by text. One of the places where this is used is the combobox that is shown for a Relation Reference Widget on feature forms. ![relation reference](../assets/meta_attributes_relation_reference.png)


Expand All @@ -77,12 +77,12 @@ ExceptionalLoadsRoute.ini:

```ini
["ExceptionalLoadsRoute.TypeOfRouteCatalogue.TypeOfRoute"]
dispExpression="type"
qgis.modelbaker.dispExpression="type"
```
Or using a more complex expression:
```ini
["ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue.TypeOfRoute"]
dispExpression="CONCAT(type, ' sometext')"
qgis.modelbaker.dispExpression="CONCAT(type, ' sometext')"
```

The keys that need to be used for the INI sections are the *fully qualified INTERLIS names* of the objects. In the example above this is `["ExceptionalLoadsCatalogues_V1.TypeOfRouteCatalogue.TypeOfRoute"]`. A list of all available names can be found in the database table `t_ili2db_classname` after doing a schema import.
Expand All @@ -91,7 +91,7 @@ The keys that need to be used for the INI sections are the *fully qualified INTE

The above example would be written as follows directly in an INTERLIS file (ExceptionalLoadsRoute.ili). If the above configuration is in the ini file, the ili meta attribute is no longer required, this is only here for reference.
```
!!@dispExpression="type"
!!@qgis.modelbaker.dispExpression="type"
CLASS TypeOfRoute=
type: MANDATORY TEXT*25;
END TypeOfRoute;
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 @@ -96,7 +96,7 @@ If this option is activated, circular arcs are stroked when importing the data.
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 `dispExpression`) instead of having them directly in the `ili` 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.

## Run ili2db Sessions

Expand Down

0 comments on commit 80aff1f

Please sign in to comment.