更新时间:2022-08-09 GMT+08:00

查询图元数据详情

功能介绍

查询图的元数据详情。

URI

  • URI 格式
    GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema
  • 参数说明
    表1 URI参数说明

    参数

    是否必选

    类型

    说明

    project_id

    String

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

    graph_name

    String

    图名称。

请求

  • 请求样例
    GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema

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

响应

表2 要素说明

参数

是否必选

类型

说明

errorMessage

String

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

errorCode

String

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

data

Json

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

表3 data参数说明

参数

类型

说明

schema

List

各label与关联的property字段定义。

  • 请求成功样例
    Http Status Code: 200
    
    {
        "data": {
            "schema": [
                {
                    "label": "__DEFAULT__"
                },
                {
                    "label": "friends"
                },
                {
                    "label": "movie",
                    "properties": [
                        {
                            "name": "Title",
                            "type": "string",
                            "cardinality": "single"
                        },
                        {
                            "name": "Year",
                            "type": "int",
                            "cardinality": "single"
                        },
                        {
                            "name": "Genres",
                            "type": "string",
                            "cardinality": "set"
                        }
                    ]
                },
    
                {
                    "label": "user",
                    "properties": [
                        {
                            "name": "Name",
                            "type": "string",
                            "cardinality": "single"
                        },
                        {
                            "name": "Gender",
                            "probableValue": [
                                "",
                                "F",
                                "M"
                            ],
                            "type": "enum",
                            "cardinality": "single"
                        },
                        {
                            "name": "Age",
                            "probableValue": [
                                "",
                                "Under 18",
                                "18-24",
                                "25-34",
                                "35-44",
                                "45-49",
                                "50-55",
                                "56+"
                            ],
                            "type": "enum",
                            "cardinality": "single"
                        },
                        {
                            "name": "Occupation",
                            "type": "string",
                            "cardinality": "single"
                        },
                        {
                            "name": "Zip-code",
                            "type": "char array",
                            "cardinality": "single
    "
                        }
                    ]
                },
                {
                    "label": "rate",
                    "properties": [
                        {
                            "name": "Score",
                            "type": "int",
                            "cardinality": "single"
                        },
                        {
                            "name": "Datetime",
                            "type": "date",
                            "cardinality": "single"
                        }
                    ]
                }
            ]
        }
    }
  • 请求失败样例
    Http Status Code: 400
    {
      "errorMessage": "graph [demo] is not found",
      "errorCode": "GES.8003"
    }

返回值

  • 正常

    200

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

    返回值

    说明

    400 Bad Request

    请求错误。

    401 Unauthorized

    鉴权失败。

    403 Forbidden

    没有操作权限。

    404 Not Found

    找不到资源。

    500 Internal Server Error

    服务内部错误。

    503 Service Unavailable

    服务不可用。