Query semantic entries¶
Lists semantic entries in the knowledge base in pages.
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.
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 |
|---|---|---|---|
|
integer |
Yes |
knowledge base ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
The number of items on a single page, ranging from |
|
string |
No |
|
|
string |
No |
semantic domain. |
|
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.
nl2sqlsupports the 8 entries listed in the following table.ragonly supportsbusiness_ruleandstandard_qa.standard_qaFill in a single read-only SQL innl2sql, and fill inanswerinrag.
domain in the response is the domain to which the entry actually belongs.
Successful response¶
{
"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 |
|---|---|---|
|
array of object |
The semantic entry for the current page. |
|
integer |
logo. |
|
string |
The actual semantic domain of the entry. Value: |
|
string |
category. Values: |
|
string |
Key. |
|
array of string |
Table reference. |
|
object |
The type corresponds to the configuration. |
|
string |
SQL preview. |
|
integer |
Creation time. |
|
integer |
Update time. |
|
integer |
The total number of entries matching the filter criteria. |
|
string |
Next page token. When empty there is no next page. |
Indicator configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Name. |
|
array of string or null |
Synonyms. |
|
string |
Description. |
|
string |
Source table. |
|
string |
Indicator type. |
|
string |
Aggregation functions. |
|
string |
field. |
|
object or null |
Filter tree. |
|
string |
type. |
|
string |
Conditional connection method. |
|
array of object or null |
sub-condition. |
|
string |
field. |
|
string |
Comparison operators. |
|
any |
Value. |
|
number |
Multiplier. |
|
object or null |
Formula tree. |
|
string |
type. |
|
string |
Key. |
|
number or null |
Value. |
|
object or null |
left operand. |
|
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 |
|---|---|---|
|
string |
type. |
|
string |
Conditional connection method. |
|
array of object or null |
sub-condition. |
|
string |
field. |
|
string |
Comparison operators. |
|
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 |
|---|---|---|
|
string |
type. |
|
string |
Key. |
|
number or null |
Value. |
|
object or null |
left operand. |
|
object or null |
Right operand. |
Table description configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Table name. |
|
string |
Description. |
|
array of string or null |
Synonyms. |
Field description configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Table name. |
|
string |
Column name. |
|
string |
Description. |
|
array of string or null |
Synonyms. |
|
boolean or null |
Whether to enable natural language conversion to SQL. |
Business rules configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Business rules. |
|
array of string or null |
File configuration. |
|
string |
Migration status. |
constraint configuration
Field |
Type |
Description |
|---|---|---|
|
object |
Filter tree. |
|
string |
type. |
|
string |
Conditional connection method. |
|
array of object or null |
sub-condition. |
|
string |
field. |
|
string |
Comparison operators. |
|
any |
Value. |
|
string |
Description. |
Table association configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Table left. |
|
string |
Right table. |
|
string |
Connection type. |
|
array of object or null |
Connection conditions. |
|
string |
Comparison operators. |
|
string |
left operand. |
|
string |
Right operand. |
|
string |
Description. |
Connection conditions
Field |
Type |
Description |
|---|---|---|
|
string |
Comparison operators. |
|
string |
left operand. |
|
string |
Right operand. |
Standard Q&A configuration
Field |
Type |
Description |
|---|---|---|
|
string |
question. |
|
array of string or null |
Similar questions. |
|
string |
SQL text. |
|
string |
answer. |
|
string |
Usage. |
|
array of string or null |
File configuration. |
|
string |
Description. |
|
array of string or null |
Synonyms. |
Dynamic query configuration
Field |
Type |
Description |
|---|---|---|
|
string |
Query key. |
|
string |
SQL text. |
|
string |
Description. |
|
string |
processing method. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "page_size is invalid",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
|