
# 查询图元数据详情(1.0.0) - QueryGraphSchemaDetail
#### 功能介绍
查询图的元数据详情。
#### 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 | **参数解释**： 各label与关联的property字段定义。 **取值范围**： 不涉及。 |
   
#### 请求示例
查询图的元数据详情。
```
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": "edge"
            },
            {
                "label": "movie",
                "type": "vertex",
                "properties": [
                    {
                        "name": "ChineseTitle",
                        "type": "string",
                        "cardinality": "single"
                    },
                    {
                        "name": "Year",
                        "type": "int",
                        "cardinality": "single"
                    },
                    {
                        "name": "Genres",
                        "type": "string",
                        "cardinality": "set"
                    }
                ]
            },
            {
                "label": "user",
                "type": "vertex",
                "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",
                "type": "edge",
                "properties": [
                    {
                        "name": "Score",
                        "type": "int",
                        "cardinality": "single"
                    },
                    {
                        "name": "Datetime",
                        "type": "date",
                        "cardinality": "single"
                    }
                ]
            }
        ]
    }
}
```
**状态码： 400**
失败响应示例
```
Http Status Code: 400
{
    "errorMessage": "Not found. Please check the input parameters.",
    "errorCode": "GES.8000"
}
```
#### 状态码
| 返回值                       | 说明      |
|:---|:---|
| 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)。
