Filtered Shortest Path
Request
- Parameter description
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
source |
Yes |
String |
Source vertex ID of a path |
target |
Yes |
String |
Target vertex ID of a path |
directed |
No |
Boolean |
Whether to consider the edge direction. The default value is false. |
- Request example
- Synchronization
{ "executionMode": "sync", "algorithmName": "filtered_shortest_path", "edge_filter": { "property_filter": { "leftvalue": { "label_name": "labelName" }, "predicate": "IN", "rightvalue": { "value": [ "xxx", "rate" ] } } }, "vertex_filter": { "property_filter": { "leftvalue": { "property_name": "title" }, "predicate": "PREFIX", "rightvalue": { "value": "tr_" } } }, "parameters": { "source": "tr_1", "target": "tr_117", "directed": true } }
- Asynchronization
{ "executionMode": "async", "algorithmName": "filtered_shortest_path", "edge_filter": { "property_filter": { "leftvalue": { "label_name": "labelName" }, "predicate": "IN", "rightvalue": { "value": [ "xxx", "rate" ] } } }, "vertex_filter": { "property_filter": { "leftvalue": { "property_name": "title" }, "predicate": "PREFIX", "rightvalue": { "value": "tr_" } } }, "parameters": { "source": "tr_1", "target": "tr_117", "directed": true } }
- Synchronization
Response
- Synchronous data parameter description
Table 2 response_data parameter description Parameter
Mandatory
Type
Description
path
Yes
List
Vertex result set. If the last layer of filters is vertex filtering, the data contains vertices.
source
Yes
String
Source vertex ID
target
Yes
String
Target vertex ID
runtime
Yes
Double
Algorithm running time
- Response example
- Synchronous response example (successful request)
{ "data": { "outputs": { "path": [ "tr_1", "tr_5", "tr_26", "tr_117" ], "runtime": 0.735766, "source": "tr_1", "target": "tr_117" } } }
- Synchronous response example (failed request)
{ "errorMessage": "graph [tesdt_117] is not found", "errorCode": "GES.8402" }
- Synchronous response example (successful request)
- Asynchronous response parameters
Table 3 response_data 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.
job_id
No
String
ID of the algorithm execution job. This parameter is left blank when the request fails.
jobType
No
Integer
Job type. This parameter is left blank when the request fails.
- Example response
- Asynchronous response example (successful request)
{ "jobId": "500dea8f-9651-41fe-8299-c20f13a032ea", "jobType": 2 }
- Asynchronous response example (failed request)
{ "errorMessage": "graph [test_117d] is not found", "errorCode": "GES.8402" }
- Asynchronous response example (successful request)
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