Incrementally Importing Data to Graphs (2.1.14)
Function
This API is used to import data to graphs incrementally.
To prevent failures in restoring the imported graph data during system restarting, do not delete the data stored on OBS when the graph is in use.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
graph_id |
Yes |
String |
Graph ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action_id |
Yes |
String |
Graph action ID Set this parameter to the enumeration value import-graph, which means the incremental data will be imported to the target graph. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It is used to obtain the permission to call APIs. For details about how to obtain the token, see Authentication. The value of X-Subject-Token in the response header is the token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
edgesetPath |
No |
String |
Edge file directory or name |
edgesetFormat |
No |
String |
Format of the edge data set. Currently, only the CSV format is supported. The CSV format is used by default. |
vertexsetPath |
No |
String |
Vertex file directory or name |
vertexsetFormat |
No |
String |
Format of the vertex data set. Currently, only the CSV format is supported. The CSV format is used by default. |
schemaPath |
No |
String |
Path for storing the metadata file of the new data. |
logDir |
No |
String |
Directory for storing logs of imported graphs. This directory stores the data that fails to be imported during graph creation and detailed error causes. |
parallelEdge |
No |
Object |
Repetitive edge processing This parameter is not available for database edition graphs. |
action |
No |
String |
Processing mode of repetitive edges. The value can be allow, ignore, or override. The default value is allow.
This parameter is not available for database edition graphs. |
ignoreLabel |
No |
Boolean |
Whether to ignore labels on repetitive edges. The value can be true or false. The default value is true.
This parameter is not available for database edition graphs. |
targetProperties |
No |
Array |
List of properties used to determine repetitive edges. If this parameter is specified, ignoreLabel is set to false to define repetitive edges that contain properties in the list specified by this parameter. (This parameter is mandatory only when action is set to override.)
NOTE:
|
delimiter |
No |
String |
Field separator in a CSV file. The default value is comma (,). The default element separator in a field of the list/set type is semicolon (;). |
trimQuote |
No |
String |
Field quote character in a CSV file. The default value is double quotation marks ("). It is used to enclose a field if the field contains separators or line breaks. |
offline |
No |
Boolean |
Whether offline import is selected. The value can be true or false. The default value is false.
|
- For details about the value validity of the edgesetPath, vertexsetPath, schemaPath, and logDir character strings, see the OBS Object Name Restrictions.
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
errorMessage |
String |
System prompt.
|
errorCode |
String |
System prompt.
|
jobId |
String |
Indicates the ID of an asynchronous job.
NOTE:
You can view the job execution status and obtain the return result by querying the job ID. For details, see Job Management APIs. |
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=import-graph { "edgesetPath": "testbucket/demo_movie/edges/", "edgesetFormat": "csv", "vertexsetPath": "testbucket/demo_movie/vertices/", "vertexsetFormat": "csv", "schemaPath": "testbucket/demo_movie/incremental_data_schema.xml", "logDir": "testbucket/importlogdir", "parallelEdge": { "action":"override", "ignoreLabel":true }, "delimiter": ",", "trimQuote": "\"", "offline": true }
Example Response
Status code: 200
OK
{ "jobId" : "b4f2e9a0-0439-4edd-a3ad-199bb523b613" }
Status code: 400
Bad Request
{ "errorMessage" : "parameter format error", "errorCode" : "GES.8013" }
Status Code
Status Code |
Description |
---|---|
200 |
Request sent. |
400 |
Request error. |
401 |
Authentication failed. |
403 |
No operation permission. |
404 |
No resources found. |
500 |
Internal service error. |
503 |
Service unavailable. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot