更新时间:2025-03-05 GMT+08:00

批量边查

功能介绍

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

URI

POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-query
表1 路径参数

参数

是否必选

类型

说明

project_id

是

String

项目ID。获取方法请参见获取项目ID。

graph_name

是

String

图名称。

请求参数

表2 Body参数说明

参数

是否必选

类型

说明

edges

是

Object

待查询的边数组。

表3 edges参数说明

参数

是否必选

类型

说明

source

是

String

边的source节点。

target

是

String

边的target节点。

index

否

String

边的index。

响应参数

表4 响应Body参数说明

参数

类型

说明

errorMessage

String

系统提示信息。

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

errorCode

String

系统提示信息。

  • 执行成功时,字段可能为空。
  • 执行失败时,用于显示错误码。

data

String

查询成功时包含data字段,data字段中包含edges查询结果。

请求示例

根据批量边的起点、终点以及索引来查询这些边的详细信息,待查询边的source节点分别为39631050_景观,27803870_地标建筑。

POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-query  
{
           "edges": [{
                "source": "39631050_景观",
                "target": "27803870_地标建筑"
            },{
                "index": "0",
                "source": "27803870_地标建筑",
                "target": "27661363_九华山庄温泉"
            }]
} 

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

响应示例

状态码: 200

成功响应示例
{
    "data": {
        "edges": [
            {
                "index": "24",
                "source": "39631050_景观",
                "label": "superclassOf",
                "properties": {
                    "popularity": [
                        0
                    ]
                },
                "target": "27803870_地标建筑"
            },
            {
                "index": "0",
                "source": "27803870_地标建筑",
                "label": "superclassOf",
                "properties": {
                    "popularity": [
                        0
                    ]
                },
                "target": "27661363_九华山庄温泉"
            }
        ]
    }
}

状态码: 400

失败响应示例
Http Status Code: 400
{
 "errorMessage":"parameter does not contain 'source'",
 "errorCode":"GES.8000"
}

状态码

返回值

说明

400 Bad Request

请求错误。

401 Unauthorized

鉴权失败。

403 Forbidden

没有操作权限。

404 Not Found

找不到资源。

500 Internal Server Error

服务内部错误。

503 Service Unavailable

服务不可用。

错误码

请参见错误码。