更新时间:2025-06-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 |
String |
标签名称。 |
|
properties |
Object |
属性数组,请参见properties参数说明。 |
|
type |
String |
标签类型,表示此标签用于点或边。 |
|
参数 |
类型 |
说明 |
|---|---|---|
|
name |
String |
属性名称。
|
|
cardinality |
String |
属性的复合类型,包括:
|
|
dataType |
String |
属性的数据类型。具体请参考持久化版规格说明中的元数据类型。 |
请求示例
查询图的元数据详情。
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema
响应示例
状态码: 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 |
服务不可用。 |
错误码
请参见错误码。
父主题: 元数据操作API
