Query semantic entries

Lists semantic entries in the knowledge base in pages.

HTTP
GET $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/entries

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the knowledge base list to obtain the knowledge base ID. Prepare a personal access token and target workspace ID that can access the target workspace.

Request body

Replace $MODEL_ID, $CLOUDSIGMA_API_KEY, $WORKSPACE_ID in the example with actual values.

Shell
curl "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/entries?kind=metric&page_size=20" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

model_id

integer

Yes

knowledge base ID.

Query parameters

Parameter

Type

Required

Description

page_size

integer

No

The number of items on a single page, ranging from 1 to 100. When not transmitted, it is 20.

page_token

string

No

next_page_token from the previous page response.

domain

string

No

semantic domain.

kind

string

No

Entry type.

Request body

domain supports nl2sql and rag. When creating and updating, omit domain and default to nl2sql. You can filter by domain when querying the list.

  • nl2sql supports the 8 entries listed in the following table.

  • rag only supports business_rule and standard_qa.

  • standard_qa Fill in a single read-only SQL in nl2sql, and fill in answer in rag.

domain in the response is the domain to which the entry actually belongs.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "id": 501,
        "domain": "nl2sql",
        "kind": "metric",
        "key": "total_rows",
        "tables": [
          "orders"
        ],
        "spec": {
          "name": "GMV",
          "metric_type": "aggregate",
          "aggregation": "SUM",
          "field": "amount"
        },
        "created_at": 1735632000,
        "updated_at": 1735632000
      }
    ],
    "total": 1,
    "next_page_token": ""
  }
}

Field

Type

Description

data.items

array of object

The semantic entry for the current page.

data.items[].id

integer

logo.

data.items[].domain

string

The actual semantic domain of the entry. Value: nl2sql, rag.

data.items[].kind

string

category. Values: metric, table_description, field_description, business_rule, constraint, relationship, standard_qa, dynamic_query.

data.items[].key

string

Key.

data.items[].tables

array of string

Table reference.

data.items[].spec

object

The type corresponds to the configuration.

data.items[].sql_preview

string

SQL preview.

data.items[].created_at

integer

Creation time.

data.items[].updated_at

integer

Update time.

data.total

integer

The total number of entries matching the filter criteria.

data.next_page_token

string

Next page token. When empty there is no next page.

Indicator configuration

Field

Type

Description

name

string

Name.

synonyms

array of string or null

Synonyms.

description

string

Description.

source_table

string

Source table.

metric_type

string

Indicator type.

aggregation

string

Aggregation functions.

field

string

field.

filter

object or null

Filter tree.

filter.type

string

type.

filter.op

string

Conditional connection method.

filter.children

array of object or null

sub-condition.

filter.field

string

field.

filter.operator

string

Comparison operators.

filter.value

any

Value.

multiplier

number

Multiplier.

formula

object or null

Formula tree.

formula.type

string

type.

formula.key

string

Key.

formula.value

number or null

Value.

formula.left

object or null

left operand.

formula.right

object or null

Right operand.

filter tree

children is an array of nodes with the same structure. Fill in recursively according to the field definitions in this section.

Field

Type

Description

type

string

type.

op

string

Conditional connection method.

children

array of object or null

sub-condition.

field

string

field.

operator

string

Comparison operators.

value

any

Value.

formula tree

left and right are formula nodes with the same structure. Fill in recursively according to the field definitions in this section.

Field

Type

Description

type

string

type.

key

string

Key.

value

number or null

Value.

left

object or null

left operand.

right

object or null

Right operand.

Table description configuration

Field

Type

Description

table

string

Table name.

description

string

Description.

synonyms

array of string or null

Synonyms.

Field description configuration

Field

Type

Description

table

string

Table name.

column

string

Column name.

description

string

Description.

synonyms

array of string or null

Synonyms.

nl2sql_enabled

boolean or null

Whether to enable natural language conversion to SQL.

Business rules configuration

Field

Type

Description

rule

string

Business rules.

files

array of string or null

File configuration.

migration_status

string

Migration status.

constraint configuration

Field

Type

Description

filter

object

Filter tree.

filter.type

string

type.

filter.op

string

Conditional connection method.

filter.children

array of object or null

sub-condition.

filter.field

string

field.

filter.operator

string

Comparison operators.

filter.value

any

Value.

description

string

Description.

Table association configuration

Field

Type

Description

left_table

string

Table left.

right_table

string

Right table.

join_type

string

Connection type.

conditions

array of object or null

Connection conditions.

conditions[].operator

string

Comparison operators.

conditions[].left

string

left operand.

conditions[].right

string

Right operand.

description

string

Description.

Connection conditions

Field

Type

Description

operator

string

Comparison operators.

left

string

left operand.

right

string

Right operand.

Standard Q&A configuration

Field

Type

Description

question

string

question.

similar_questions

array of string or null

Similar questions.

sql

string

SQL text.

answer

string

answer.

usage_mode

string

Usage.

files

array of string or null

File configuration.

description

string

Description.

synonyms

array of string or null

Synonyms.

Dynamic query configuration

Field

Type

Description

query_key

string

Query key.

sql

string

SQL text.

description

string

Description.

handling

string

processing method.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "page_size is invalid",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

null on error.

Last updated on