Querying a Schema
Function
This API is used to query a generated schema (obtained from OBS).
URI
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
graph_name |
Yes |
String |
Graph name |
details |
No |
String |
Detailed information of the schema. The value can be SIMPLE or FULL. If you set this parameter to SIMPLE, only the labels of vertices or edges are returned. If you set it to FULL, the number of vertices or edges is returned in addition to the labels. If this parameter is left empty, the default value SIMPLE is used. |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
errorMessage |
String |
System prompt.
|
errorCode |
String |
System prompt code.
|
schema |
Object |
Schema structure. For details, see schema parameter description. |
Parameter |
Type |
Description |
---|---|---|
vertices |
String |
Vertex result set. If the graph is empty, the return value is empty. For details, see vertices parameter description. |
edges |
String |
Edge result set. If the graph is empty, the return value is empty. For details, see edges parameter description. |
Example Request
Query a generated schema (obtained from OBS).
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/structure?detail=SIMPLE
Example Response
Status code: 200
Example response for a successful request
{ "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" } ] } }
Status code: 400
Example response for a failed request
Http Status Code: 400 { "errorMessage": "Bad Request, parameter [detail] cannot be null.", "errorCode": "GES.8813" }
Status Code
Return Value |
Description |
---|---|
400 Bad Request |
Request error. |
401 Unauthorized |
Authorization failed. |
403 Forbidden |
No operation permissions. |
404 Not Found |
No resources found. |
500 Internal Server Error |
Internal server error. |
503 Service Unavailable |
Service unavailable. |
Error Code
See Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.