lhc semantic descriptions
Manage semantic descriptions for datasources and custom models.
Commands
| Command | Description |
|---|---|
lhc semantic descriptions list --datasource <id> | List descriptions for a datasource |
lhc semantic descriptions list --model <id> | List descriptions for a model |
lhc semantic descriptions get <id> | Get a description by ID |
lhc semantic descriptions update <id> --description <text> | Update a description |
lhc semantic descriptions delete <id> | Delete a single description, e.g. a stale one left behind for a table that no longer exists |
lhc semantic descriptions refresh --datasource <id> | Refresh descriptions for a datasource |
lhc semantic descriptions refresh --all | Refresh descriptions for all datasources |
lhc semantic descriptions columns set <description-id> <column> | Declare the measure semantics of one column (marks it as manually curated) |
lhc semantic descriptions columns suggest --datasource <id> | --model <id> | Suggest measure candidates for undeclared columns, as a dry run |
lhc semantic descriptions columns key-role set <description-id> <column> <primary_key|identifier|none> | Curate a source-table column's key role |
lhc semantic descriptions columns key-role clear <description-id> <column> | Withdraw the curation; the role is derived from the data again |
lhc semantic descriptions measures set <description-id> --name <name> --expression <expr> | Add or replace one derived measure, matched by --name |
lhc semantic descriptions measures remove <description-id> --name <name> | Remove one derived measure by name |
lhc semantic descriptions measures clear <description-id> | Remove all derived measures |
Flags
| Flag | Description |
|---|---|
--datasource <id> | Target datasource ID |
--model <id> | Target model ID (for list) |
--description <text> | Description text (required for update) |
--all | Refresh all datasources (for refresh, mutually exclusive with --datasource) |
columns set
| Flag | Description |
|---|---|
--role <role> | Semantic role: measure, dimension, identifier, temporal, status |
--aggregation <agg> | Default aggregation: sum, avg, count, count_distinct, min, max, none |
--unit <unit> | Unit, e.g. EUR, %, pcs |
--display-name <name> | Business name shown to users |
--synonyms <list> | Comma-separated business synonyms (replaces the list) |
At least one of these flags must be set. --role is a no-op for columns the automatic annotator already classified as identifier or temporal. Pass an empty value (e.g. --unit "", --display-name "") to clear a field back to unset.
lhc semantic descriptions columns set 7402 sales_amount --role measure --aggregation sum --unit EUR \
--display-name "Umsatz" --synonyms "Umsatz,Erlös,Revenue"
columns suggest
| Flag | Description |
|---|---|
--datasource <id> | Suggest against a datasource's own tables (the durable choice — declarations here are carried up into model/star views on the next model rebuild) |
--model <id> | Suggest against a custom model's views (takes effect immediately, no rebuild needed; the only option for imported models with no datasource) |
--table <name> | Restrict to one table |
--llm | Refine the name-pattern heuristic with an LLM pass over the candidate columns (adds latency and cost; refines aggregation choice and unit) |
--apply | Write the suggestions instead of only listing them |
Exactly one of --datasource/--model is required. Without --apply, this is always a dry run — nothing is written. Already-declared columns are never suggested or overwritten, so a second --apply run is a no-op.
The default (no --llm) pass is a deterministic name-pattern heuristic over undeclared numeric, non-key columns — free and fast, but it cannot infer a unit that isn't already present in the column name or its description. --apply stamps written columns with measure_source=llm (not manual), so a later manual correction or a fresh extraction can still override them; the manual provenance stays reserved for a human decision made through the Measure Editor or columns set.
# Dry run against a datasource's tables
lhc semantic descriptions columns suggest --datasource 2235
# Dry run against a model, one table, with the LLM refinement pass
lhc semantic descriptions columns suggest --model awdw --table star_internet_sales --llm
# Write the suggestions
lhc semantic descriptions columns suggest --datasource 2235 --apply
Suggesting and applying on the datasource level is the durable choice: it survives a model rebuild and reaches every model built on that datasource, but the new declarations only reach chart-building context after the affected model is rebuilt (lhc semantic update model). Suggesting on the model level takes effect immediately, but is overwritten by the next rebuild unless later promoted to manual.
columns key-role set / clear
Curate whether a column of a datasource's source table is a primary key, an identifier, or no key at all.
| Value | Meaning |
|---|---|
primary_key | The column is the table's primary key |
identifier | The column identifies a record but is not the primary key |
none | The column is not a key — this also stops name-based guesses (customer_id is then no key) |
lhc semantic descriptions columns key-role set 16328 c22 primary_key
lhc semantic descriptions columns key-role set 16328 c23 none
lhc semantic descriptions columns key-role clear 16328 c22
A curated role survives re-extraction. Only a role the source database itself declares outranks it — curating such
a column is refused with a 409 error. Views inherit the role after the next semantic update and model update.
Foreign keys are not curated on the column but on the relationship: see
datasources relationships confirm.
measures set / remove / clear
| Flag | Description |
|---|---|
--name <name> | Measure name (required for set and remove) |
--expression <expr> | Aggregated SQL expression over the description's columns, e.g. SUM(extended_amount) - SUM(total_product_cost) (required for set) |
--unit <unit> | Unit, e.g. EUR, % |
--description <text> | Short business description |
--synonyms <list> | Comma-separated business synonyms |
measures set/remove/clear operate on the description's full derived-measures list — set replaces the entry matching --name (or appends it if none matches), remove deletes the one matching --name, clear empties the list.
lhc semantic descriptions measures set 7402 --name gross_margin \
--expression "SUM(extended_amount) - SUM(total_product_cost)" --unit EUR --synonyms "Rohertrag,Marge"