查询Schema结构
功能介绍
查询生成的schema结构。
URI
|
参数 |
是否必选 |
类型 |
说明 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID。获取方法请参见获取项目ID。 |
|
graph_name |
是 |
String |
图名称。 |
|
details |
否 |
String |
可为SIMPLE或FULL,SIMPLE模式表示只返回点或边的label,FULL模式表示除点或边的label外,还有点或边的数量。若该字段不填,则默认为SIMPLE。 |
响应参数
|
参数 |
类型 |
说明 |
|---|---|---|
|
errorMessage |
String |
系统提示信息。
|
|
errorCode |
String |
系统提示信息。
|
|
schema |
Object |
schema结构查询结果。详情请参见schema参数说明。 |
|
参数 |
类型 |
说明 |
|---|---|---|
|
vertices |
Object |
点的结果集合。图为空时,vertices内容为空。详情请参见vertices参数说明。 |
|
edges |
Object |
边的结果集合。图为空时,edges内容为空。详情请参见edges参数说明。 |
请求示例
查询生成的schema结构。
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/structure?detail=SIMPLE
响应示例
状态码: 200
成功响应示例
{
"schema": {
"vertices": [
{
"vertex": "user",
"weight": 100
},
{
"vertex": "movie",
"weight": 46
}
],
"edges": [
{
"weight": 1209,
"source": "user",
"target": "movie",
"relation": "rate"
},
{
"weight": 450,
"source": "user",
"target": "user",
"relation": "default"
}
]
}
}
状态码: 400
失败响应示例
Http Status Code: 400
{
"errorMessage":"Parameter error!",
"errorCode":"GES.8005"
}
状态码
|
返回值 |
说明 |
|---|---|
|
400 Bad Request |
请求错误。 |
|
401 Unauthorized |
鉴权失败。 |
|
403 Forbidden |
没有操作权限。 |
|
404 Not Found |
找不到资源。 |
|
500 Internal Server Error |
服务内部错误。 |
|
503 Service Unavailable |
服务不可用。 |
错误码
请参见错误码。