更新时间:2022-02-22 GMT+08:00

查询边详情

功能介绍

根据边的起点、终点以及索引,查询边的详细信息,返回边上的标签和属性等。

URI

  • URI 格式
    GET /ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?source={sourceVertex}&target={targetVertex}&index={index}
  • 参数说明
    表1 URI参数说明

    参数

    是否必选

    类型

    说明

    project_id

    String

    项目编号,用于资源隔离。请参考获取项目ID

    graph_name

    String

    图名称。

    sourceVertex

    String

    边的起点。

    targetVertex

    String

    边的终点。

    index

    Integer

    边的标识号,若不设置,则查询source、target之间所有的边。

请求

  • 请求样例
    GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?source=Ray&target=Rocky&index=6

    SERVER_URL:图的访问地址,取值请参考业务面API使用限制

响应

表2 要素说明

参数

是否必选

类型

说明

errorMessage

String

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

errorCode

String

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

data

Json

查询结果。查询失败时,字段为空。

表3 data参数说明

参数

是否必选

类型

说明

edges

List

边的结果集合。没有查询到对应边时,edges内容为空。

  • 成功响应样例
    Http Status Code: 200
    
    {
        "data": {
            "edges": [
                {
                    "index": "6",
                    "source": "Ray",
                    "label": "rate",
                    "properties": {
                        "Score": [
                            3
                        ],
                        "Datetime": [
                            "2000-11-22 19:23:05"
                        ]
                    },
                    "target": "Rocky"
                }
            ]
        }
    }
  • 请求失败样例
    Http Status Code: 400
    {
    "errorMessage":"graph [demo] is not found",
    "errorCode":"GES.8107"
    }

返回值

  • 正常

    200

  • 异常
    表4 异常返回值说明

    返回值

    说明

    400 Bad Request

    请求错误。

    401 Unauthorized

    鉴权失败。

    403 Forbidden

    没有操作权限。

    404 Not Found

    找不到资源。

    500 Internal Server Error

    服务内部错误。

    503 Service Unavailable

    服务不可用。