Complete the relationship between historical data sources¶
A knowledge base created by an older version of the process might already have content available, but lack the records to manage the data sources. The “historical data source relationship” here is the association record between the knowledge base, its original files or data tables, and processing tasks; only after completion can the data source list, processing status, and subsequent governance operations identify these old data.
This operation only adds management records and does not re-upload or re-import the original data. Called only when query data source list returns legacy_backfill_required: true; routine calls are not required for newly created knowledge bases.
POST https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}/sources/backfill-legacy
Preparation before calling¶
First query the data source list, and confirm that legacy_backfill_required in the response is true. Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$MODEL_ID: The knowledge base ID to complete the historical source relationship.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID/sources/backfill-legacy" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
integer |
The ID of the knowledge base to complete the historical source relationship. |
Successful response¶
Returns 200 on success. After completion, query the data source list again to confirm the legacy_backfill_required status.
{
"code": "OK",
"msg": "OK",
"data": {
"updated": true
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
boolean |
|
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 permission to update the source. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible. |
Reconfirm |
|
|
The service failed to patch up the old source relationship. |
Keep the desensitized response information and try again. |
Follow-up operations¶
Query data source list Confirm the completed results.