Export semantic entries¶
Export knowledge base definitions and semantic entries for review or migration.
GET $CLOUDSIGMA_API_BASE/semantic-models/{model_id}/export
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query the knowledge base list to obtain the knowledge base ID.
Set the operation-specific values used in the request:
$MODEL_ID: The knowledge base ID of the definition to be exported.
Request¶
curl "$CLOUDSIGMA_API_BASE/semantic-models/$MODEL_ID/export" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameters |
Type |
Description |
|---|---|---|
|
integer |
The knowledge base ID of the definition to be exported. |
Successful response¶
Returns 200 on success. Before migrating, export the current state and confirm that the import target has no semantic entries.
{
"code": "OK",
"msg": "OK",
"data": {
"model": {
"id": 401,
"name": "product_docs",
"source_counts": {
"files": 2,
"tables": 1,
"total": 3
}
},
"entries": [
{
"id": 501,
"kind": "metric",
"key": "total_rows",
"tables": ["orders"],
"spec": {
"expr": "COUNT(*)"
}
}
]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Knowledge base definition. |
|
integer |
Knowledge base ID. |
|
string |
Knowledge base name. |
|
object |
Source quantity statistics. |
|
object[] |
The semantic entry in the current knowledge base. |
|
integer |
Entry ID. |
|
string |
Entry type. |
|
string |
Stable reference key. |
|
array[string] |
Association table name; may be omitted if not set. |
|
object |
Type-specific configuration object corresponding to |
In field paths, [] means each item in an array. For example, data.entries[].id is the id field of each item in data.entries.
Error response¶
{
"code": "ErrNotFound",
"msg": "resource not found",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the knowledge base ID from the response. |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have read permission. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible. |
Reconfirm |
|
|
The service failed to export the definition. |
Keep the desensitized response information and try again. |
Follow-up operations¶
Before migrating or batch writing, use the export results to compare the target knowledge base without semantic entries, and then Import semantic entries.