Skip to content

Data Model Tools

Data model tools manage tables, columns, and relationships in the semantic layer of a session asset.


Tables

get_tables

Returns all tables in the session's OpenBI asset.

Parameters

Name Type Required Description
session_id string Session id from create_session

Response

{
  "tables": [
    {
      "id": "table-001",
      "name": "Sales",
      "type": "Table",
      "expression": null
    }
  ]
}

get_table

Returns a single table by ID, including all its columns.

Parameters

Name Type Required Description
session_id string Session id from create_session
table_id string Table id from get_tables

Response

Full Table object with the columns array populated.


create_table

Creates a new table in the session's OpenBI asset. Returns the generated table id.

Parameters

Name Type Required Description
session_id string Session id from create_session
assetId string Asset id from list_assets
name string Table display name
type string "Table" (default) or "Object"
source_expression string Native query or expression that defines this table
expression_language string Language of the expression (e.g. "M", "SQL")
expression_type string Expression type hint

Response

{
  "status": "Success",
  "tableId": "table-guid"
}

update_table

Updates a table. Omit optional fields to leave them unchanged; pass empty string to clear nullable string fields.

Parameters

Name Type Required Description
session_id string Session id from create_session
asset_id string Asset id
id_table string Table id
name string New display name
type string New type ("Table" or "Object")
source_expression string New source expression
expression_language string New expression language
expression_type string New expression type

Response

{ "status": "Success" }

delete_table

Deletes a table and all its columns (cascade delete).

Parameters

Name Type Required Description
session_id string Session id from create_session
table_id string Table id

Response

{ "status": "Success" }

Columns

get_columns

Returns all columns (and measures) for a given table.

Parameters

Name Type Required Description
session_id string Session id from create_session
table_id string Parent table id

Response

{
  "columns": [
    {
      "id": "col-001",
      "name": "Region",
      "dataType": "String",
      "isDimension": true,
      "isMeasure": false,
      "expression": null
    }
  ]
}

get_column

Returns a single column by ID.

Parameters

Name Type Required Description
session_id string Session id from create_session
column_id string Column id from get_columns

create_column

Creates a new column or measure in a table. Returns the generated column id.

Parameters

Name Type Required Description
session_id string Session id from create_session
table_id string Parent table id
name string Column display name
data_type string String, Integer, Decimal, Date, Timestamp, Time, Boolean, or Unknown
type string Column kind (e.g. "data", "calculated", "measure")
description string Optional description
expression string Formula for calculated columns/measures
expression_language string Language (e.g. "DAX", "MDX", "SQL")
expression_type string Expression type hint
is_dimension bool Dimension flag (defaults to false)
is_measure bool Measure flag (defaults to false)

Response

{
  "status": "Success",
  "columnId": "col-guid"
}

update_column

Updates a column. Null optional fields leave values unchanged; empty string clears nullable strings.

Parameters

Name Type Required Description
session_id string Session id from create_session
asset_id string Asset id (for scoping via parent table)
id_column string Column id
name string New display name
data_type string New data type
type string New column kind
description string New description
expression string New formula
expression_language string New formula language
expression_type string New expression type
is_dimension bool New dimension flag
is_measure bool New measure flag

Response

{ "status": "Success" }

delete_column

Deletes a column by ID.

Parameters

Name Type Required Description
session_id string Session id from create_session
column_id string Column id

Response

{ "status": "Success" }

Relationships

get_relationships

Returns all relationships in the session's OpenBI asset.

Parameters

Name Type Required Description
session_id string Session id from create_session

Response

{
  "relationships": [
    {
      "rowId": 1,
      "relationship": {
        "name": null,
        "idColumnFrom": "col-from-guid",
        "idColumnTo": "col-to-guid",
        "type": "ManyToOne"
      }
    }
  ]
}

get_relationship

Returns a single relationship by its row ID.

Parameters

Name Type Required Description
session_id string Session id from create_session
relationship_id int Relationship row ID (integer)

create_relationship

Creates a new relationship between two columns.

Parameters

Name Type Required Description
session_id string Session id from create_session
id_column_from string Source column id (the "many" side)
id_column_to string Target column id (the "one" side)
relationship_type string OneToMany, ManyToOne, ManyToMany, or OneToOne
name string Optional relationship name

Response

{
  "status": "Success",
  "relationshipId": 7
}

delete_relationship

Deletes a relationship by its row ID.

Parameters

Name Type Required Description
session_id string Session id from create_session
relationship_id int Relationship row ID

Response

{ "status": "Success" }