更新时间:2023-07-19 gmt 08:00

子图查询(2.1.13)-凯发k8国际娱乐官网入口

功能介绍

查询输入的节点和它们之间所有边所构成的子图。

uri

post /ges/v1.0/{project_id}/graphs/{graph_name}/subgraphs/action?action_id=query
表1 路径参数

参数

是否必选

类型

说明

project_id

string

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

graph_name

string

图名称。

请求参数

表2 body参数说明

名称

是否必选

参数类型

说明

vertices

string

子图中应包含的顶点id数组。

说明:

当前支持输入的顶点个数最大值为100000,超过最大值时,会报错。

响应参数

表3 响应body参数说明

名称

参数类型

说明

errormessage

string

系统提示信息。

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

errorcode

string

系统提示信息。

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

data

object

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

说明:

当前支持返回的子图边数最大值为100000,超过返回最大值时,会报错。

请求示例

查询输入的节点和它们之间所有边所构成的子图,子图中包含的顶点id为ray,ella,lethal weapon。

{
    "vertices":[
               "ray",
               "ella",
               "lethal weapon"        
               ]
}

响应示例

状态码: 200

成功响应示例

http status code: 200
{
    "data":{
        "vertices":[
            {
                "id":"ray",
                "label":"user",
                "properties":{
                    "name":["雷"],
                    "gender":["m"],
                    "age":["18-24"],
                    "occupation":["college/grad student"],
                    "zip-code":["90241"]
                }
            },
            {
                "id":"ella",
                "label":"user",
                "properties":{
                    "occupation":["other or not specified"],
                    "name":["埃拉"],
                    "zip-code":["94402"],
                    "gender":["f"],
                    "age":["25-34"]
                }
            }
        ],
        "edges":[
            {
                "source":"ray",
                "target":"lethal weapon",
                "index":"1",
                "label":"rate",
                "properties":{
                    "score":[2],
                    "datetime":["2000-11-22 19:16:16"]
                }
            },
            {
                "index":"0",
                "source":"ella",
                "label":"rate",
                "properties":{
                    "score":[5],
                    "datetime":["2000-11-23 02:30:29"]
                },
                "target":"lethal weapon"
            },
            {
                "index":"5",
                "source":"ella",
                "label":"friends",
                "properties":{},
                "target":"ray"
            }
        ]
    }
}

状态码: 400

失败响应示例
http status code: 400
{
  "errormessage": " bad request, parameter vertices cannot be null",
  "errorcode": "ges.8214"
}

状态码

返回值

说明

400 bad request

请求错误。

401 unauthorized

鉴权失败。

403 forbidden

没有操作权限。

404 not found

找不到资源。

500 internal server error

服务内部错误。

503 service unavailable

服务不可用。

错误码

请参见。

分享:
网站地图