
# 查询图元数据详情
#### 功能介绍
查询图的元数据详情。
#### URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema
表1路径参数 
| 参数         | 是否必选 | 类型     | 说明                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释：** 项目编号。获取方法，请参见[获取项目ID](https://support.huaweicloud.com/api-ges/ges_03_0111.html)。 **约束限制：** 不涉及。 **取值范围：** 只能由英文字母和数字组成，且长度为\[1-64\]个字符。 **默认取值：** 不涉及。 |
| graph_name | 是    | String | **参数解释：** 图名称。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。                                                                                                          |
   
#### 响应参数
表2响应Body参数说明 
| 参数           | 类型     | 说明                                                                                                                                                                                                                                        |
|:---|:---|:---|
| errorMessage | String | 系统提示信息。 - 执行成功时，字段可能为空。  - 执行失败时，用于显示错误信息。   |
| errorCode    | String | 系统提示信息。 - 执行成功时，字段可能为空。  - 执行失败时，用于显示错误码。     |
| data         | Object | 查询结果。请求失败时字段为空。                                                                                                                                                                                                                           |
   
表3data参数说明 
| 参数     | 类型   | 说明             |
|:---|:---|:---|
| schema | List | 各标签与关联的属性字段定义。 |
   
表4schema参数说明 
| 参数         | 类型     | 说明                                                       |
|:---|:---|:---|
| label      | String | 标签名称。                                                    |
| properties | Object | 属性数组，请参见[properties参数说明]。 |
| type       | String | 标签类型，表示此标签用于点或边。                                         |
   
 表5properties参数说明 
| 参数          | 类型     | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|
| name        | String | **参数解释：** 属性名称。 **约束限制：** 1. property name的长度不能超过256。  2. property name不允许包含\<, \>, \&, ASCII码14,15和30。  3. 同一个label下不允许存在相同的property。   **取值范围：** 不涉及。 **默认取值：** 不涉及。 |
| cardinality | String | **参数解释：** 属性的复合类型。 **约束限制：** 不涉及。 **取值范围：** - single  - list  - set   **默认取值：** 不涉及。                                                                               |
| dataType    | String | 属性的数据类型。具体请参考[持久化版规格说明](https://support.huaweicloud.com/api-ges/ges_03_0231.html)中的元数据类型。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
#### 请求示例
查询图的元数据详情。
```
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema
```
![](https://support.huaweicloud.com/api-ges/public_sys-resources/note_3.0-zh-cn.png)
SERVER_URL：图的访问地址，取值请参考[业务面API使用限制](https://support.huaweicloud.com/api-ges/ges_03_0139.html)。
#### 响应示例
**状态码： 200**
成功响应示例
```
Http Status Code: 200
{
    "data": {
        "schema": [
            {
                "label": "__DEFAULT__",
                "type": "all"
            },
            {
                "label": "friends",
                "type": "vertex"
            },
            {
                "label": "movie",
                "type": "vertex",
                "properties": [
                    {
                        "name": "ChineseTitle",
                        "type": "string",
                        "cardinality": "single"
                    },
                    {
                        "name": "Year",
                        "type": "int",
                        "cardinality": "single"
                    }
                ]
            },
            {
                "label": "user",
                "type": "vertex",
                "properties": [
                    {
                        "name": "Name",
                        "type": "string",
                        "cardinality": "single"
                    },
{
                        "name": "Occupation",
                        "type": "string",
                        "cardinality": "single"
                    },
                    {
                        "name": "Zip-code",
                        "type": "string",
                        "cardinality": "single
"
                    }
                ]
            },
            {
                "label": "rate",
                "type": "edge",
                "properties": [
                    {
                        "name": "Score",
                        "type": "int",
                        "cardinality": "single"
                    },
                    {
                        "name": "Datetime",
                        "type": "date",
                        "cardinality": "single"
                    }
                ]
            }
        ]
    }
}
```
**状态码： 400**
失败响应示例
```
Http Status Code: 400
{
    "errorMessage": "Graph [854d9316e71d4dc599c5f27ea323d445-ges_fdb1] does not exist, please check projectId and graphName.",
    "errorCode": "GES.8000",
    "result": "failed"
}
```
#### 状态码
| 返回值                       | 说明      |
|:---|:---|
| 400 Bad Request           | 请求错误。   |
| 401 Unauthorized          | 鉴权失败。   |
| 403 Forbidden             | 没有操作权限。 |
| 404 Not Found             | 找不到资源。  |
| 500 Internal Server Error | 服务内部错误。 |
| 503 Service Unavailable   | 服务不可用。  |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-ges/ges_03_0110.html)。
