Updating Edge Properties
Function
This API is used to update edge property values. The operations include ADD, UPDATE, and DEL.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?action_id={actionId}&source={sourceVertex}&target={targetVertex}&index={index}
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 |
actionId |
Yes |
String |
Operator. Possible values:
|
sourceVertex |
Yes |
String |
Source vertex of an edge |
targetVertex |
Yes |
String |
Target vertex of an edge |
index |
No |
Integer |
Edge index. If this parameter is not set, properties of the first edge between the vertices will be modified. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
properties |
Yes |
Object |
Value of each property |
targetProperties |
No |
Array |
Properties used to determine duplicate edges.
For details about the property elements, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
label |
Yes |
String |
Label name. The label of duplicate edges is determined by the property. |
properties |
Yes |
Array |
Value of each property. The property list of duplicate edges is determined by the property. Currently, only a single property is supported. If multiple properties are entered, the first property is used. |
Example Request
Update the property value of an edge. The value of property Rating is 7, the value of property Datetime is 2020-12-27 23:44:41, and the label name is rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?action_id=update&source=Lily&target=Tom&index=1 { "properties": { "Rating": ["7"], "Datetime":["2020-12-27 23:44:41"] }, "targetProperties": [ { "label": "rate", "properties": [ "Rating" ] } ] }
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service Plane APIs.
Response Parameters
Parameter |
Type |
Description |
---|---|---|
errorMessage |
String |
System prompt.
|
errorCode |
String |
System prompt code.
|
result |
String |
Request result. If the request is successful, the value is success. If the request fails, the value is failed. |
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200 { "result": "success" }
Status code: 400
Http Status Code: 400 { "errorMessage": "edge [Lily-Tom-1] does not exist", "errorCode": "GES.8221" }
Status Code
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 Code
See Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.