Querying Edge Data in Batches (1.1.6)
Function
This API is used to query the detailed information about edges in batches based on the source vertices, target vertices, and indexes of the edges. Information about edges and properties is returned.
URI
- URI format
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-query
- Parameter description
Table 1 URI parameter description Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details, see Obtaining a Project ID.
graph_name
Yes
String
Graph name
Request
- Request example
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-query { "edges": [{ "source": "39631050_Landscape", "target": "27803870_ Landmark building" },{ "index": "0", "source": "27803870_Landmark building", "target": "27661363_ Beijing Jiuhua Hot Spring" }] }
SERVER_URL: Address for accessing a graph. For details about its value, see Constraints of Using Service Plane APIs.
- Request body parameter description
Table 2 Request body parameter description Parameter
Mandatory
Type
Description
edges
Yes
Json
Edge array to be queried
Table 3 edges parameter description Parameter
Mandatory
Type
Description
source
Yes
String
Source vertex of an edge
target
Yes
String
Target vertex of an edge
index
No
String
Edge index
Response
- Parameter description
Table 4 Parameter description Parameter
Mandatory
Type
Description
errorMessage
No
String
System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error message.
errorCode
No
String
System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error code.
data
No
String
The data field is contained when the query is successful, and the data field contains the edges query result.
- Response example (successful request)
{ "data": { "edges": [ { "index": "24", "source": "39631050_Landscape", "label": "superclassOf", "properties": { "popularity": [ 0 ] }, "target": "27803870_ Landmark building" }, { "index": "0", "source": "27803870_Landmark building", "label": "superclassOf", "properties": { "popularity": [ 0 ] }, "target": "27661363_ Beijing Jiuhua Hot Spring" } ] } } - Response example (failed request)
Http Status Code: 400 { "errorMessage":"parameter does not contain 'source'", "errorCode":"GES.8000" }
Last Article: Updating Edge Properties (1.1.6)
Next Article: Adding Edges in Batches (2.1.16)
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.