Querying Path Details
Function
This API is used to query the path details. All possible paths will be listed.
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
Query path details. The paths to be queried are Ray, Lethal Weapon, and Alice. Do not set the query direction.
post http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/paths/action?action_id=query-detail
{
"paths":[
[
"Ray",
"Lethal Weapon",
"Alice"
]
],
"directed":false
}
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service Plane APIs.
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| paths | Yes | List | Set of paths to be queried |
| directed | No | Boolean | Whether the querying path is directional or non-directional: true: directional false: non-directional default=false |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| errorMessage | String | System prompt.
|
| errorCode | String | System prompt.
|
| data | Object | Query results. This parameter is left blank when the query fails. |
| Parameter | Type | Description |
|---|---|---|
| outputs | Object | Query results containing the paths |
| paths | List | Collection of paths that contain detailed vertex and edge information, in JSONArray format NOTE: In the returned paths:
|
Example Response
Status code: 200
Http Status Code: 200
{
"data": {
"outputs":{
"paths":[
[
{
"id":"Ray",
"label":"user",
"properties":{
"Name":["Ray"],
"Gender":["M"],
"Age":["18-24"],
"Occupation":["college/grad student"],
"Zip-code":["90241"]
}
},
{
"edges":[
{
"source":"Ray",
"target":"Lethal Weapon",
"index":"1",
"label":"rate",
"properties":{
"Score":[2],
"Datetime":["2000-11-22 19:16:16"]
}
}
]
},
{
"id":"Alice",
"label":"user",
"properties":{
"Name":["Alice"],
"Gender":["F"],
"Age":["25-34"],
"Occupation":["academic/educator"],
"Zip-code":["79928"]
}
}
]
]
}
}
} Status code: 400
Example response for a failed request
Http Status Code: 400
{
"errorMessage":"graph [demo] is not found",
"errorCode":"GES.8107"
} 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.