Updating Specified Properties of Vertices and Edges by Importing a File (2.2.13)
Function
This API is used to update specified properties of vertices and edges by importing a file.
To prevent failures in restoring the updated graph data during system restarting, do not delete the data stored on OBS when the graph is in use.
URI
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_name |
Yes |
String |
Graph name |
Example Request
Import a file to update specified properties of vertices and edges. The vertex file directory is datasets/movie/movie.csv, and the vertex data set format is CSV. The edge file directory is datasets/movie/ranking_edge.csv, and the edge data set format is CSV.
POST http://Endpoint/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-properties { "vertexsetPath": "datasets/movie/movie.csv", "vertexsetFormat": "csv", "vertexProperties": [ { "label": "movie", "properties": [ "genres" ] } ], "edgesetPath": "datasets/movie/ranking_edge.csv", "edgesetFormat": "csv", "edgeProperties": [ { "label": "rate", "properties": [ "Datetime" ] } ], "targetProperties": [ { "label": "rate", "properties": [ "Rating" ] } ], "delimiter": ",", "trimQuote": "\"", "obsParameters": { "accessKey": "XXXXXXX", "secretKey": "XXXXXXX" }, "vertexFileContainLabel": true }
Request Parameters
The format of the CSV file for updating properties is as follows:
- Vertex file (including label): vertex ID,label,property_1...property_n
- Vertex file (excluding label): vertex ID,property_1...property_n
- Edge file: source vertex ID, target vertex ID, label, edge ID, property_1...property_n
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vertexsetPath |
Either vertexsetPath or edgesetPath is mandatory. |
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. |
vertexProperties |
Mandatory if vertexsetPath exists |
Object |
Label of a vertex and list of properties to be updated in a vertex file, in JSONArray format For details, see Table 3. |
edgesetPath |
Either vertexsetPath or edgesetPath is mandatory. |
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. |
edgeProperties |
Mandatory if edgesetPath exists |
Object |
Label of an edge and list of properties to be updated in an edge file, in JSONArray format For details, see Table 4. |
targetProperties |
Mandatory if edgesetPath exists |
Object |
Indicates property information used to distinguish duplicate edges in the edge file, in JSONArray format. For details, see Table 5. |
delimiter |
No |
Character |
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 |
Character |
Field quote character in a CSV file. The default value is double quotation marks ("). They are used to enclose a field if the field contains separators or line breaks. |
obsParameters |
Yes |
String |
OBS authentication parameters. For details, see Table 6. |
vertexFileContainLabel |
No |
Boolean |
Whether the vertex file contains label information. This parameter is optional. The default value is true. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
label |
Yes |
String |
Name of a label |
properties |
Yes |
Object |
Properties to be updated, in JSONArray format. The sequence of the properties must be the same as that in the vertex file. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
label |
Yes |
String |
Name of a label |
properties |
Yes |
Object |
Properties to be updated, in JSONArray format. The sequence of the properties must be the same as that in the edge file. |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
errorMessage |
String |
System prompt.
|
errorCode |
String |
System prompt code.
|
jobId |
String |
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 Response
Status code: 200
Http Status Code: 200 { "jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613" }
Status code: 400
Example response for a failed request
Http Status Code: 400 { "errorMessage": "parameter format error", "errorCode": "GES.8013" }
Status Codes
Return Value |
Description |
---|---|
400 Bad Request |
Request error. |
401 Unauthorized |
Authorization failed. |
403 Forbidden |
No operation permissions. |
404 Not Found |
No resources found. |
500 Internal Server Error |
Internal server error. |
503 Service Unavailable |
Service unavailable. |
Error Codes
See Error Codes.
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