Update semantic entries¶
Updates a semantic entry with the complete entry definition.
PUT $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/entries/{entry_id}
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 semantic entry list to read the original entry and obtain the entry ID and existing definition to avoid missing existing fields. Prepare a personal access token and target workspace ID that can access the target workspace.
Request body¶
Replace $MODEL_ID, $ENTRY_ID, $CLOUDSIGMA_API_KEY, $WORKSPACE_ID in the example with actual values.
curl -X PUT "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/entries/$ENTRY_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"kind": "metric",
"key": "total_rows",
"spec": {
"name": "GMV",
"metric_type": "aggregate",
"aggregation": "SUM",
"field": "amount",
"source_table": "orders"
},
"tables": [
"orders"
]
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
knowledge base ID. |
|
integer |
Yes |
The ID of the semantic entry to update. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
semantic domain. When creating and updating, omitting this field defaults to |
|
string |
Yes |
The entry type determines the structure of |
|
string |
Yes |
The entry’s reference key. Cannot be empty. |
|
array of string or null |
No |
Association table name. Resubmit when needed. |
|
object |
Yes |
Fill in the configuration listed in this section according to |
|
string |
Yes |
Name. |
|
array of string or null |
No |
Synonyms. |
|
string |
No |
Description. |
|
string |
No |
Source table. |
|
string |
Yes |
Indicator type. |
|
string |
No |
Aggregation functions. |
|
string |
No |
field. |
|
object or null |
No |
Filter tree. |
|
string |
No |
type. |
|
string |
No |
Conditional connection method. |
|
array of object or null |
No |
sub-condition. |
|
string |
No |
field. |
|
string |
No |
Comparison operators. |
|
any |
No |
Value. |
|
number |
No |
Multiplier. |
|
object or null |
No |
Formula tree. |
|
string |
No |
type. |
|
string |
No |
Key. |
|
number or null |
No |
Value. |
|
object or null |
No |
left operand. |
|
object or null |
No |
Right operand. |
|
string |
No |
type. |
|
string |
No |
Conditional connection method. |
|
array of object or null |
No |
sub-condition. |
|
string |
No |
Comparison operators. |
|
any |
No |
Value. |
|
string |
No |
Key. |
|
number or null |
No |
Value. |
|
object or null |
No |
left operand. |
|
object or null |
No |
Right operand. |
|
string |
No |
Table name. |
|
string |
Yes |
Description. |
|
string |
Yes |
Column name. |
|
boolean or null |
No |
Whether to enable natural language conversion to SQL. |
|
string |
Yes |
Business rules. |
|
array of string or null |
No |
File configuration. |
|
string |
No |
Migration status. |
|
object |
Yes |
Filter tree. |
|
string |
Yes |
Table left. |
|
string |
Yes |
Right table. |
|
string |
No |
Connection type. |
|
array of object or null |
No |
Connection conditions. |
|
string |
No |
Comparison operators. |
|
string |
No |
left operand. |
|
string |
No |
Right operand. |
|
string |
No |
left operand. |
|
string |
No |
Right operand. |
|
string |
Yes |
question. |
|
array of string or null |
No |
Similar questions. |
|
string |
No |
SQL text. |
|
string |
No |
answer. |
|
string |
No |
Usage. |
|
string |
No |
Query key. |
|
string |
Yes |
SQL text. |
|
string |
No |
processing method. |
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.
Updates will completely replace the original entry. When modifying domain or kind, resubmit key, tables and spec and meet the verification rules of the target domain. The updated set of entries must also pass validation.
children is an array of nodes with the same structure. Fill in recursively according to the field definitions in this section.
left and right are formula nodes with the same structure. Fill in recursively according to the field definitions in this section.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"updated": true
}
}
Field |
Type |
Description |
|---|---|---|
|
boolean |
Remove mark or quantity. |
|
boolean |
|
Error response¶
{
"code": "ErrNotFound",
"msg": "resource not found",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
|