文档首页> 图引擎服务 GES> API参考(阿布扎比区域)> 业务面API> 算法API> 算法API参数参考> 带一般过滤条件最短路径(filtered_shortest_path)
更新时间:2022-02-22 GMT+08:00

带一般过滤条件最短路径(filtered_shortest_path)

请求

  • 参数说明
表1 parameters参数说明

参数

是否必选

类型

说明

source

String

输入路径的起点ID。

target

String

输入路径的终点ID。

directed

Boolean

是否考虑边的方向。默认值为“false”。

  • 请求样例
    • 同步
      {
          "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
          }
      }
    • 异步
      {
          "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
          }
      }

响应

  • 同步参数说明
    表2 response_data参数说明

    参数

    是否必选

    类型

    说明

    path

    List

    点的结果集合。filters最后一层为点过滤时,data中将包含vertices。

    source

    String

    源节点ID。

    target

    String

    目标节点ID。

    runtime

    Double

    算法运行时间 。

  • 响应样例
    • 同步成功响应样例
      {
          "data": {
              "outputs": {
                  "path": [
                      "tr_1",
                      "tr_5",
                      "tr_26",
                      "tr_117"
                  ],
                  "runtime": 0.735766,
                  "source": "tr_1",
                  "target": "tr_117"
              }
          }
      }
    • 同步失败响应样例
      {
      "errorMessage": "graph [tesdt_117] is not found",
      "errorCode": "GES.8402"
      }
  • 异步返回参数
    表3 response_data参数说明

    参数

    是否必选

    类型

    说明

    errorMessage

    String

    系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误信息。

    errorCode

    String

    系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误码。

    job_id

    String

    执行算法任务ID。请求失败时,字段为空。

    jobType

    Integer

    任务类型。请求失败时,字段为空。

  • 响应样例
    • 异步成功响应样例
      {
      "jobId": "500dea8f-9651-41fe-8299-c20f13a032ea",
      "jobType": 2
      }

    • 异步失败响应样例
      {
      "errorMessage": "graph [test_117d] is not found",
      "errorCode": "GES.8402"
      }