更新时间:2025-03-05 GMT+08:00
查询图元数据详情
功能介绍
查询图的元数据详情。
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema
| 参数 | 是否必选 | 类型 | 说明 |
|---|---|---|---|
| project_id | 是 | String | 项目ID。获取方法请参见获取项目ID。 |
| graph_name | 是 | String | 图名称。 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errorMessage | String | 系统提示信息。
|
| errorCode | String | 系统提示信息。
|
| data | Object | 查询结果。请求失败时字段为空。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| schema | List | 各label与关联的property字段定义。 |
请求示例
查询图的元数据详情。
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema 响应示例
状态码: 200
成功响应示例
Http Status Code: 200
{
"data": {
"schema": [
{
"label": "rate",
"type": "all",
"properties": [
{
"name": "Rating",
"type": "int",
"cardinality": "single"
},
{
"name": "Datetime",
"type": "string",
"cardinality": "single"
}
]
},
{
"label": "user",
"type": "all",
"properties": [
{
"name": "userid",
"type": "int",
"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",
"probableValue": [
"other or not specified",
"academic/educator",
"artist",
"clerical/admin",
"college/grad student",
"customer service",
"doctor/health care",
"executive/managerial",
"farmer",
"homemaker",
"K-12 student",
"lawyer",
"programmer",
"retired",
"sales/marketing",
"scientist",
"self-employed",
"technician/engineer",
"tradesman/craftsman",
"unemployed",
"writer"
],
"type": "enum",
"cardinality": "single"
},
{
"name": "Zip-code",
"maxDataSize": 12,
"type": "char array",
"cardinality": "single"
}
]
},
{
"label": "book",
"type": "vertex",
"properties": [
{
"name": "Title",
"type": "string",
"cardinality": "single"
},
{
"name": "Version",
"type": "string",
"cardinality": "single"
},
{
"name": "Category",
"probableValue": [
"science",
"literature"
],
"type": "enum",
"cardinality": "single"
}
]
},
{
"label": "default",
"type": "all"
},
{
"label": "movie",
"type": "all",
"properties": [
{
"name": "movieid",
"type": "int",
"cardinality": "single"
},
{
"name": "title",
"type": "string",
"cardinality": "single"
},
{
"name": "genres",
"type": "string",
"cardinality": "single"
}
]
},
{
"label": "__DEFAULT__",
"type": "all"
}
]
}
}
状态码: 400
失败响应示例
Http Status Code: 400
{
"errorMessage": "graph [demo] is not found",
"errorCode": "GES.8003"
} 状态码
| 返回值 | 说明 |
|---|---|
| 400 Bad Request | 请求错误。 |
| 401 Unauthorized | 鉴权失败。 |
| 403 Forbidden | 没有操作权限。 |
| 404 Not Found | 找不到资源。 |
| 500 Internal Server Error | 服务内部错误。 |
| 503 Service Unavailable | 服务不可用。 |
错误码
请参见错误码。
父主题: 元数据操作API
