Ges Api
Ges Api
2.3.19
API Reference
Issue 01
Date 2024-04-30
and other Huawei trademarks are the property of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei
Cloud and the customer. All or part of the products, services and features described in this document may
not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all
statements, information, and recommendations in this document are provided "AS IS" without
warranties, guarantees or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: https://www.huaweicloud.com/intl/en-us/
Contents
2 API Overview............................................................................................................................ 4
2.1 Management Plane APIs.......................................................................................................................................................4
2.2 Service Plane API..................................................................................................................................................................... 8
2.2.1 Memory Edition.................................................................................................................................................................... 8
2.2.2 Database Edition............................................................................................................................................................... 16
3 Calling APIs............................................................................................................................. 22
3.1 Making an API Request...................................................................................................................................................... 22
3.1.1 Making a Management Plane API Request..............................................................................................................22
3.1.2 Making a Service Plane API Request.......................................................................................................................... 25
3.2 Authentication....................................................................................................................................................................... 26
3.3 Response.................................................................................................................................................................................. 28
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. iii
Graph Engine Service(GES)
API Reference Contents
6 Application Examples.........................................................................................................589
6.1 Analyzing Graphs Using HyG API Algorithms.......................................................................................................... 589
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. vii
Graph Engine Service(GES)
API Reference Contents
9 Appendix............................................................................................................................... 697
9.1 Status Codes......................................................................................................................................................................... 697
9.2 Error Codes........................................................................................................................................................................... 701
9.2.1 Error Codes for Management Plane APIs............................................................................................................... 701
9.2.2 Error Codes for Service Plane APIs............................................................................................................................ 708
9.3 Obtaining a Project ID...................................................................................................................................................... 717
9.4 Obtaining the Tenant ID.................................................................................................................................................. 718
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. viii
Graph Engine Service(GES)
API Reference Contents
1.1 Overview
Welcome to Graph Engine Service API Reference. Graph Engine Service (GES) is
the first commercial self-built distributed native graph engine with independent
intellectual property rights in the industry. It facilitates querying and analysis of
graph structure data based on relationships. It is specifically suited for scenarios
involving social applications, enterprise relationship analysis, risk control,
recommendations, public opinions, and anti-fraud.
Before calling APIs of GES, ensure that you are familiar with GES concepts.
1.4 Concepts
● User
A user is created on ManageOne Operation Portal to use cloud services. Each
user has its own identity credentials (password and access keys).
The account name, username, and password will be required for API
authentication.
● Region
Regions are geographic areas isolated from each other. Resources are region-
specific and cannot be used across regions through internal network
connections. For low network latency and quick resource access, select the
nearest region.
● AZ
An AZ comprises of one or more physical data centers equipped with
independent ventilation, fire, water, and electricity facilities. Computing,
network, storage, and other resources in an AZ are logically divided into
multiple clusters. AZs within a region are interconnected using high-speed
optical fibers to allow you to build cross-AZ high-availability systems.
● Project
Projects group and isolate resources (including compute, storage, and network
resources) across physical regions. A default project is provided for each cloud
region, and subprojects can be created under each default project. Users can
be granted permissions to access all resources in a specific project. For more
refined access control, create subprojects under a project and apply for
resources in the subprojects. Users can then be assigned permissions to access
only specific resources in the subprojects.
2 API Overview
3 Calling APIs
Request URI
A request URI is in the following format:
Request Methods
The HTTP protocol defines the following request methods that can be used to
send a request to the server:
Request Header
You can also add additional header fields to a request, such as the fields required
by a specified URI or HTTP method. For example, to request for the authentication
information, add Content-Type, which specifies the request body type.
Common request header fields are as follows:
NOTE
Request Body
The body of a request is often sent in a structured format as specified in the
Content-Type header field. The request body transfers content except the request
header.
The request body varies between APIs. Some APIs do not require the request body,
such as the APIs requested using the GET and DELETE methods.
For the API of obtaining a user token, obtain the request parameters and
parameter description in the API request. The following provides an example
Request URI
A request URI of a service plane API of GES is in the following format:
{URI-scheme} :// {SERVER_URL} / {resource-path} ? {query-string}
Although a request URI is included in the request header, most programming
languages or frameworks require the request URI to be transmitted separately.
● URI-scheme: Protocol used to transmit requests. All APIs use HTTPS.
● SERVER_URL: Address for accessing a graph. For details about its value, see
Using Service Plane APIs.
● resource-path: Access path of an API for performing a specified operation.
Obtain the value from the URI module of the API, for example, ges/v1.0/
{project_id}/graphs/{graph_name}/vertices/action?action_id=query.
● query-string: Query parameter, which is optional. Ensure that a question
mark (?) is included before each query parameter that is in the format of
"Parameter name=Parameter value". For example, ? limit=10 indicates that a
maximum of 10 data records will be displayed.
Request Methods
The HTTP protocol defines the following request methods that can be used to
send a request to the server:
● GET: requests the server to return specified resources.
● PUT: requests the server to update specified resources.
● POST: requests the server to add resources or perform special operations.
● DELETE: requests the server to delete specified resources, for example, an
object.
● HEAD: same as GET except that the server must return only the response
header.
● PATCH: requests the server to update partial content of a specified resource.
If the resource does not exist, a new resource will be created.
Request Header
You can also add additional header fields to a request, such as the fields required
by a specified URI or HTTP method. For example, to request for the authentication
information, add Content-Type, which specifies the request body type.
3.2 Authentication
You can use token authentication to invoke APIs.
Token-based Authentication
A token is used to acquire temporary permissions. During API authentication using
a token, the token is added to requests to get permissions for calling the API.
When calling an API to obtain a user token, you must set auth.scope in the
request body to project.
URL: https://iam-cache-proxy.{GLOBAL_DOMAIN_NAME}:26335/v3/auth/tokens
Header:
Content-Type: application/json
Body:
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"name": "username", //Username
"password": "********", // Password
"domain": {
"name": "domainname" // Tenant to which the user belongs
}
}
}
},
"scope": {
"project": {
"id": "xxxxxxxx" // ID of the resource set for which the token is used
}
}
}
}
Content-Type: application/json
X-Auth-Token: ABCDEFJ....
NOTE
1. A token is valid for 24 hours. When using a token for authentication, cache it to prevent
frequently calling the IAM API used to obtain a user token.
2. Name of the tenant to which the user belongs can be obtained by performing the
following steps:
1. Log in to ManageOne Operation Portal.
2. Hover your cursor over the username in the upper right corner and choose My
Settings from the drop-down list.
3. On the My Settings page, the tenant displayed is the name of the tenant to which
the user belongs.
3. Before calling the IAM API to obtain the token, perform the following steps to write the
mapping between the IAM address and domain name into the hosts file of the system:
1. Replace GLOBAL_DOMAIN_NAME in the example with the plan value of
global_domain_name in the 1.1 "Basic Parameters" sheet of the table exported
from HCCI Turnkey tool when the GES service is installed.
3.3 Response
Status Code
After sending a request, you will receive a response, including a status code,
response header, and response body.
A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status
of a request. For more information, see Status Codes.
Response Header
Similar to a request, a response also has a header, for example, Content-Type.
Table 3-3 list the response header parameters.
Response Body
The body of a response is often returned in structured format as specified in the
Content-Type header field. The response body transfers content except the
response header.
URI
GET /v2/{project_id}/graphs/quotas
Request Parameters
Response Parameters
Status code: 200
quotas quotas Object Resource type list. This field is left blank when
the request fails.
Example Request
Query tenant quotas.
GET https://Endpoint/v2/{project_id}/graphs/quotas
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query all graphs of the current tenant.
URI
GET /v2/{project_id}/graphs
Request Parameters
Response Parameters
Status code: 200
id String Graph ID
Example Request
View the first 10 graphs of the current tenant.
GET https://Endpoint/v2/{project_id}/graphs?offset=0&limit=10
Example Response
Status code: 200
Example response for a successful request
{
"graph_count" : 2,
"graphs" : [ {
"id" : "146227d2-bfac-499a-97df-df475349e43d",
"name" : "TenThousand_Charging",
"created_by" : "ei_ges_j00356469_01",
"is_multi_az" : "false",
"region_code" : "XXX",
"az_code" : "XXX",
"edgeset_format" : "",
"edgeset_default_label" : "",
"vertexset_format" : "",
"vertexset_default_label" : "",
"data_store_version" : "2.3.2",
"sys_tags" : [ "0" ],
"status" : "200",
"graph_size_type_index" : "0",
"vpc_id" : "0ac6e3c3-2c9b-4296-84f7-6883cebc7b41",
"subnet_id" : "2b1755eb-d6d4-421f-88c0-cf6f0bc16801",
"security_group_id" : "7aa7c8c9-7443-4a01-abf5-8064b586f8f5",
"replication" : 1,
"created" : "2022-04-26T02:19:54",
"private_ip" : "192.168.0.228",
"arch" : "x86_64",
"encrypted" : false,
"master_key_id" : "",
"master_key_name" : "",
"enable_rbac" : false,
"enable_full_text_index" : false,
"enable_hyg" : false,
"traffic_ip_list" : [ "192.168.0.228" ],
"crypt_algorithm" : "generalCipher",
"enable_https" : false
}, {
"id" : "1172f16c-63c7-4746-89b0-78972eddf706",
"name" : "GES_UI_2_0_1",
"created_by" : "ei_ges_j00356469_01",
"is_multi_az" : "false",
"region_code" : "XXX",
"az_code" : "XXX",
"edgeset_format" : "",
"edgeset_default_label" : "",
"vertexset_format" : "",
"vertexset_default_label" : "",
"data_store_version" : "2.0.1",
"sys_tags" : [ "0" ],
"status" : "900",
"graph_size_type_index" : "0",
"vpc_id" : "0ac6e3c3-2c9b-4296-84f7-6883cebc7b41",
"subnet_id" : "2b1755eb-d6d4-421f-88c0-cf6f0bc16801",
"security_group_id" : "7aa7c8c9-7443-4a01-abf5-8064b586f8f5",
"replication" : 1,
"created" : "2022-04-26T02:10:52",
"private_ip" : "192.168.0.123",
"encrypted" : false,
"enable_rbac" : false,
"enable_full_text_index" : false,
"enable_hyg" : false,
"traffic_ip_list" : [ "192.168.0.123" ],
"crypt_algorithm" : "generalCipher",
"enable_https" : false
}]
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query details about a graph based on the graph ID.
URI
GET /v2/{project_id}/graphs/{graph_id}
Request Parameters
Response Parameters
Status code: 200
id String Graph ID
Example Request
Query details about a graph based on the graph ID.
GET https://Endpoint/v2/{project_id}/graphs/{graph_id}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
URI
POST /v2/{project_id}/graphs
Request Parameters
Response Parameters
Status code: 200
id String Graph ID
Example Request
Create a graph. The graph name is demo, the graph size is 10-thousand-edge, the
graph instance CPU architecture type is x86 64-bit, the VPC ID is f07ed478-
c31e-47ed-92d4-8fae6fd16981, the subnet ID is 70bc9d11-
b172-479b-8bce-1ad1ade02224, and the security group ID is
65de00b0-45f5-432f-8346-d8bb5f30940d.
{
"graph": {
"name": "demo",
"graph_size_type_index": 0,
"capacity_ratio": "",
"arch": "x86_64",
"vpc_id": "f07ed478-c31e-47ed-92d4-8fae6fd16981",
"subnet_id": "70bc9d11-b172-479b-8bce-1ad1ade02224",
"security_group_id": "65de00b0-45f5-432f-8346-d8bb5f30940d",
"public_ip": {
"public_bind_type": "bind_existing",
"eip_id": "b6e3bc7d-1ced-4690-9219-ef41d25e171e"
},
"enable_multi_az": false,
"lts_operation_trace": {
"enable_audit": true,
"audit_log_group_name": "test"
},
"sys_tags": [
{
"key": "_sys_enterprise_project_id",
"value": "0"
}
],
"enable_hyg":false,
"crypt_algorithm": "generalCipher",
"enable_https" : false
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
URI
POST /v2/{project_id}/graphs/{graph_id}/stop
Request Parameters
Response Parameters
Status code: 200
Example Request
Close a graph.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/stop
{}
Example Response
Status code: 200
Example response for a successful request
{
"job_id" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/start
Request Parameters
Response Parameters
Status code: 200
Example Request
Start a graph whose associated backup ID is 08a898ae-3ff8-40e8-
a7ed-03afe05aedbb.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/start
{
"graph_backup_id" : "08a898ae-3ff8-40e8-a7ed-03afe05aedbb"
}
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
URI
DELETE /v2/{project_id}/graphs/{graph_id}
Request Parameters
Response Parameters
Status code: 200
Example Request
Delete a graph.
DELETE https://Endpoint/v2/{project_id}/graphs/{graph_id}
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to import data to graphs incrementally.
NOTE
To prevent failures in restoring the imported graph data during system restarting, do not
delete the data stored on OBS when the graph is in use.
URI
POST /v2/{project_id}/graphs/{graph_id}/import-graph
Request Parameters
Response Parameters
Status code: 200
Example Request
Incrementally import graph data. The edge file directory is testbucket/
demo_movie/edges/ and the edge data set is in CSV format. The vertex file
directory is testbucket/demo_movie/vertices/ and the vertex data set is in CSV
format.
POST http://Endpoint/v2/{project_id}/graphs/{graph_id}/import-graph
{
"edgeset_path" : "testbucket/demo_movie/edges/",
"edgeset_format" : "csv",
"vertexset_path" : "testbucket/demo_movie/vertices/",
"vertexset_format" : "csv",
"schema_path" : "testbucket/demo_movie/incremental_data_schema.xml",
"log_dir" : "testbucket/importlogdir",
"parallel_edge" : {
"action" : "override",
"ignore_label" : true
},
"delimiter" : ",",
"trim_quote" : "\"",
"offline" : false
}
Example Response
Status code: 200
Example response (successful request)
{
"job_id" : "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to unbind an EIP.
NOTE
If you choose to export CSV files to your local host, the files are opened using the
spreadsheet software by default. You are advised to open the files in a text editor. If the
data contains special characters such as plus signs (+), minus signs (-), equal signs (=), and
at signs (@), the data will be parsed into formulas by the software. To ensure system
security, pay attention to the following when opening such files:
1. Do not select Enable Dynamic Data Exchange Server Launch (not recommended).
2. Do not select Enable or Yes if a dialog box indicating a security issue is displayed.
URI
POST /v2/{project_id}/graphs/{graph_id}/export-graph
Request Parameters
Response Parameters
Status code: 200
Example Request
Export a graph. The OBS path for exporting the graph is demo_movie/, the name
of the exported edge file is set_edge.csv, the name of the exported vertex file is
set_vertex.csv, and the name of the exported metadata file is set_schema.xml.
POST http://Endpoint/v2/{project_id}/graphs{graph_id}/export-graph
"graph_export_path" : "demo_movie/",
"edge_set_name" : "set_edge.csv",
"vertex_set_name" : "set_vertex.csv",
"schema_name" : "set_schema.xml"
}
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to clear all data in a graph.
URI
POST /v2/{project_id}/graphs/{graph_id}/clear-graph
Request Parameters
Response Parameters
Status code: 200
Example Request
Clear all data in a graph.
POST http://Endpoint/v2/{project_id}/graphs/{graph_id}/clear-graph?clear_metadata=true
{}
Example Response
Status code: 200
Example response (successful request)
{
"job_id" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/upgrade
Request Parameters
Response Parameters
Status code: 200
Example Request
Upgrade a graph to version 1.1.8 as needed.
POST http://Endpoint/v2/{project_id}/graphs{graph_id}/upgrade
{
"upgrade_version" : "1.1.8",
"force_upgrade" : false
}
Example Response
Status code: 200
Example response for a successful request
{
"job_id" : "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}
"error_code" : "GES.8011"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/bind-eip
Request Parameters
Response Parameters
Status code: 200
None
Status code: 400
Example Request
Bind an EIP to access GES. The ID of the EIP is 02bd6dc1-5be8-430e-
a4cd-2b0f6d0bb042.
POST http://Endpoint/v2/{project_id}/graphs{graph_id}/bind-eip
{
"eip_id" : "02bd6dc1-5be8-430e-a4cd-2b0f6d0bb042"
}
Example Response
Status code: 200
Example response (successful request)
{}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/unbind-eip
Request Parameters
Response Parameters
Status code: 200
None
Status code: 400
Example Request
Unbind an EIP to release network resources. The ID of the EIP is
02bd6dc1-5be8-430e-a4cd-2b0f6d0bb042.
POST http://Endpoint/v2/{project_id}/graphs{graph_id}/unbind-eip
{
"eip_id" : "02bd6dc1-5be8-430e-a4cd-2b0f6d0bb042"
}
Example Response
Status code: 200
Example response (successful request)
{}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to resize a graph instance.
NOTE
URI
POST /v2/{project_id}/graphs/{graph_id}/resize
Request Parameters
Response Parameters
Status code: 200
Example Request
Resize a graph instance. The graph size is ten-million-edge.
POST http://Endpoint/v2/{project_id}/graphs/{graph_id}/resize
{
"resize" : {
"graph_size_type_index" : "2"
}
}
Example Response
Status code: 200
Example response (successful request)
{
"job_id" : "ff8080816025a0a1016025a5a2700007"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
URI
POST /v2/{project_id}/graphs/{graph_id}/restart
Request Parameters
Response Parameters
Status code: 200
Example Request
Forcibly start a graph.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/restart
{}
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
NOTE
1. This API is not supported by graphs of the 10,000-edge and 10-billion-edge types.
2. Graphs cannot be resized after expansion.
3. If you want to resize and expand the graph, resize the graph before you expand it.
URI
POST /v2/{project_id}/graphs/{graph_id}/expand
Request Parameters
Response Parameters
Status code: 200
Example Request
Expand a graph. The number of new replicas is 1.
POST http://Endpoint/v2/{project_id}/graphs/{graph_id}/expand
{
"expand":{
"replication": 1
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query a backup list according to search criteria. Before using
this API:
URI
GET /v2/{project_id}/graphs/backups
Request Parameters
Response Parameters
Status code: 200
backup_list Array of List of all backups under the current project ID.
backup_list This parameter is left blank if the request fails.
objects
Example Request
Query the list of all backups.
GET https://Endpoint/v2/{project_id}/graphs/backups?offset=0&limit=3
Example Response
Status code: 200
Example response (successful request)
{
"backup_count" : 3,
"backup_list" : [ {
"id" : "ada3e720-ab87-48cb-bff7-3ec5ae1a9652",
"name" : "ges060803_nodelete-20210608135513",
"backup_method" : "manual",
"graph_id" : "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graph_name" : "ges060803_nodelete",
"graph_status" : "200",
"graph_size_type_index" : "1",
"data_store_version" : "2.2.21",
"arch" : "x86_64",
"status" : "success",
"start_timestamp" : 1623160513000,
"start_time" : "2021-06-08T13:55:13",
"end_timestamp" : 1623160568000,
"end_time" : "2021-06-08T13:56:08",
"size" : 1,
"duration" : 54,
"encrypted" : false
}, {
"id" : "7ed3f51d-816d-4651-9129-fe21b64b5c91",
"name" : "ges060803_nodelete_20210609203323_auto",
"backup_method" : "auto",
"graph_id" : "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graph_name" : "ges060803_nodelete",
"graph_status" : "200",
"graph_size_type_index" : "1",
"data_store_version" : "2.2.21",
"arch" : "x86_64",
"status" : "success",
"start_timestamp" : 1623242004000,
"start_time" : "2021-06-09T12:33:24",
"end_timestamp" : 1623242004000,
"end_time" : "2021-06-09T12:33:24",
"size" : 1,
"duration" : 0,
"encrypted" : false
}, {
"id" : "604bfb46-04dd-45fc-a9ae-df24a0705b9d",
"name" : "ges060802_nodelete-20210608135523",
"backup_method" : "manual",
"graph_id" : "9b9a05c2-0cdb-41ac-b55f-93caffb0519a",
"graph_name" : "ges060802_nodelete",
"graph_status" : "400",
"graph_size_type_index" : "0",
"data_store_version" : "2.2.23",
"arch" : "x86_64",
"status" : "success",
"start_timestamp" : 1623160524000,
"start_time" : "2021-06-08T13:55:24",
"end_timestamp" : 1623160577000,
"end_time" : "2021-06-08T13:56:17",
"size" : 1,
"duration" : 53,
"encrypted" : false
}]
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to query the backup list of a graph.
URI
GET /v2/{project_id}/graphs/{graph_id}/backups
Request Parameters
Response Parameters
Status code: 200
backup_list Array of List of all backups under the current project ID.
backup_list This parameter is left blank if the request fails.
objects
id String Backup ID
Example Request
Query the backup list of a graph.
GET https://Endpoint/v2/{project_id}/graphs/{graph_id}/backups?offset=0&limit=2
Example Response
Status code: 200
Example response (successful request)
{
"backup_count" : 2,
"backup_list" : [ {
"id" : "ada3e720-ab87-48cb-bff7-3ec5ae1a9652",
"name" : "ges060803_nodelete-20210608135513",
"backup_method" : "manual",
"graph_id" : "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graph_name" : "ges060803_nodelete",
"graph_status" : "200",
"graph_size_type_index" : "1",
"data_store_version" : "2.2.21",
"arch" : "x86_64",
"status" : "success",
"start_timestamp" : 1623160513000,
"start_time" : "2021-06-08T13:55:13",
"end_timestamp" : 1623160568000,
"end_time" : "2021-06-08T13:56:08",
"size" : 1,
"duration" : 54,
"encrypted" : false
}, {
"id" : "7ed3f51d-816d-4651-9129-fe21b64b5c91",
"name" : "ges060803_nodelete_20210609203323_auto",
"backup_method" : "auto",
"graph_id" : "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graph_name" : "ges060803_nodelete",
"graph_status" : "200",
"graph_size_type_index" : "1",
"data_store_version" : "2.2.21",
"arch" : "x86_64",
"status" : "success",
"start_timestamp" : 1623242004000,
"start_time" : "2021-06-09T12:33:24",
"end_timestamp" : 1623242004000,
"end_time" : "2021-06-09T12:33:24",
"size" : 1,
"duration" : 0,
"encrypted" : false
}]
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/backups
Request Parameters
Response Parameters
Status code: 200
Example Request
Add a graph backup.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/backups
{}
Example Response
Status code: 200
Example response for a successful request
{
"job_id" : "ff8080815f9a3c84015f9a438ff70001"
"backup_id":"0000b54f-2f1d-47a5-94bc-04f0d8a2e2db"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
DELETE /v2/{project_id}/graphs/{graph_id}/backups/{backup_id}
Request Parameters
Response Parameters
Status code: 200
None
Status code: 400
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 100
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Delete a backup.
DELETE https://Endpoint/v2/{project_id}/graphs/{graph_id}/backups/{backupId}
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 101
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Function
This API is used to export a GES graph instance backup to OBS.
URI
POST /v2/{project_id}/graphs/{graph_id}/backups/export
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 102
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Export a backup.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/backups/export
{
"backup_id": "{backup_id}",
"export_path" : "{obs_path}"
}
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 103
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
URI
POST /v2/{project_id}/graphs/{graph_id}/backups/import
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 104
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 105
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Import a backup.
POST https://Endpoint/v2/{project_id}/graphs/{graph_id}/backups/import
{
"import_path" : "{obs_path}"
}
Example Response
Status code: 200
Example response for a successful request
{
"job_id" : "ff8080815f9a3c84015f9a438ff70001"
}
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 106
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
4.4.1 Constraints
Table 4-122 and Table 4-123 list the metadata types.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 107
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 108
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
URI
GET /v2/{project_id}/graphs/metadatas
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 109
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
id String Metadata ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 110
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Query the metadata list.
GET https://Endpoint/v2/{project_id}/graphs/metadatas?offset=0&limit=2
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 111
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Status Code
Return Value Description
Error Code
See Error Code.
URI
GET /v2/{project_id}/graphs/metadatas/{metadata_id}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 112
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 113
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Query metadata of a graph.
GET https://Endpoint/v2/{project_id}/graphs/metadatas/{metadata_id}
Example Response
Status code: 200
Example response (successful request)
{
"encrypted" : false,
"ges_metadata" : {
"labels" : [ {
"name" : "friends"
}, {
"name" : "movie",
"properties" : [ {
"data_type" : "string",
"name" : "ChineseTitle",
"cardinality" : "single"
}, {
"data_type" : "int",
"name" : "Year",
"cardinality" : "single"
}, {
"data_type" : "string",
"name" : "Genres",
"cardinality" : "set"
}]
}, {
"name" : "user",
"properties" : [ {
"data_type" : "string",
"name" : "ChineseName",
"cardinality" : "single"
}, {
"type_name1" : "F",
"type_name2" : "M",
"data_type" : "enum",
"name" : "Gender",
"type_name_count" : "2",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 114
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"cardinality" : "single"
}, {
"type_name1" : "Under 18",
"type_name2" : "18-24",
"type_name3" : "25-34",
"type_name4" : "35-44",
"type_name5" : "45-49",
"type_name6" : "50-55",
"type_name7" : "56+",
"data_type" : "enum",
"name" : "Age",
"type_name_count" : "7",
"cardinality" : "single"
}, {
"data_type" : "string",
"name" : "Occupation",
"cardinality" : "single"
}, {
"data_type" : "char array",
"name" : "Zip-code",
"max_data_size" : "12",
"cardinality" : "single"
}]
}, {
"name" : "rate",
"properties" : [ {
"data_type" : "int",
"name" : "Score",
"cardinality" : "single"
}, {
"data_type" : "date",
"name" : "Datetime",
"cardinality" : "single"
}]
}]
}
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 115
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Error Code
See Error Code.
Function
Add a metadata file.
URI
POST /v2/{project_id}/graphs/metadatas
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 116
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Response Parameters
Status code: 200
id String Metadata ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 117
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Add metadata. The metadata is stored in devdata/unionsdk/unionsdk_test.xml.
The metadata does not overwrite existing data, the metadata name is
unionsdk_test, and the metadata description is test.
POST https://Endpoint/v2/{project_id}/graphs/metadatas
{
"metadata_path" : "devdata/unionsdk/unionsdk_test.xml",
"is_overwrite" : false,
"name" : "unionsdk_test",
"description": " test",
"ges_metadata" : {
"labels" : [ {
"name" : "friends"
}, {
"name" : "movie",
"properties" : [ {
"dataType" : "string",
"name" : "ChineseTitle",
"cardinality" : "single"
}, {
"dataType" : "int",
"name" : "Year",
"cardinality" : "single"
}, {
"dataType" : "string",
"name" : "Genres",
"cardinality" : "set"
}]
}, {
"name" : "user",
"properties" : [ {
"dataType" : "string",
"name" : "ChineseName",
"cardinality" : "single"
}, {
"typeName1" : "F",
"typeName2" : "M",
"typeNameCount" : "2",
"dataType" : "enum",
"name" : "Gender",
"cardinality" : "single"
}, {
"typeName1" : "Under 18",
"typeName2" : "18-24",
"typeName3" : "25-34",
"typeName4" : "35-44",
"typeNameCount" : "7",
"dataType" : "enum",
"name" : "Age",
"typeName5" : "45-49",
"typeName6" : "50-55",
"cardinality" : "single",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 118
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"typeName7" : "56+"
}, {
"dataType" : "string",
"name" : "Occupation",
"cardinality" : "single"
}, {
"dataType" : "char array",
"name" : "Zip-code",
"maxDataSize" : "12",
"cardinality" : "single"
}]
}, {
"name" : "rate",
"properties" : [ {
"dataType" : "int",
"name" : "Score",
"cardinality" : "single"
}, {
"dataType" : "date",
"name" : "Datetime",
"cardinality" : "single"
}]
}]
}
}
Example Response
Status code: 200
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 119
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Error Code
See Error Code.
Function
Delete a metadata file.
URI
DELETE /v2/{project_id}/graphs/metadatas/{metadata_id}
Request Parameters
Response Parameters
Status code: 400
None
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 120
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Delete metadata of a graph.
DELETE /v2/{project_id}/graphs/metadatas/{metadata_id}
Example Response
Status code: 200
OK
{}
Bad Request
{
"error_code" : "GES.7024",
"error_msg" : "The metadata is not exist or has been deleted."
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 121
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/metadata/upload-from-obs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 122
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
id String Metadata ID
Example Request
Import metadata from OBS. The metadata is stored in devdata/unionsdk/
schema.xml and the metadata name is test_schema.
POST https://Endpoint/v2/{project_id}/graphs/metadata/upload-from-obs
{
"metadata_path" : "devdata/unionsdk/schema.xml",
"name" : "test_schema",
"description" : "xx"
}
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 123
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
{
"error_msg" : "test_schema The name already exists.",
"error_code" : "GES.2067"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
GET /v2/{project_id}/graphs/{graph_id}/jobs/{job_id}/status
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 124
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 125
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 126
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 127
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Query the execution status of a job.
GET https://Endpoint/v2/{project_id}/graphs/{graph_id}/jobs/{job_id}/status
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 128
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"job_progress" : 0
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to query asynchronous job details in the job center on the
management plane. Asynchronous jobs include creating, closing, starting, deleting,
adding, importing, exporting, and upgrading graphs, as well as adding backups.
URI
GET /v2/{project_id}/graphs/jobs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 129
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 130
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 131
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 132
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 133
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Query asynchronous job details in the job center on the management plane.
GET https://Endpoint/v2/{project_id}/graphs/jobs?offset=0&limit=100
Example Response
Status code: 200
Example response (successful request)
{
"job_count" : 2,
"job_list" : [ {
"job_id" : "ff80808167bb90340167bc3c7b5b026a",
"status" : "success",
"job_type" : "GraphManagement",
"job_name" : "ImportGraph",
"related_graph" : "test1217",
"begin_time" : "2018-12-17T12:55:40",
"end_time" : "2018-12-17T12:56:32",
"job_detail" : {
"vertexset_path" : null,
"edgeset_path" : [ {
"path" : "hkmovie/edge.csv",
"log" : null,
"cause" : null,
"status" : "success"
} ],
"schema_path" : [ {
"path" : "hkmovie/schema.xml",
"log" : null,
"cause" : null,
"status" : "success"
}]
},
"job_progress" : 0
}, {
"job_id" : "ff80808167bb90340167bc5d0b1d0358",
"status" : "success",
"job_type" : "GraphManagement",
"job_name" : "DeleteGraph",
"related_graph" : "test1218",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 134
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"begin_time" : "2018-12-17T13:31:14",
"end_time" : "2018-12-17T13:34:48",
"job_progress" : 0
}]
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
GET /v2/{project_id}/graphs/scenes
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 135
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 136
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 137
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Query the information about the application analysis capability in a scene.
GET /v2/{project_id}/graphs/scenes?scene_name=xxx&application_name=xxx&graph_id=xxx
Example Response
Status code: 200
Example response (successful request)
{
"results" : [ {
"name" : "movie_recommendation",
"description": "Recommend movies that friends are interested in. Graph constraints: (user)-[friends]-
>(user), (user)-[rates]->(movie)",
"params" : [ {
"name" : "user",
"default_value" : "",
"type" : "string"
} ],
"scene" : "MovieSocialNetwork_V2"
}, {
"name" : "friend_recommendation",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 138
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"description": "Recommend people who you may be interested in (considering the relationships between
potential friends and movie preference). Graph constraints: (user) -[friends]-> (user), (user) -[rates]->
(movie)",
"params" : [ {
"name" : "user",
"default_value" : "",
"type" : "string"
} ],
"scene" : "MovieSocialNetwork_V2"
}]
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to subscribe to a scene analysis plugin so that you can use the
function through the service plane APIs.
NOTE
A subscribed plugin cannot be subscribed to repeatedly. To update the plugin, cancel the
subscription and subscribe to it again after update.
URI
POST /v2/{project_id}/graphs/{graph_id}/scenes/register
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 139
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 140
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Subscribe to an application scenario analysis plugin. The scenario name is Service
ticket association analysis, and the list of applications is In-depth analysis of
dynamic high-dimension relationships.
POST /v2/{project_id}/graphs/{graph_id}/scenes/register
{
"scenes" : [ {
"name": "Service ticket association analysis",
"applications": ["In-depth analysis of dynamic high-dimension relationships"]
}]
}
Example Response
Status code: 200
Example response (successful request)
{
"result" : "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 141
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
"error_code" : "GES.8402"
}
Status Code
Return Value Description
Error Code
See Error Code.
URI
POST /v2/{project_id}/graphs/{graph_id}/scenes/unregister
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 142
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 143
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Example Request
Unsubscribe from a scenario analysis plugin. The scenario name is Service ticket
association analysis, and the list of applications is In-depth analysis of dynamic
high-dimension relationships.
POST /v2/{project_id}/graphs/{graph_id}/scenes/unregister
{
"scenes" : [ {
"name": "Service ticket association analysis",
"applications": ["In-depth analysis of dynamic high-dimension relationships"]
}]
}
Example Response
Status code: 200
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 144
Graph Engine Service(GES)
API Reference 4 Management Plane APIs (V2)
Error Code
See Error Code.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 145
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query vertices that meet filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 146
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
key Either Key or String Possible values are id, label, and
propertyName is property. These values indicate that
mandatory. IDs, labels, or properties are sorted.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 147
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 148
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query vertices that meet filter criteria. The start position of the request is 0, the
maximum number of resources on each page is 2, the attribute criteria for filtering
are movie and user, and the attribute name for filtering is Age.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=query
{
"offset":0,
"limit":2,
"labels": ["movies",
"user"],
"vertexFilters":[{
"propertyName":"Age",
"predicate":"=",
"values":["18-24"]
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 149
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Example Response
Status code: 200
Example of a successful response
Http Status Code: 200
{
"jobId": "03e774f5-29ea-4187-9508-5435f3892ead016886200",
"jobType": 1
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query the vertex information (such as the label and property)
based on the vertex ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 150
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/detail?
vertexIds={vertex_ids}
project_i Yes String Project ID. For details about how to obtain
d the project ID, see Obtaining a Project ID.
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 151
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query node information by node ID and return node details.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/detail?vertexIds=Ray
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example of a successful response
Http Status Code: 200
{
"data": {
"vertices": [
{
"id": "Ray",
"label": "user",
"properties": {
"Occupation": [
"college/grad student"
],
"Name": [
"Lei"
],
"Zip-code": [
"90241"
],
"Gender": [
"M"
],
"Age": [
"18-24"
]
}
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 152
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to add a vertex.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 153
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Example Request
Add a vertex named Lily and set the vertex label to user.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices
{
"vertex":"Lily",
"label":"user",
"properties":{
"Age":[
"under 18"
],
"Gender":[
"F"
],
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 154
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"Occupation":[
"artist"
],
"Zip-code":[
"98133"
]
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to delete a vertex.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 155
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/{vertex_id}
Response Parameters
Example Request
Delete a vertex.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/Lily
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 156
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to update vertex property values. The operations include ADD,
UPDATE, and DEL.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/{vertex_id}/properties/
action?action_id={actionId}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 157
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
project_i Yes String Project ID. For details about how to obtain
d the project ID, see Obtaining a Project ID.
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 158
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Update the property value of a vertex. The value of the Age property is under 18,
and the value of the Gender property is F.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/Lily/properties/action?
action_id={actionId}
{
"properties":{
"Age":[
"under 18"
],
"Gender":[
"F"
]
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 159
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to query the vertex data (such as the labels and properties) in
batches based on the vertex IDs.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 160
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
vertices Yes List Vertex IDs you use to query the vertices
Response Parameters
Example Request
Query nodes in batches by node ID. The vertex IDs to be queried are
27003509_Station Building and 39636392_Badaling Great Wall.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-
query
{
"vertices":
["27003509_Station Building",
"39636392_Badaling Great Wall"]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 161
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 162
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Code
See Error Code.
Function
This API is used to add vertices in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-add
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 163
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 164
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Add vertices in batches. The names of the vertices to be added are 150 and 6.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-add
{
"vertices": [
{
"vertex": "150",
"label": "movie",
"properties": {
"movieid": [
"150"
],
"title": [
"testmoive"
],
"genres": [
"Comedy"
]
}
},
{
"vertex": "6",
"label": "movie",
"properties": {
"movieid": [
"6"
],
"title": [
"testmoive_exist_id"
],
"genres": [
"Comedy"
]
}
}
],
"overrideExists": true
}
NOTE
● SERVER_URL: Address for accessing a graph. For details about its value, see Using
Service Plane APIs.
● In the example, if vertex 6 already exists in the graph, properties of vertex 6 are
overwritten.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 165
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete vertices in batches based on the vertex IDs.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-delete
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 166
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Example Request
Delete nodes in batches by node ID. The vertex IDs to be deleted are Vivian and
46.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-
delete
{
"vertices": [
"Vivian",
"46"
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 167
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to update vertex properties in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/properties/action?
action_id={actionId}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 168
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 169
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Update vertex properties in batches. The vertex names to be updated are 150 and
6.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/properties/action?
action_id=batch-update
{
"vertices": [
{
"vertex": "150",
"label": "movie",
"properties": {
"movieid": [
"150"
],
"title": [
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 170
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"testmoive"
],
"genres": [
"Comedy"
]
}
},
{
"vertex": "6",
"properties": {
"title": [
"testmoive_exist_id"
],
"genres": [
"Comedy"
]
}
}
],
"ignoreError": true
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 171
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Code
See Error Code.
Function
This API is used to add a vertex label.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/{vertex_id}/labels
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 172
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Add a vertex label named user.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/{vertex_id}/labels
{
"label":"user"
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 173
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Code
See Error Code.
Function
This API is used to delete a vertex label.
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/{vertex_id}/labels/
{label_name}
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 174
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete a vertex label.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/46/labels/movie
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
}
Status Code
Return Value Description
Error Code
See Error Code.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 175
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to export the vertex set that meets the filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=export
Example Request
Export vertices that meet filter criteria (only the asynchronous mode is supported).
The export path is demo_movie/, and the export file name is
export_movie_and_user.csv.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=export
{
"labels": [
"movies",
"user"
],
"vertexFilters": [
{
"propertyName": "Age",
"predicate": "=",
"values": [
"18-24"
]
}
],
"exportPath": "demo_movie/",
"fileName": "export_movie_and_user.csv",
"obsParameters": {
"accessKey": "XXXX",
"secretKey": "XXXX"
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 176
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 177
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Response Parameters
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "03e774f5-29ea-4187-9508-5435f3892ead016886200",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 178
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete the vertex set that meets the filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=delete
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 179
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 180
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
jobId String ID of the vertex query job. This parameter is left blank
when the request fails.
NOTE
You can view the job execution status and obtain the return result
by querying the job ID. For details, see Querying Job Status on
the Service Plane.
Example Request
Delete vertices that meet filter criteria (only the asynchronous mode is supported).
The vertex type filter criteria are movies and user, and the property name is Age.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=delete
{
"labels": [
"movies",
"user"
],
"vertexFilters": [
{
"propertyName": "Age",
"predicate": "=",
"values": [
"18-24"
]
}
]
}
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "03e774f5-29ea-4187-9508-5435f3892ead016886200",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 181
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query edges that meet filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 182
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 183
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
predicat Yes String Logical relationship. Possible values are =, <, >,
e <=, >=, range, has, hasNot, full_text_match,
full_text_prefix, full_text_wildcard,
full_text_regexp, full_text_fuzzy, and
full_text_combination.
NOTE
If the property is of the composite type, such as list
or set, the predicate can only be has or hasNot.
NOTE
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 184
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query edges that meet filter criteria. The start position of the request is 0, the
number of edges to be returned is 20, and the filter criterion of the relationship
type is rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=query
{
"offset":"0",
"limit":"20",
"labels":[
"rate"
],
"edgeFilters":[
{
"propertyName":"Score",
"predicate":">=",
"values":[
"2"
]
},
{
"propertyName":"Datetime",
"predicate":"range",
"values":[
"1998-12-27 01:00:00",
"2000-12-31 00:12:38"
],
"type":"or"
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 185
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query the detailed information about an edge based on the
source vertex, target vertex, and index of the edge. Information about edges and
properties is returned.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?
source={sourceVertex}&target={targetVertex}&index={index}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 186
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 187
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query details about an edge.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?
source=Ray&target=Rocky&index=6
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example successful response
Http Status Code: 200
{
"data": {
"edges": [
{
"index": "6",
"source": "Ray",
"label": "rate",
"properties": {
"Score": [
3
],
"Datetime": [
"2000-11-22 19:23:05"
]
},
"target": "Rocky"
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 188
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to add an edge.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 189
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 190
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 191
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Add an edge. The source name is Lily, the target name is Rocky, and the label
name of the edge is rate.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges
{
"source": "Lily",
"target": "Rocky",
"label": "rate",
"properties": {
"Score": [
5
],
"Datetime": [
"2018-01-01 20:30:05"
]
},
"parallelEdge": {
"action": "override",
"ignoreLabel": true,
"targetProperties": [
{
"label": "rate",
"properties": [
"Datetime"
]
},
{
"label": "superclassOf",
"properties": [
"popularity"
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 192
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
]
}
]
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to delete an edge based on the specified property value or index.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 193
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/edges?
source={sourceVertex}&target={targetVertex}&index={index}&label={label}&proper
ty={name}&value={value}
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 194
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete an edge. The source vertex name of the edge to be deleted is Vivian, the
target vertex name is Lethal, the edge index value is 0, the edge label value is
rate, the property name is Score, and the property value is 5.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges?
source=Vivian&target=Lethal Weapon&index=0&label=rate&property=Score&value=5
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Response Parameters
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 195
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to update edge property values. The operations include ADD,
UPDATE, and DEL.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id={actionId}&source={sourceVertex}&target={targetVertex}&index={index}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 196
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 197
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Update the property value of an edge. The value of property Rating is 7, the value
of property Datetime is 2020-12-27 23:44:41, and the label name is rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id=update&source=Lily&target=Tom&index=1
{
"properties": {
"Rating": ["7"],
"Datetime":["2020-12-27 23:44:41"]
},
"targetProperties": [
{
"label": "rate",
"properties": [
"Rating"
]
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 198
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to query the detailed information about edges in batches based
on the source vertices, target vertices, and indexes of the edges. Information about
edges and properties is returned.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 199
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
query
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 200
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query details about edges in batches based on the source vertex, target vertex,
and index. The source nodes of the edges to be queried are 39631050_Landscape
and 27803870_Landmark building.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
query
{
"edges": [{
"source": "39631050_Landscape",
"target": "27803870_ Landmark building"
},{
"index": "0",
"source": "27803870_Landmark building",
"target": "27661363_ Jiuhua Hot Spring"
}]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example successful response
{
"data": {
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 201
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"edges": [
{
"index": "24",
"source": "39631050_Landscape",
"label": "superclassOf",
"properties": {
"popularity": [
0
]
},
"target": "27803870_ Landmark building"
},
{
"index": "0",
"source": "27803870_Landmark building",
"label": "superclassOf",
"properties": {
"popularity": [
0
]
},
"target": "27661363_ Jiuhua Hot Spring"
}
]
}
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to add edges in batches.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 202
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
add
Request Parameters
Parameter Mand Type Description
atory
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 203
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 204
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 205
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Add edges in batches. The source vertex is 46, the target vertices are 39 and 38,
and the edge label is rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-add
{
"parallelEdge": {
"action": "override",
"ignoreLabel": false,
"targetProperties": [
{
"label": "rate",
"properties": [
"Datetime"
]
},
{
"label": "superclassOf",
"properties": [
"popularity"
]
}
]
},
"createNotExists": true,
"edges": [
{
"source": "46",
"target": "39",
"label": "rate",
"properties": {
"Rating": [
5
],
"Datetime": [
"2018-01-01 20:30:05"
]
}
},
{
"source": "46",
"target": "38",
"label": "rate",
"properties": {
"Rating": [
4
],
"Datetime": [
"2018-01-01 20:30:05"
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 206
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
]
}
}
]
}
NOTE
● SERVER_URL: Address for accessing a graph. For details about its value, see Using
Service Plane APIs.
● In the example, if vertices 46 and 39 are not in the original graph, create vertices 46 and
39, retain the default value of each label, and add an edge.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result":"success",
"data": {
"edges": [
{
"index": "7",
"source": "46",
"target": "39"
},
{
"index": "0",
"source": "46",
"target": "38"
}
]
}
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 207
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to delete edges in batches based on the source vertices, target
vertices, and indexes of the edges.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
delete
Example Request
Delete edges in batches. The source vertices of the edges are
39631050_Landscape and 27803870_Landmark building, and the target vertices
of the edges are 27803870_Landmark building and 27661363_Villa hot spring.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-delete
{
"edges": [
{
"source": "39631050_Landscape",
"target": "27803870_ Landmark building"
},
{
"index": "0",
"source": "27803870_Landmark building",
"target": "27661363_Villa hot spring"
}
],
"ignoreError": true
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 208
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
● Synchronous call
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 209
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● Asynchronous call
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 210
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 211
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to update edge properties in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id={actionId}
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 212
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
index No Strin Edge index. If this parameter is not set, the first edge
g between vertices is updated.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 213
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Update edge properties in batches. The source vertex of the edge is 46, and the
target vertices of the edge are 39 and 38.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id=batch-update
{
"edges": [
{
"source": "46",
"target": "39",
"properties": {
"Rating": [
5
],
"Datetime": [
"2018-01-0120:30:05"
]
}
},
{
"source": "46",
"target": "38",
"index": "0",
"properties": {
"Rating": [
4
],
"Datetime": [
"2018-01-0120:30:05"
]
}
}
],
"ignoreError": true
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 214
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to export the edge set that meets the filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=export
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 215
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Export edges that meet filter criteria (only the asynchronous mode is supported).
The relationship type filter criterion is rate, the property names are Score and
Datetime, and the export path is demo_movie/.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=export
{
"labels": [
"rate"
],
"edgeFilters": [
{
"propertyName": "Score",
"predicate": ">=",
"values": [
"2"
]
},
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 216
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"propertyName": "Datetime",
"predicate": "range",
"values": [
"1998-12-27 01:00:00",
"2000-12-31 00:12:38"
],
"type": "or"
}
],
"exportPath": "demo_movie/",
"fileName": "export_rate.csv",
"obsParameters": {
"accessKey": "XXXXXXX",
"secretKey": "XXXXXXX"
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 217
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to delete the edge set that meets the filter criteria.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=delete
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 218
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete edges that meet filter criteria (only the asynchronous mode is supported).
The relationship type filter criterion is rate, and the property names are Score and
Datetime.
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=delete
{
"labels": [
"rate"
],
"edgeFilters": [
{
"propertyName": "Score",
"predicate": ">=",
"values": [
"2"
]
},
{
"propertyName": "Datetime",
"predicate": "range",
"values": [
"1998-12-27 01:00:00",
"2000-12-31 00:12:38"
],
"type": "or"
}
]
}
POST https://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=delete
{
"labels": [
"rate"
],
"edgeFilters": [
{
"propertyName": "Score",
"predicate": ">=",
"values": [
"2"
]
},
{
"propertyName": "Datetime",
"predicate": "range",
"values": [
"1998-12-27 01:00:00",
"2000-12-31 00:12:38"
],
"type": "or"
}
]
}
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 219
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to add a label.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 220
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
● Request parameters (OBS scenario)
propertie Yes Object Properties you want to add to the label. For
s details about the parameters, see Table
5-90.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 221
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 222
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 223
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 224
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Add a label. The label name is book. The label has three properties to add.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels
{
"name": "book",
"type": "vertex",
"properties": [
{
"property": {
"name": "Title",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Version",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Category",
"typeName1": "science",
"typeName2": "literature",
"typeNameCount": "2",
"cardinality": "single",
"dataType": "enum"
}
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 225
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
In the current version, this API only allows appending properties to existing labels,
but not deleting existing properties or updating the order of existing properties. It
can either append properties to existing labels or overwrite the entire label.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/{label_name}/properties
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 226
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 227
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Update a label. The label name is book. The label has three properties to update.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 228
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/{label_name}/
properties
{
"name": "book",
"override": "true",
"properties": [
{
"property": {
"name": "Title",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Version",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Category",
"typeName1": "science",
"typeName2": "literature",
"typeNameCount": "2",
"cardinality": "single",
"dataType": "enum"
}
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 229
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query graph metadata details.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 230
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
data Object Query results. This parameter is left blank when the
request fails.
Example Request
Query metadata details of a graph.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
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",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 231
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"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",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 232
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"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"
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 233
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to delete a label as well as the vertices and edges associated with
the label.
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/{label_name}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 234
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Delete a label as well as the vertices and edges associated with the label.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/{label_name}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "72506da3-d2e2-4709-8ca3-a5376a42db23001234245",
"jobType": 3
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 235
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to add labels in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/action?action_id=batch-add
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 236
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 237
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Add metadata labels and their properties in batches. The names of the metadata
labels are book and movie.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 238
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels/action?
action_id=batch-add
{
"labels": [
{
"name": "book",
"type": "vertex",
"properties": [
{
"property": {
"name": "title",
"cardinality": "single",
"dataType": "string"
}
}
]
},
{
"name": "movie",
"type": "vertex",
"properties": [
{
"property": {
"name": "movieid",
"cardinality": "single",
"dataType": "int"
}
}
]
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 239
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to query the structure of the generated schema (obtained from
OBS).
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema/structure?detail={details}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 240
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 241
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
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 (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"
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 242
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to generate a schema structure where labels are represented with
vertices and the relationship between the labels are represented with edges, and
store the schema structure in an OBS bucket.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema/structure/build
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 243
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Generate a schema where labels are represented with vertices and the relationship
between the labels are represented with edges.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/structure/build
Example Response
Status code: 200
Example response (successful request)
{
"jobId": "2e0c08e1-3fbb-4b33-8776-4809176068d7154236181",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 244
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to create indexes based on the specified information such as
indexName and IndexType. Currently, composite indexes and full-text indexes are
supported.
● Composite indexes include global vertex indexes
(GlobalCompositeVertexIndex) and global edge indexes
(GlobalCompositeEdgeIndex). Composite indexes can be used to create
indexes on labels and properties. Indexes can accelerate the query speed.
● Full-text indexes (FullTextIndex) can implement functions such as full-text
search and fuzzy search. If you search data immediately after an update, you
may get the old data. You are advised to query the data 1 second after the
update. For details about how to use full-text indexes, see Querying Vertices
Based on Filter Criteria and Querying Edges Based on Filter Criteria. You
can also use full-text indexes in Cypher statements. For details, see Cypher
Operation APIs.
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 245
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Index Feature
Feature Fuzzy Search Speed Flexibility
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/indices
Example Request
Create a composite index. The index name is ageIndex and the index type is
global vertex index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
{
"indexName":"ageIndex",
"indexType": "GlobalCompositeVertexIndex",
"hasLabel": "true",
"indexProperty": ["age"]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 246
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
NOTE
If a property is of the string or char array type, the value must be no more than 40 bytes.
The excess part will be deleted.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 247
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232",
"jobType": 8
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 248
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to delete an index based on the specified indexName.
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/indices/{index_name}
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 249
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete an index by name. The index name is ageIndex.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices/ageIndex
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "fb74314e-a82d-41b2-8900-96e2559fa0d9000168232",
"jobType": 9
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 250
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query all indexes created on a graph.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/indices
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 251
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query all indexes created on a graph.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data": {
"result": "success",
"indices": [
{
"indexType": "GlobalCompositeVertexIndex",
"indexName": "ageIndx",
"indexProperty": [
"age"
],
"hasLabel": "true"
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 252
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to return the query result of a Gremlin statement.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
gremlin-query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 253
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Example Request
Perform the Gremlin query operation. If the query command is g.V().limit(100),
all vertices are queried, but the number of returned vertices is limited to 100.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-gremlin-
query
{
"command":"g.V().limit(100)"
}
NOTE
● SERVER_URL: Address for accessing a graph. For details about its value, see Using
Service Plane APIs.
● The size of the request body cannot exceed 64 MB.
Example Response
Status code: 200
Example response (successful request)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 254
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"data": {
"runtime": 0.775425022,
"vertices": [
{
"id": "Vivian",
"label": "user",
"properties": {
"Occupation": [
"artist"
],
"Name": [
"Vivian"
],
"Zip-code": [
"98133"
],
"Gender": [
"F"
],
"Age": [
"25-34"
]
}
},
......
]
}
}
Status Code
Return Value Description
Error Code
See Error Code.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 255
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to run specified algorithms based on entered parameters.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
algorithm
Example Request
Execute a specified algorithm. The algorithm name is pagerank, the weight
coefficient is 0.85, the convergence precision is 0.00001, the maximum number of
iterations is 1000, and traversal is performed along edge directions.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
"algorithmName":"pagerank",
"parameters":{
"alpha":0.85,
"convergence":0.00001,
"max_iterations":1000,
"directed":true
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Request Parameters
For details about the parameters, see Common algorithm parameters.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 256
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
jobType Integer Job type. This parameter is left blank when the
request fails.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 257
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Request Example
{
"algorithmName":"XXX",
"parameters":{
...
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 258
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 259
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 260
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 261
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Algorithms are executed based on input parameters. You can call Querying Job
Status and Execution Results to use the job_id returned by the algorithm to
obtain the algorithm execution result.
Status code: 200
Example response (successful request)
{
"data": {
"outputs": {
$response_data //Result of each algorithm. The results vary with the algorithm.
"runtime": 1.365867,
"data_return_size": 3,
"data_offset": 0,
"data_total_size": 100
}
},
"status": "complete"
}
NOTE
response_data indicates the result of each algorithm. The results vary with algorithms.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 262
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
5.1.6.2.2 PageRank
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 263
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
5.1.6.2.3 PersonalRank
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 264
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
For details about algorithm iterations and convergence, see Iterations and Convergence of
PageRank.
source String -
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 265
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
5.1.6.2.4 K-core
5.1.6.2.5 K-Hop
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 266
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 267
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 268
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 269
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 270
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 271
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
paths List All shortest paths between the source vertex and
target vertex. The format is as follows:
[[path1],[path2]]
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 272
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request
● Parameter description
● Request example
– Synchronization
{
"executionMode": "sync",
"algorithmName": "filtered_shortest_path",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "IN",
"rightvalue": {
"value": [
"xxx",
"rate"
]
}
}
},
"vertex_filter": {
"property_filter": {
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 273
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"leftvalue": {
"property_name": "title"
},
"predicate": "PREFIX",
"rightvalue": {
"value": "tr_"
}
}
},
"parameters": {
"source": "tr_1",
"target": "tr_117",
"directed": true
}
}
– Asynchronization
{
"executionMode": "async",
"algorithmName": "filtered_shortest_path",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "IN",
"rightvalue": {
"value": [
"xxx",
"rate"
]
}
}
},
"vertex_filter": {
"property_filter": {
"leftvalue": {
"property_name": "title"
},
"predicate": "PREFIX",
"rightvalue": {
"value": "tr_"
}
}
},
"parameters": {
"source": "tr_1",
"target": "tr_117",
"directed": true
}
}
Response
● Synchronous data parameter description
path Yes List Vertex result set. If the last layer of filters is
vertex filtering, the data contains vertices.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 274
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● Response example
– Synchronous response example (successful request)
{
"data": {
"outputs": {
"path": [
"tr_1",
"tr_5",
"tr_26",
"tr_117"
],
"runtime": 0.735766,
"source": "tr_1",
"target": "tr_117"
}
}
}
● Example response
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 275
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
5.1.6.2.12 SSSP
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 276
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
sou Yes Source Stri The value is in the standard CSV format. -
rces vertex ng IDs are separated by commas (,), for
ID set example, Alice, Nana.
The maximum ID number is 100000.
targ Yes Target Stri The value is in the standard CSV format. -
ets vertex ng IDs are separated by commas (,), for
ID set example, Alice, Nana.
The maximum ID number is 100000.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 277
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
5.1.6.2.14 n-Paths
k No Number of Integer 1 to 10 5
hops
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 278
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Introduction
The filtered n-Paths algorithm is used to find no more than n k-hop loop-free
paths between the source and target vertices. The start vertex (source), end vertex
(target), number of hops (k), number of paths (n), and filter criteria (filters) are
the parameters for the algorithm.
● Algorithm name: filtered_n_paths
● filtered_n_paths
Applicable Scope
Any network
Request Parameters
parameters Yes JSON For details about the format, see Table
format 5-167.
filters Yes JSon Array Filter criteria. Each element in the array
corresponds to a filter. For details about
the format, see Table 5-168.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 279
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST http://IP:PORT/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
"algorithmName": "filtered_n_paths",
"filters": [
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 280
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"edge_filter":
{
"property_filter":
{
"leftvalue":
{
"label_name": "labelName"
},
"predicate": "=",
"rightvalue":
{
"value": "default"
}
}
}
}],
"parameters":
{
"k": 6,
"n": 100,
"source": "111",
"target": "56"
}
}
Response
{
"jobId": "b14f6380-f115-46ab-990e-9a76a984ebd2154236181",
"jobType": 2
}
Query Result
{
"data": {
"outputs": {
"data_return_size": 3,
"paths": [
[
"111",
"119",
"58",
"96",
"82",
"57",
"56"
],
[
"111",
"119",
"58",
"61",
"76",
"57",
"56"
],
[
"111",
"119",
"58",
"79",
"76",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 281
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"57",
"56"
]
],
"runtime": 0.000308,
"source": "111",
"path_length": 6,
"data_offset": 0,
"paths_number": 3,
"data_total_size": 3,
"target": "56"
}
},
"status": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 282
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 283
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 284
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
paths List All shortest paths between the source vertex and target
vertex. The format is as follows:
[[path1],[path2]]
Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 285
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
paths List Paths between the source and target vertices. The
format is as follows:
[[path1],[path2]]
where
For the format of each path, see Shortest Path.
Example Request
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
"algorithmName": "filtered_all_shortest_paths",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "friends"
}
}
},
"parameters": {
"source": "Alice",
"target": "Jay",
"directed": true
}
}
Response
{
"data": {
"outputs": {
"data_return_size": 8,
"paths": [
[
"Alice",
"Janet",
"Yvette",
"Willy",
"Jay"
],
...
[
"Alice",
"Jacob",
"Jimmy",
"Cary",
"Jay"
]
],
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 286
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"runtime": 0.005276,
"source": "Alice",
"data_offset": 0,
"paths_number": 8,
"data_total_size": 8,
"target": "Jay"
}
}
}
paths List Paths between the source and target vertices. The
format is as follows:
[[path1],[path2]]
where
For the format of each path, see Shortest Path.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 287
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
For details about algorithm iterations and convergence, see Iterations and Convergence of
PageRank.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 288
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
5.1.6.2.21 Louvain
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 289
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
For details about algorithm iterations and convergence, see Iterations and Convergence of
PageRank.
5.1.6.2.22 Node2vec
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 290
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 291
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 292
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 293
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 294
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request example
Post http://{}/ges/v1.0/1/graphs/movie/action?action_id=execute-algorithm
{
"algorithmName": "filtered_circle_detection",
"parameters": {
"n": 10,
"statistics": true,
"output_format":"edgeId"
},
"filters": [
{
},
{
"operator": "out",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "transfer"
}
}
},
"times":5
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 295
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 296
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● Filter criteria at the first layer are used to filter source vertices. Therefore, only the
vertex_filter parameter is valid.
● Filter criteria at the last layer are used to filter source vertices.
● The circle length ranges from 3 to 10. Therefore, the number of filtering layers is 4 to
11.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 297
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 298
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 299
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
5.1.6.2.30 Topicrank
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 300
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
The community evolution algorithm generates a temporal graph that shows
structure changes of a community over time.
URL
POST /ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 301
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 302
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Observe the community evolution of some nodes. The algorithm name is
temporal_graph, the start time of dynamic analysis is ${startTime}, and the end
time is ${endTime}.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
{
"algorithmName":"temporal_graph",
"dynamicRange":{
"start":"${startTime}",
"end":"${endTime}",
"time_props":{"stime":"${property(start_time)}","etime":"${property(start_time)}"}
},
"parameters":{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 303
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"sources":[],
"temporal_vertex":false
}
}
Example Response
Status code: 200
Example response for a successful request
{
"jobId": "f9987cab-64d3-4b3d-ac43-e91ae0c21bef168127124",
"jobType": 0
}
Status Code
Return Value Description
Function
This algorithm searches for associated vertices based on temporal message
passing and temporal BFS algorithms, and outputs the visit time of each vertex
and the distance from the vertex to the source start vertex.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 304
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URL
POST /ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 305
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 306
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Specify a source vertex ID to search for associated vertices. The algorithm name is
temporal_bfs, the start time of dynamic analysis is ${startTime}, and the end
time is ${endTime}.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
{
"algorithmName":"temporal_bfs",
"dynamicRange":{
"start":"${startTime}",
"end":"${endTime}",
"time_props":{"stime":"${property(start_time)}","etime":"${property(start_time)}"}
},
"parameters":{
"source":"",
}
}
Example Response
Status code: 200
Example response for a successful request
{
"jobId": "f9987cab-64d3-4b3d-ac43-e91ae0c21bef168127124",
"jobType": 0
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 307
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to execute the temporal paths algorithm based on input
parameters.
Note: Only one temporal path that meets the conditions is returned between two
vertices.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 308
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 309
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Specify a source vertex ID to search for associated vertices. The algorithm name is
temporal_paths, the start time of dynamic analysis is 1646092800, the end time
is 1646170716, and the source vertex ID is Person00014.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/dynamicgraphs/action?
action_id=execute-analysis
{
"algorithmName":"temporal_paths",
"dynamicRange":{
"start":1646092800,
"end":1646170716,
"time_props":
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 310
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{"stime":"startTime","etime":"endtime"}
},
"parameters":{
"source":" Person00014",
"targets":"Person00055,Person00058,Person00052,Person00061,Person00060,Place00032,Place00016,Place00
026,Place00015,Place00043",
"strategy":"shortest",
"directed":true
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Function
This API is used to query the path details. All possible paths will be listed.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 311
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/paths/action?action_id=query-
detail
Example Request
Query path details. The paths to be queried are Ray, Lethal Weapon, and Alice.
Do not set the query direction.
post http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/paths/action?action_id=query-detail
{
"paths":[
[
"Ray",
"Lethal Weapon",
"Alice"
]
],
"directed":false
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 312
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data": {
"outputs":{
"paths":[
[
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 313
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"id":"Ray",
"label":"user",
"properties":{
"Name":["Ray"],
"Gender":["M"],
"Age":["18-24"],
"Occupation":["college/grad student"],
"Zip-code":["90241"]
}
},
{
"edges":[
{
"source":"Ray",
"target":"Lethal Weapon",
"index":"1",
"label":"rate",
"properties":{
"Score":[2],
"Datetime":["2000-11-22 19:16:16"]
}
}
]
},
{
"id":"Alice",
"label":"user",
"properties":{
"Name":["Alice"],
"Gender":["F"],
"Age":["25-34"],
"Occupation":["academic/educator"],
"Zip-code":["79928"]
}
}
]
]
}
}
}
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 314
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Code
See Error Code.
Function
After you input a vertex, a tree starting from the vertex is output, including nodes
and edges in the tree, and information about reachable paths. Parameters can be
the direction (out, in, and out and in), maximum number of hops, and edge
properties to be filtered.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=query-tree
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Example Request
Post /ges/v1.0/{project_id}/graphs/test/action?action_id=query-tree
{
"executionMode": "sync",
"rootId": "0",
"maxDepth": 20,
"maxVertices": 5000,
"maxEdges": 10000,
"maxDegree": 1000,
"direction": "both",
"labelFilters": [
"edge",
"default"
],
"withVertex": true,
"withEdge": true
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 315
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
NOTE
In asynchronous mode, vertex and edge data is output at the same time. Pagination is not
supported.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 316
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
data Object Query results. For details, see Table 5-224 and
Table 5-225.
This parameter is left blank when the query fails.
vertices List Vertex result set. If no corresponding vertices are found, the
value of vertices is empty.
edges List Edge result set. If no corresponding edges are found, the
value of edges is empty.
jobType Integer Job type. This parameter is left blank when the
request fails.
Example Response
● Synchronous call
Status code: 200
Example response (successful request)
Http Status Code: 200
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 317
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"data": {
"edges" : [
{
"index" : "0",
"label" : "edge",
"properties" : {
"_type" : [ "ACTED_IN" ],
"role" : [ "Neo" ]
},
"source" : "546",
"target" : "0"
},
...
],
"vertices" : [
{
"id" : "546",
"label" : "node",
"properties" : {
"_labels" : [ "Actor" ],
"d" : [ "" ],
"name" : [ "Keanu Reeves" ],
"personId" : [ "keanu" ],
"title" : [ "" ],
"year" : [ "" ]
}
},
...
]
}
}
● Asynchronous call
Status code: 200
Example response (successful request)
{
"jobId": "aca63a57-55f9-4c6e-932f-bcd6b87f7ab4",
"jobType": 1
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 318
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to cyclically perform traversal query based on certain exit
conditions.
For example, the Gremlin statement is as follows:
g.V('a','b').repeat(out('c')).times(2).emit().path()
g.V('label_1').repeat(out('label_2')).emit()
URL
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=repeat-query
Request Parameters
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 319
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 320
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 321
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 322
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
& No No No Yes
| No No No Yes
HAS/HASNOT No No Yes No
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 323
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=repeat-query
{
"executionMode": "async",
"repeat": [
{
"operator": "outV",
"vertex_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "rate"
}
}
}
}
],
"until": [
{
"vertex_filter": {
"property_filter": {
"leftvalue": {
"property_name": "movieid"
},
"predicate": "=",
"rightvalue": {
"value": "1"
}
}
}
}
],
"emit": false,
"vertices": [
"tr_10","tr_11"
]
}
NOTE
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 324
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Response Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 325
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query the general information about a graph, such as the
numbers of vertices and edges.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/summary?
label_details={labelDetails}
Request Parameters
None
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 326
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
data Object Query results. This parameter is left blank when the
request fails.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 327
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query general information about a graph, such as the numbers of vertices and
edges. The value true indicates that the numbers of vertices and edges of
different labels are returned.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/summary?label_details=true
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
● Response example 1 of a successful request (The numbers of vertices and
edges under each label are returned.)
Http Status Code: 200
{
"data": {
"vertexNum": 146,
"labelDetails": {
"labelInVertex": {
"movie": 46,
"user": 100
},
"labelInEdge": {
"default": 450,
"rate": 1209
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 328
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
},
"edgeNum": 1659
}
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 329
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query the graph version.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/version
Request Parameters
None
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 330
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query the graph version.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/version
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"version":"2.0.0"
}
Status Code
Return Value Description
Error Code
See Error Code.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 331
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-graph
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 332
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 333
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 334
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Import a graph. The edge file directory is testbucket/demo_movie/edges/ and
the edge data set format is CSV; the vertex file directory is testbucket/
demo_movie/vertices/ and the vertex data set format is CSV; the OBS path of the
metadata file of the new data is testbucket/demo_movie/
incremental_data_schema.xml and the log storage directory is testbucket/
importlogdir.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-graph
{
"edgesetPath": "testbucket/demo_movie/edges/",
"edgesetFormat": "csv",
"vertexsetPath": "testbucket/demo_movie/vertices/",
"vertexsetFormat": "csv",
"schemaPath": "testbucket/demo_movie/incremental_data_schema.xml",
"logDir": "testbucket/importlogdir",
"parallelEdge": {
"action":"override",
"ignoreLabel":true
},
"delimiter": ",",
"trimQuote": "\"",
"offline": true,
"obsParameters": {
"accessKey": "xxxxxx",
"secretKey": "xxxxxx"
}
}
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 335
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
If you choose to export CSV files to your local host, the files are opened using the
spreadsheet software by default. You are advised to open the files in a text editor. If the
data contains special characters such as plus signs (+), minus signs (-), equal signs (=), and
at signs (@), the data will be parsed into formulas by the software. To ensure system
security, pay attention to the following when opening such files:
1. Do not select Enable Dynamic Data Exchange Server Launch (not recommended).
2. Do not select Enable or Yes if a dialog box indicating a security issue is displayed.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=export-graph
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 336
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 337
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
● Example request
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=export-graph
{
"graphExportPath": "demo_movie/",
"edgeSetName": "set_edge.csv",
"vertexSetName": "set_vertex.csv",
"schemaName": "set_schema.xml",
"obsParameters": {
"accessKey": "xxxxxx",
"secretKey": "xxxxxx"
}
}
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=clear-graph
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 338
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 339
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Clear a graph by deleting its schema data.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=clear-graph
{
"clearMetadata": true
}
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 340
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query the subgraphs formed by the entered vertices and edges
between the vertices.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/subgraphs/action?
action_id=query
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 341
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query the subgraphs formed by the entered vertices and edges between the
vertices. The subgraph vertex IDs are Ray, Ella, and Lethal Weapon.
{
"vertices":[
"Ray",
"Ella",
"Lethal Weapon"
]
}
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data":{
"vertices":[
{
"id":"Ray",
"label":"user",
"properties":{
"Name": ["Ray"],
"Gender":["M"],
"Age":["18-24"],
"Occupation":["college/grad student"],
"Zip-code":["90241"]
}
},
{
"id":"Ella",
"label":"user",
"properties":{
"Occupation":["other or not specified"],
"Name": ["Era"],
"Zip-code":["94402"],
"Gender":["F"],
"Age":["25-34"]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 342
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
}
],
"edges":[
{
"source":"Ray",
"target":"Lethal Weapon",
"index":"1",
"label":"rate",
"properties":{
"Score":[2],
"Datetime":["2000-11-22 19:16:16"]
}
},
{
"index":"0",
"source":"Ella",
"label":"rate",
"properties":{
"Score":[5],
"Datetime":["2000-11-23 02:30:29"]
},
"target":"Lethal Weapon"
},
{
"index":"5",
"source":"Ella",
"label":"friends",
"properties":{},
"target":"Ray"
}
]
}
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 343
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Introduction
This API is used to adjust the subgraph creation type based on the input and
executes an algorithm on the generated subgraph.
URL
POST /ges/v1.0/{project_id}/graphs/{graph_name}/subgraphs/action?
action_id=execute-algorithm
Parameters
Paramet Mandator Type Description
er y
project_i Yes String Project ID. For details about how to obtain
d the project ID, see Obtaining a Project
ID.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 344
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 345
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Execute a specific algorithm on a generated subgraph. The algorithm name is
connected_component, and the subgraph generator type is filtered.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/subgraphs/action?
action_id=execute-algorithm
{
"algorithmName":"connected_component",
"subgraphCreator": {
"name": "filtered",
"parameters": {
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "PHYSICAL_LINK"
}
}
}
}
},
"parameters":{
"num_thread":4
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 346
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query the execution status of a job. After asynchronous APIs
such as those for querying vertices and edges or executing algorithms are used,
job IDs are returned. You can use the job ID to query the execution status of a job.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?
offset=offset&limit=limit
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 347
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 348
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query the execution status of a job. The query offset is 0, and the maximum
number of returned results is 2.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?offset=0&limit=2
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 349
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"data_offset": 0,
"data_total_size": 19
}
},
"status": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to cancel a job that has been submitted.
NOTE
Only jobs returned by the following APIs can be canceled: exporting a graph, importing a
graph, querying vertices that meet filter criteria, querying edges that meet filter criteria,
edge filtering query, Filtered-query V2, executing an algorithm, and adding an index.
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 350
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
For details, see the URI parameters.
Response Parameters
Example Request
Cancel a job that has been submitted.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 351
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"errorCode": "GES.8303"
}
Status Code
Return Value Description
Error Code
See Error Code.
Function
This API is used to export the execution result (result) of an asynchronous job
(jobId) to a file.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 352
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?
action_id=export-result
project_i Yes String Project ID. For details about how to obtain the
d project ID, see Obtaining a Project ID.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 353
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 354
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● When the pagination function is enabled, the file name is named as follows:
If enable in the paginate parameter is set to true, fileName indicates a
directory. Files in the directory are named using the combination of the thread
ID and file number, and are separated by a period (.). For example, for 3.2
million data records, the examples of the first and last file names in different
configurations are as follows:
numThread 2 48 2 5 2
Threads 2 32 2 4 1
Actually Used
Files Generated 16 1 2 1 1
by a Single
Thread
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 355
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
● Example request 1: Export the execution results of an asynchronous job to an
OBS file. The export path is demo_movie/. The name of the exported file is
louvain. After the export, the original job is deleted.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result
{
"exportPath": "demo_movie/",
"fileName": "louvain",
"erase": true,
"obsParameters": {
"accessKey": "xxxx",
"secretKey": "xxxx"
}
}
● Example request 2: Export the execution result of an asynchronous job to an
OBS file. The export path is demo_movie/. The name of the exported file is
louvain. By default, pagination is disabled. When data is exported by page,
the maximum number of rows in each file is 100,000.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result
{
"exportPath": "demo_movie/",
"fileName": "louvain",
"paginate":{
"enable":true,
"numThread":2,
"rowCountPerFile":100000
},
"obsParameters": {
"accessKey": "xxxx",
"secretKey": "xxxx"
}
}
NOTE
Currently, Cypher statements can only be used to export common value types, such as
attribute values, numbers, and strings, but not composite value types (such as lists
and maps), vertices, or edges. For example:
● The results of the following statements can be exported:
match (n) return id(n) limit 10
match (n) return n.age, n.occupation
match (n)-[r]->(m) return n.Rating limit 10
unwind [1,2,3] as p return p
● The exported CSV file contains null values or blank lines because the results of the
following statements contain objects or compound values:
return [1,2,3], {a:1}
match (n) return n limit 10
match (n)-[r]->(m) return r limit 10
Example Response
Status code: 200
Example response (successful request)
HttpStatusCode: 200
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 356
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Result:
#data_total_size:1209
#data_return_size:1209
#data_offset:0
#records:
Vivian, artist, 25-34, 5, Lethal Weapon
Vivian, Artist, 25-34, 4, Raising Arizona
Mercedes, K-12 student, Under 18, 3, Lethal Weapon
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 357
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
– Example 2
Query statement:
match (n)-->(m) where id(n)='Vivian' return labels(m),count(*)
Result:
#data_total_size:2
#data_return_size:2
#data_offset:0
#records:
user,5
movie,2
Function
After the ID of an asynchronous job is returned, if the job ID at the service layer is
lost and cannot be obtained through the API, a new API is provided to query all
asynchronous jobs stored in the engine. The job ID, job status, and original request
of each job are returned.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/status?
limit={limit}&offset={offset}
project_i Yes String Project ID. For details about how to obtain the
d project ID, see Obtaining a Project ID.
Request Parameters
For details, see the URI parameters.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 358
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query the job list and return the job ID and status of each job.
GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/status?limit={limit}&offset={offset}
Example Response
Status code: 200
Example response for a successful request
{
"jobs": [
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 359
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"jobId": "527e0c2e-57ee-4c23-8cf7-baff8049c6b9001234245",
"rawRequest": "{\"graphName\":\"ges_yiwan_jimengke\",\"offline\":false,\"edgesetPath\":\"/
user/ges/data/ranking_edge.csv\",\"vertexsetPath\":\"/user/ges/data/movies_vertex_new.csv\",\"delimiter
\":\",\",\"trimQuote\":\"\\\"\",\"vertexsetFormat\":\"csv\",\"parallelEdge\":{\"ignoreLabel\":true,\"action
\":\"allow\"},\"edgesetFormat\":\"csv\"}",
"taskType": "ImportGraph",
"canStop": false,
"progress": "100",
"files": [
{
"edgeFiles": [
{
"fileName": "/user/ges/data/ranking_edge.csv",
"totalLines": 1659,
"startTime": 1707201116130344,
"successfulLines": 1659,
"endTime": 1707201116149714,
"status": "success",
"failedLines": 0
}
]
},
{
"vertexFiles": [
{
"fileName": "/user/ges/data/movies_vertex_new.csv",
"totalLines": 146,
"startTime": 1707201115842346,
"successfulLines": 146,
"endTime": 1707201115876634,
"status": "success",
"failedLines": 0
}
]
}
],
"startTime": "2024-02-06 14:31:55",
"endTime": "2024-02-06 14:31:56",
"status": "success"
},
{
"jobId": "9d43e7a1-bfc5-4990-b494-01c31098523e001234245",
"rawRequest": "{\"graphName\":\"ges_yiwan_jimengke\",\"offline\":false,\"edgesetPath
\":\"\",\"vertexsetPath\":\"\",\"delimiter\":\",\",\"schemaPath\":\"/user/ges/data/movie_schema.xml
\",\"trimQuote\":\"\\\"\",\"vertexsetFormat\":\"csv\",\"parallelEdge\":{\"ignoreLabel\":true,\"action\":\"allow
\"},\"edgesetFormat\":\"csv\"}",
"taskType": "ImportGraph",
"canStop": false,
"progress": "100",
"files": [
{
"schemaFiles": [
{
"totalLabels": 4,
"fileName": "/user/ges/data/movie_schema.xml",
"failedLabels": 0,
"startTime": 1707201113260909,
"successfulLabels": 4,
"endTime": 1707201113369960,
"status": "success"
}
]
}
],
"startTime": "2024-02-06 14:31:45",
"endTime": "2024-02-06 14:31:53",
"status": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 360
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
],
"jobCount": 2
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to perform a specified custom operation.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
operation
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 361
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Example Request
Perform a specified custom operation. The API used for the custom operation is
gremlin, and the command is {\"command\": \"g.V('1')\"}.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 362
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-operation
{
"api": "gremlin",
"command": "{\"command\": \"g.V('1')\"}"
}
Example Response
Status code: 200
Status Code
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 363
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Code
See Error Code.
Function
Cypher is a widely used declarative graph database query language. It can be used
to query data in GES and returns results. Graph statistics are used in Cypher
implementation. Currently, the label-based vertex and edge indexes are used
during Cypher query and compilation. To use Cypher normally, create indexes by
referring to Cypher Prerequisites.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
cypher-query
Example Request
Execute a Cypher query. The Cypher statement is match (n) return n limit 1. The
returned results are in the format that each element corresponds to a field in the
row.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-cypher-
query
{
"statements": [{
"statement": "match (n) return n limit 1",
"parameters": {},
"resultDataContents": ["row"],
"includeStats": false
}]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 364
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 365
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● You can add the explain and profile prefixes before the statement to display the query
plan.
● explain displays only the query plan but does not execute the statement.
● profile displays the query plan and executes the statement.
● In asynchronous mode (executionMode is async), cypher query results can be exported
to CSV files (GES 2.3.4 or later supports this function). For details, see Exporting Job
Execution Results to Files. Currently, the following values can be returned:
1. Vertex and edge single-value properties, vertex and edge IDs, and group counts.
2. The current version does not support exporting object types. Objects are converted
to null values in the CSV file.
Response Parameters
errors List Each element in the list contains the code and
message information in string form.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 366
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 367
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response for a successful request (synchronous call)
Http Status Code: 200
{
"results": [
{
"columns": ["n"],
"data": [
{
"row": [
{
"occupation": "artist",
"gender": "F",
"Zip-code": "98133",
"userid": 0,
"age": "25-34"
}
],
"meta": [
{
"id": "46",
"type": "node",
"labels": [
"user"
]
}
]
}
],
"stats": {
"contains_updates": false,
"edges_created": 0,
"edges_deleted": 0,
"labels_set": 0,
"properties_set": 0,
"vertices_created": 0,
"vertices_deleted": 0
}
}
],
"errors": []
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 368
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 369
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● Example command for adding a vertex label index. The index name is
cypher_vertex_index, and the index type is global vertex index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
{
"indexName": "cypher_vertex_index",
"indexType": "GlobalCompositeVertexIndex",
"hasLabel": "true",
"indexProperty": []
}
● Example command for adding an edge label index. The index name is
cypher_edge_index, and the index type is global edge index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
{
"indexName": "cypher_edge_index",
"indexType": "GlobalCompositeEdgeIndex",
"hasLabel": "true",
"indexProperty": []
}
NOTE
1. You do not need to create the indexes if the graph is of the 100-million-edge, 1-billion-
edge, or 10-billion-edge types. (The GES version must be 2.3.6 or later.)
2. If you need to create indexes, you must create both two indexes (vertex label index and
edge label index) at the same time to use Cypher for query.
3. If your graph already has a vertex index or an edge index whose hasLabel is true and
indexProperty is empty, you do not need to create the vertex index or edge index again.
4. The API for creating an index is asynchronous. To check whether the index is successfully
created, use the API for querying job status.
5. If fine-grained permissions are used, a member account must have the schema
permission and the read permission on all labels (including the default label
__DEFAULT__) to create indexes. Otherwise, after an index is created, you need to use
an account with the required permissions to send call db.schema() to update the
compiler cache of Cypher queries.
Basic Operations
Operation Cypher Statement
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 370
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Compatibility to Cypher
1. Cypher clauses
Cypher implements a couple of clauses. You can combine clauses to
implement different query semantics, including vertex and edge filtering,
multi-hop query, sorting and deduplication, and grouping and aggregation.
Currently, GES supports the Cypher clauses listed in the following table.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 371
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
1. Currently, merge and foreach operations are not supported. Cypher statements
cannot add or delete indexes.
2. GES metadata is not schema-free, and the vertex and edge label properties are
strictly restricted. Therefore, the remove operation is not supported.
3. The order by clause does not support sorting of the list type. When Cardinality of
the property value is not single, the sorting result is unknown.
– Available items for the match clause
Item Description Example Clauses Earliest
Version
Require
d
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 372
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Multi- You can enter multiple match clauses. You can 2.2.16
match use with to connect multiple clauses.
match (n)-[r]->(m) with m match (m)-->(s)
2. Parameterized queries
Cypher supports parameterized queries. Numeric and string values in a query
statement are extracted and converted to parameters for faster compilation,
improving the query speed.
There are some examples of parameterized queries:
– Example 1
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?
action_id=execute-cypher-query
{
"statements": [{
"statement": " match (n:user) where n.occupation = $occupation return n",
"parameters": {
"occupation" : "artist"
},
"resultDataContents": ["row"]
}]
}
– Example 2
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 373
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?
action_id=execute-cypher-query
{
"statements": [{
"statement": " match (n:user {`Zip-code`:'98133'}) set n = $props return n",
"parameters": {
"props": {
"gender": "M",
"age": "56+"
}
},
"resultDataContents": ["row"]
}]
}
NOTE
There are some scenarios where parameterized queries are not supported. The
following syntax is not valid:
1. Using $param to search by property key and value. For example, match (n) where
n.$param = 'something'
2. Using $code for vertex and edge labels. For example, match (n:user) set n:$code
3. Supported data types
Currently, GES supports 10 data types: char, char_array, float, double, Boolean,
long, Integer, date, enum, and string. Both Boolean and numeric types are
supported in the Cypher syntax. The following table lists the mapping
between other types and Cypher data types.
char String -
char_arra String -
y
string String -
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 374
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Point, No -
Spatial
NOTE
For the special types listed above, only the List type can be used to match multi-value
properties in GES. Other types cannot be used in a set statement for setting the value
of a property.
4. Vertex ID compatibility
– Cypher does not provide the syntax for setting the ID when a vertex is
added. In GES, however, an ID of the string type is required to uniquely
identify a vertex. To use the Cypher syntax in GES, add _ID_ to specify the
ID of a vertex in the create statement. For example, the
create(n{_ID_:'123456'}) statement creates a vertex whose ID is 123456.
– If the ID is not specified, a random ID is generated for the vertex.
NOTE
The _ID_ identifier is supported only in the create statement. The match and set
clauses do not support the _ID_ identifier. In the match clause, you can use the
id() function to obtain the vertex ID.
Expression
Cypher queries support multiple expressions and can be used in combination to
form various filter criteria. Currently, the following expressions are supported.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 375
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Date expressions .year, .mont Year, month, and day of a specific date: with
(2.3.10) h, .day, .hou '2000-12-27 23:44:41' as strVal with
r, .minute, .s datetime(strVal) as d2 return d2.year,
econd, .day d2.month, d2.day, d2.hour, d2.minute,
OfWeek d2.second,d2.dayOfWeek, d2.ordinalDay
NOTE
The where clause in Cypher queries does not support regular expressions.
Function
Cypher supports the following functions for grouping, aggregation, and vertex and
edge operations:
1. Aggregate
Aggregate functions count and collect are supported.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 376
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
2. Regular functions
Based on the types of input parameters, regular functions are classified into
vertex and edge functions, path functions, list functions, and value functions.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 377
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 378
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 379
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 380
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 381
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 382
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Degree functions, path operation functions, and algorithm expressions are not available if
the graph size is ten-billion-edge.
Procedure
Currently, GES supports the following procedures.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 383
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Procedure Statement
NOTE
● Full-text indexes support six types of queries: prefix, wildcard, regexp, fuzzy, match, and
combine. To use full-text indexes, you need to call the API for creating a full-text index.
● Function and procedure names are case sensitive and must be in lower camel case.
● Example of a full-text index query request
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
cypher-query
{
"statements": [
{
"statement": "call db.index.fulltext.queryNodes('combine', {title:'1977'}) yield node, score
return node, score skip 1 limit 10",
"resultDataContents": [
"row"
],
"parameters": {}
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 384
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
You can call the db.schema () function using Cypher to query the structure of
a generated schema (obtained from OBS).
● Query statement
– Name: Schema structure query
– Statement: call db.schema()
– Note:
If you did not call the API for generating the schema structure, the
returned schema file contains all labels.
If you have called the API for generating the schema structure, this API
returns the labels as the vertices and the relationships between the labels
as edges.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=filtered-query
Request Parameters
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 385
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 386
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 387
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 388
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
leftvalue Yes String Left value. For details about the formats, see
Table 5-300.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 389
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
rightvalue Yes String Right value. For details about the formats,
see Table 5-301.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 390
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
& No No No Yes
| No No No Yes
HAS/HASNOT No No Yes No
CONTAIN/ No No Yes No
NOTCONTAIN
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 391
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● The left value set is supported. The left value in the body is a string.
● The right value set is supported. If you select No, only the first character string in the set
is matched even if the right value set is supported.
● Boolean value matching. When the right value is true, the value is identified as true for
matching. Otherwise, the value is identified as false for matching.
Response Parameters
● Synchronous response
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 392
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
edges List Edge result set. If the last layer of filters is edge
filtering, the data contains edges.
● Asynchronous response
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 393
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
jobType Integer Job type. This parameter is left blank when the
request fails.
Example Request
● (Synchronous mode) List the kth-hop vertices or edges that meet filter
criteria. The execution mode is synchronous. Visualization is not performed.
That is, job query results are displayed on multiple pages.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=filtered-query
{
"executionMode": "sync",
"visualized": "false",
"filters": [
{
"operator": "outV"
},
{
"operator": "out",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "rate"
}
}
}
}
],
"full_path": false,
"vertices": [
"tr_10"
]
}
● (Asynchronous mode) List the kth-hop vertices or edges that meet filter
criteria. The execution mode is asynchronous. Visualization is not performed.
That is, job query results are displayed on multiple pages.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 394
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=filtered-query
{
"executionMode": "async",
"visualized": "false",
"filters": [
{
"operator": "outV"
},
{
"operator": "out",
"edge_filter": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "rate"
}
}
}
}
],
"full_path": false,
"vertices": [
"tr_10"
]
}
● property_filter is nested. List the kth-hop vertices or edges that meet filter
criteria. The execution mode is synchronous. Visualization is not performed.
That is, job query results are displayed on multiple pages.
{
"executionMode": "sync",
"filters": [
{
"operator": "outV",
"vertex_filter": {
"property_filter": {
"leftvalue": {
"property_filter": {
"leftvalue": {
"property_name": "genres"
},
"predicate": "PREFIX",
"rightvalue": {
"value": "A|"
}
}
},
"predicate": "&",
"rightvalue": {
"property_filter": {
"leftvalue": {
"label_name": "labelName"
},
"predicate": "=",
"rightvalue": {
"value": "movie"
}
}
}
}
}
}
],
"vertices": [
"tr_3"
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 395
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
]
}
Example Response
● Synchronous response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data": {
"edges": [
{
"index": "1",
"source": "tr_1",
"label": "rate",
"properties": {
"Rating": [
0
],
"Datetime": [
""
]
},
"target": "tr_3"
},
......,
{
"index": "199998",
"source": "tr_1",
"label": "rate",
"properties": {
"Rating": [
0
],
"Datetime": [
""
]
},
"target": "tr_200000"
}
]
}
}
● Asynchronous response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "6622f13c-4b88-45f5-89a9-eaa096647c4a",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 396
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
5.1.16 Filtered-query V2
Function
This is a new version of the Filtered Query API. This API supports both Filtered
Query and Repeat Query functions.
NOTE
You can use this API to accelerate multi-hop filtered query and looped traversal query.
For example, a Gremlin query like this:
g.V('node1').repeat(out('label_2')).emit()
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=path-query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 397
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 398
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 399
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
operator Yes String Type of the query. The value can be inV
(incoming vertex), outV (outgoing vertex),
and bothV (incoming and outgoing vertices).
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 400
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 401
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
rightvalue Yes String Right value. For details about the format, see
rightvalue elements.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 402
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
& No No No Yes
| No No No Yes
HAS/HASNOT No No Yes No
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 403
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
● Synchronous response
● Asynchronous response
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 404
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
● Example request 1: List the kth-hop vertices or edges that meet filter criteria.
The query type is outgoing vertex, and the query is performed on the next-
hop vertex.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=path-query
{
"repeat":[
{
"operator":"outV",
"vertex_filter":{
"property_filter":{
"leftvalue":{
"label_name":"labelName"
},
"predicate":"=",
"rightvalue":{
"value":"rate"
}
}
}
}
],
"times":2,
"vertices":[
"1","2"
]
}
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 405
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
},
"predicate":"=",
"rightvalue":{
"value":"rate"
}
}
}
}
],
"until":[
{
"vertex_filter":{
"property_filter":{
"leftvalue":{
"property_name":"movieid"
},
"predicate":"=",
"rightvalue":{
"value":"1"
}
}
}
}
],
"vertices":[
"v1","v2"
]
}
NOTE
Example Response
● Synchronous response
Status code: 200
Example response (successful request)
{
"data":{
"vertices":[
{
"id":"51",
"label":"user",
"properties":{
"occupation":[
"homemaker"
],
"gender":[
"F"
],
"Zip-code":[
"46911"
],
"userid":[
5
],
"age":[
"56+"
]
}
}
]
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 406
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● Asynchronous response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "6622f13c-4b88-45f5-89a9-eaa096647c4a",
"jobType": 1
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to provide flexible and controllable DSLs to help users design and
run algorithms at low costs. For details about the DSL algorithm, see DSL Syntax.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 407
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=algorithm-
query
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 408
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=algorithm-query
{
"commands":"Match<Vertex> v(['1']); v.repeat(bothV()).limit(2); return v;"
}
Example Response
● Example response for a successful request
Status code: 200
OK
{
"data":{
"vertices":[
{
"id":"1",
"label":"movie",
"properties":{
"genres":[
"Comedy"
],
"movieid":[
1
],
"title":[
"Airplane! (1980)"
]
}
}
],
"runtime":0.126476598
}
}
Return Value
● Normal
200
● Abnormal
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 409
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Syntax Introduction
The Algorithm query API is a graph DSL provided by GES. You can use it to query
and calculate graphs. During service planning, various query operators and fine-
grained basic computing pattern operators are added to DSL so that DSL can
support user-defined graph traversal, multi-hop filtering query, pattern matching,
similarity algorithms, community algorithms, recommendation algorithms, path
analysis, and custom service algorithms.
For example, to query the neighborhood vertex set of the second hop from
vertices 1 and 2, run the following command:
Match<Vertex> v(['1','2']); v.repeat(bothV()).times(2).limit(3); return v;
NOTE
Currently, only the following selection and loop statements are supported, which are
written in selection, loop, and lambda expressions:
1. Assignment/aggregation of various expressions
2. Update operator of the Vertex matcher
3. Gather operator of the Vertex matcher
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 410
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 411
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
1. Select statement: if
if(expression) {
true Branching statement
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 412
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
return g1;
{
"data": {
"value": 10
}
}
Assume that you want to obtain the guidance subgraph of a match vertex set
for subsequent task execution (for example, drawing on the canvas).
Match<Vertex> v(['1','2']);
return v.subgraph();
{
"data": {
"vertices": [
{
"id": "1",
"label": "user",
"properties": {
//balabala
}
},
{
"id": "2",
"label": "movie",
"properties": {
//balabala
}
}
],
"edges": [
{
"index": "0",
"source": "1",
"label": "rate",
"properties": {
//balabala
},
"target": "2"
}
]
}
}
4. Expression statement
An expression is a sequence of operators and operands, which specifies a
calculation. Different statements may use expressions. For example, loop
statements and selection statements may use expressions to express branches
or loop conditions. Expressions can also be used to assign values to variables
and perform aggregation operations.
– The following table lists common operators:
Assignment a=b; =
Aggregation a+=b +=
Mathmetical a+b;a-b;a*b;a/b +, -, *, /
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 413
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
– Expression types
Due to the particularity of variables (different types of aggregators), DSL
classifies expressions into the following types:
i. numeric expression - Numerical expression
ii. vertexacc expression - Expression containing the vertexacc variable
iii. globalacc expression - Expression containing the globalacc variable
1+2*3 // Numerical expression
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 414
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Variable Declaration
Match matcher
1. Match matcher description
DSL allows you to define objects such as vertices, paths, and submaps that
can be matched and on which related operations can be performed. After
declaring and initializing the matcher, you can use the matcher operator to
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 415
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
perform operations on vertex sets in batches. For details, see Match matcher
operators. Run the following statement to declare and initialize the matcher:
Match<[Vertex|Path|Subgraph]> $variable;
DSL allows you to define vertices, paths, and submaps that can be matched
and on which related operations can be performed.
Match<Vertex> Quickly match and perform operations on vertices
Aggregator
1. Aggregator description
Aggregators are used to simplify the expression of values during calculation.
Different types of aggregators define different scopes of batch aggregation
operations.
NOTE
DSL does not support direct definition of variables of various numeric types to carry
data generated during calculation. Instead, DSL provides aggregators to simplify
operations in various application scenarios.
1. VertexAcc can be used to define additional "properties (variables)" on vertices, and
Match<Vertex> can be used to perform operations on additional variables on
vertices in batches.
2. GlobalAcc can be used to define globally operable variables.
Aggregator declaration syntax:
Accumulator<Aggregator Operator, NumericType> v;
Parameter description:
NumericType: int, (float and double types are not supported currently)
Aggregator Operator: Sum,Max,Min
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 416
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 417
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
alpha = beta*2+3;
// alpha = beta x 2 + 3 = 10 x 2 + 3 = 23
Operator Introduction
Match matcher operators
After a Match matcher is defined, different operation operators, such as repeat,
gather, update, and pattern, can be used to assist graph calculation and query.
The operation operator varies with the match type.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 418
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● repeat
It allows you to perform multi-hop filtering query. The syntax of repeat is
similar to that of repeat in Gremlin. Its semantic expression ability is rich,
especially suitable for relational link query.
For example, if a two-hop query of filtering name=peter is executed from
vertex (1,2) to the outgoing direction, it may be expressed in Gremlin as:
g.V('1','2').repeat(out().has('name','peter')).times(2).emit().dedup()
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 419
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Step Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 420
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
● update
$match_vertex.update($lambda_func);
The update operator is used to define a group of batch operations on the
matcher. Currently, only Match<Vertex> is supported.
The Update operation on Match<Vertex> applies all operations defined in the
input lambda function to the vertices matched by Match.
The vertex matcher Match<Vertex> receives only lambda expressions that
contain one input parameter.
Match<Vertex> v(['1',2']);
VertexAcc<Max,int> acc=1;
GlobalAcc<Sum,int> g=0;
v.update( (v1)->{g+=v1.acc*2;} ); //g='1'.acc*2+'2'.acc*2=1*2+1*2=4
return g; // Return g = 4;
● gather
$match_vertex.gather($lambda_func);
The gather operator is used to define a group of batch operations on the
matcher. Currently, only Match<Vertex> is supported.
– gather of Match<Vertex>
The Gather operation on Match<Vertex> applies all operations defined in
the input lambda function to the edges of the vertices matched by
Match.
The vertex matcher Match receives only lambda expressions that contain
two input parameters. The first parameter indicates the source vertex on
the edge, and the second parameter indicates the target vertex on the
edge.
Match<Vertex> v(['1',2']);
VertexAcc<Max,int> acc=1;
GlobalAcc<Sum,int> g=0;
v.gather( (s,t)->{g+=s.acc*2+t.acc;} ); // This operation takes effect on the edges of vertices 1
and 2. That is, 1-2, 1-3, 2-3, 2-1.
//g=g + 1.acc*2+2.acc + 1.acc*2+3.acc + 2.acc*2+1.acc + 2.acc*2+3.acc
//g=0 + 3 + 3 + 3 + 3=12
return g;
● pick
$match_vertex.pick(n);
pick allows you to randomly select N vertices from Match<Vertex>. This
function helps you quickly obtain N random vertices.
Match<Vertex> v();
v.pick(10); // Select 10 vertices randomly from v.
return v; // Return information about 10 random vertices.
● init(2.3.12)
$match_vertex.init([vertex_list]); // Specify the vertex ID list.
$match_vertex.init(vertexid); // Specify a single ID.
Resets the vertex set of the vertex matcher.
Match<Vertex> v(['1','2']);
return v;// Return information about vertices 1 and 2.
Match<Vertex> v(['1','2']);
v.init(['3','4']);
return v;// Return information about vertices 3 and 4.
● insert(2.3.12)
$match_vertex.insert([vertex_list]); // Specify a list of vertex IDs.
$match_vertex.insert(vertexid); // Specify a single ID.
Adds a matching vertex set to the vertex matcher.
Match<Vertex> v(['1','2']);
return v;// Return information about vertices 1 and 2.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 421
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Match<Vertex> v(['1','2']);
v.insert(['3','4']);
return v;// Return information about vertices 1, 2, 3, and 4.
● move(2.3.12)
$match_vertex.move(other_match_vertex);
Quickly moves the vertex set in other_match_vertex to the match_vertex
matcher This operator can assign a value to another matcher by one matcher,
but does not produce a replication result. Instead, it is similar to the move
semantics in C++, that is, moving the original matcher vertex set to the new
matcher. After the operation, the original matcher vertex set is cleared.
Match<Vertex> v1(['1','2']);
Match<Vertex> v2(['3','4']);
v1.move(v2);//v1=[3,4],v2=[]
return v1;// Return information about vertices 3 and 4.
● subgraph(2.3.12)
$match_vertex.subgraph();// Return guidance subgraphs of the matcher vertex set.
$match_vertex.subgraph(filter_step);// Return guidance subgraphs of the matcher vertex set with
edge filtering.
It is mainly used in the return statement. It can return the induced subgraph
of the match_vertex vertex matcher.
When obtaining a subgraph, you can set the filter criterion filter_step on the
edge. For details about the syntax, see the filter operator in repeat.
Match<Vertex> v(['1','2']);
return v.subgraph();// Return vertices 1 and 2 as well as the edge set between vertices 1 and 2.
Match<Vertex> v(['1','2','3']);
return v.subgraph(has(year, 2022));// Return vertices 1 and 2 as well as the edge set between vertices
1 and 2.
● Set basic operations (2.3.12)
Set operations can be performed on objects in each matcher, such as union
and intersection.
intersection (2.3.12)
Match<Vertex> start(['1','2']);
Match<Vertex> target(['2']);
Match<Vertex> set;
start.intersection(target);
return start;// Return vertex 2.
● Pattern Matching: pattern (2.3.11)
DSL uses the Cypher syntax to express pattern matching, such as vertex set,
path, and subgraph matching.
Statements that support Cypher:
Statement Supported or Not
limit(2.3.11) Supported
return(2.3.11) Supported
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 422
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Match<Vertex> v;
v.pattern('match (n:user) where n.age>30 return n limit 10');
The pattern is a complete Cypher statement, which filters 10 vertices and
returns them to Match<Vertex>.
String in Cypher
The pattern syntax contains a complete Cypher statement in single quotation
marks. When a string to be expressed, such as an ID or property value,
appears in the Cypher statement, double quotation marks are required.
When using REST APIs to call DSL, you need to add the escape character \ to
the double quotation marks. For example:
Match<Vertex> v;
v.pattern('match (n) where id(n)=\"12\" return n');
return v;
NOTE
To prevent failures in restoring the updated graph data during system restarting, do not
delete the data stored on OBS when the graph is in use.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-
properties
Example Request
Import a file to update specified properties of vertices and edges. The vertex file
directory is datasets/movie/movie.csv, and the vertex data set format is CSV. The
edge file directory is datasets/movie/ranking_edge.csv, and the edge data set
format is CSV.
POST http://Endpoint/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-properties
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 423
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"vertexsetPath": "datasets/movie/movie.csv",
"vertexsetFormat": "csv",
"vertexProperties": [
{
"label": "movie",
"properties": [
"genres"
]
}
],
"edgesetPath": "datasets/movie/ranking_edge.csv",
"edgesetFormat": "csv",
"edgeProperties": [
{
"label": "rate",
"properties": [
"Datetime"
]
}
],
"targetProperties": [
{
"label": "rate",
"properties": [
"Rating"
]
}
],
"delimiter": ",",
"trimQuote": "\"",
"obsParameters": {
"accessKey": "XXXXXXX",
"secretKey": "XXXXXXX"
},
"vertexFileContainLabel": true
}
Request Parameters
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 424
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 425
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 426
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete vertices and edges by reading the files.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=delete-by-file
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 427
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete vertices and edges by reading files. The vertex file directory is datasets/
movie/movie.csv, and the vertex data set format is CSV. The edge file directory is
datasets/movie/ranking_edge.csv, and the edge data set format is CSV.
POST http://Endpoint/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=delete-by-file
{
"vertexsetPath": "datasets/movie/movie.csv",
"vertexsetFormat": "csv",
"edgesetPath": "datasets/movie/ranking_edge.csv",
"edgesetFormat": "csv",
"targetProperties": [
{
"label": "rate",
"properties": [
"Rating"
]
}
],
"delimiter": ",",
"trimQuote": "\"",
"obsParameters": {
"accessKey": "XXXXXXX",
"secretKey": "XXXXXXX"
}
}
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 428
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 429
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 430
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
NOTE
This feature can be enabled only when the deployment mode is ECS+MRS. (MRS version:
3.3.1-LTS)
URI
● URI format
POST /ges/v1.0/{project_id}/graphs/{graph_name}/conversations
● Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 431
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request
Response
● Successful response parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 432
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 433
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
The returned result depends on the executed Gremlin statement. Therefore, there is a
possibility that the fields in the returned result are empty.
id String Entity ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 434
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example
● Example Request
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/conversations
{
"query": "What is the release time of the disaster adventure?"
}
● Example Response
– Example of a successful response
{
"answer": "The disaster adventure was released on December 4, 1960.",
"frame": [
{
"formatted_question": "When is [release time] of [disaster adventure] => [disaster adventure]
[release time]",
"match_type": "SYS_TEMPLATE",
"template_id": "e35cb3a8-0c20-48f8-94d2-a2ae635412e6",
"template_name": "xx attribute of xx entity",
"template_score": 0.7400000095367432,
"query": "g.V('6078981978916491674').valueMap ('name','Release time').path()",
"result": {
"vertices": [
{
"id": "6078981978916491674",
"label": "Movie"
}
],
"runtime": 0.163641278,
"results": [
{
"name": [
"Disaster adventure"
],
"Release time": [
"4 December 1960"
]
}
]
},
"answer": "The disaster adventure was released on December 4, 1960."
}
],
"session_id": "a8dbb6ce-a9ed-4bc9-b219-caaa5bbe7b1c"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 435
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Data Types
Type Description
char Character
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 436
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Type Description
Function
This API is used to query the vertex information (such as the label and property)
based on the vertex ID.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/detail?
vertexIds={vertex_ids}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 437
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 438
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query node information by node ID and return node details.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/detail?vertexIds=Ray
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example of a successful response
Http Status Code: 200
{
"data": {
"vertices": [
{
"id": "46",
"labels": [
"user"
],
"properties": {
"user": {
"userid": [
0
],
"gender": [
"F"
],
"age": [
"25-34"
],
"occupation": [
"artist"
],
"Zip-code": [
"98133"
]
}
}
}
]
},
"result": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 439
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query the vertex data (such as the labels and properties) in
batches based on the vertex IDs.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-query
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 440
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
vertices Yes String Vertex IDs you use to query the vertices
Response Parameters
Example Request
Query nodes in batches by node ID. The vertex IDs to be queried are
27003509_Station Building and 39636392_Badaling Great Wall.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-
query
{
"vertices":
["0","1"]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 441
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data": {
"vertices": [
{
"id": "0",
"labels": [
"movie"
],
"properties": {
"movie": {
"movieid": [
0
],
"title": [
"American Beauty (1999)"
],
"genres": [
"Comedy|Drama"
]
}
}
},
{
"id": "1",
"labels": [
"movie"
],
"properties": {
"movie": {
"movieid": [
1
],
"title": [
"Airplane! (1980)"
],
"genres": [
"Comedy"
]
}
}
}
]
},
"result": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 442
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to add vertices in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-add
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 443
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 444
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Add vertices in batches. The names of the vertices to be added are 150 and 6.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-add
{
"vertices": [
{
"vertex": "150",
"label": "movie",
"properties": {
"movieid": [
"150"
],
"title": [
"testmoive"
],
"genres": [
"Comedy"
]
}
},
{
"vertex": "6",
"label": "movie",
"properties": {
"movieid": [
"6"
],
"title": [
"testmoive_exist_id"
],
"genres": [
"Comedy"
]
}
}
],
"overrideExists": true
}
NOTE
● SERVER_URL: Address for accessing a graph. For details about its value, see Using
Service Plane APIs.
● In the example, if vertex 6 already exists in the graph, properties of vertex 6 are
overwritten.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 445
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete vertices in batches based on the vertex IDs.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?
action_id=batch-delete
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 446
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Example Request
Delete nodes in batches by node ID. The vertex IDs to be deleted are Vivian and
46.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/action?action_id=batch-
delete
{
"vertices": [
"Vivian",
"46"
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 447
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to update vertex properties in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/vertices/properties/action?
action_id={actionId}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 448
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 449
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Update vertex properties in batches. The vertex names to be updated are 150 and
6.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/vertices/properties/action?
action_id=batch-update
{
"vertices": [
{
"vertex": "150",
"label": "movie",
"properties": {
"movieid": [
"150"
],
"title": [
"testmoive"
],
"genres": [
"Comedy"
]
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 450
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
}
},
{
"vertex": "6",
"properties": {
"title": [
"testmoive_exist_id"
],
"genres": [
"Comedy"
]
}
}
],
"ignoreError": true
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 451
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query the detailed information about an edge based on the
source vertex, target vertex, and index of the edge. Information about edges and
properties is returned.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?
source={sourceVertex}&target={targetVertex}&label={label}&sortKey={sortKey}&sortKeyType={sortKeyType}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 452
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query details about an edge.
GET/ges/v1.0/{project_id}/graphs/{graph_name}/edges/detail?
source=46&target=39&label=rate&sortKey=5&sortKeyType=int
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 453
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 454
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query the detailed information about edges in batches based
on the source vertices, target vertices, and indexes of the edges. Information about
edges and properties is returned.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
query
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 455
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query details about edges in batches based on the source vertex, target vertex,
and index. The source vertex of the edges to be queried is Vivian.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
query
{
"edges": [
{
"source": "Vivian",
"target": "Lethal Weapon",
"label": "rate"
},
{
"source": "Vivian",
"target": "Raising Arizona"
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 456
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"data": {
"edges": [
{
"source": "Vivian",
"target": "Raising Arizona",
"label": "rate",
"properties": {
"Score": [
4
],
"Datetime": [
"2000-12-27 23:51:42"
]
}
},
{
"source": "Vivian",
"target": "Lethal Weapon",
"label": "rate",
"properties": {
"Score": [
5
],
"Datetime": [
"2000-12-27 23:44:41"
]
}
}
]
},
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 457
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to add edges in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
add
Request Parameters
Parameter Manda Type Description
tory
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 458
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 459
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Add edges in batches. The source vertex is 46, the target vertices are 39 and 38,
and the edge label is rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-add
{
"edges": [
{
"source": "46",
"target": "39",
"label": "rate",
"properties": {
"Rating": [
5
],
"Datetime": [
"2018-01-0120:30:05"
]
}
},
{
"source": "46",
"target": "38",
"label": "rate",
"properties": {
"Rating": [
4
],
"Datetime": [
"2018-01-0120:30:05"
]
}
}
],
"parallelEdge": {
"action": "override",
"ignoreLabel": false
},
"createNotExists": false
}
NOTE
● SERVER_URL: Address for accessing a graph. For details about its value, see Using
Service Plane APIs.
● In the example, if vertices 666 and 777 are not in the original graph, create vertices 666
and 777, retain the default value of each label, and add an edge.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result":"success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 460
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"errorCode":"GES.8000"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete edges in batches based on the source vertices, target
vertices, and indexes of the edges.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-
delete
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 461
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 462
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Delete edges in batches. The source vertices of the edges are
39631050_Landscape and 27803870_Landmark building, and the target vertices
of the edges are 27803870_Landmark building and 27661363_Villa hot spring.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-delete
{
"edges": [
{
"source": "39631050_Landscape",
"target": "27803870_ Landmark building"
},
{
"index": "0",
"source": "27803870_Landmark building",
"target": "27661363_Villa hot spring"
}
],
"ignoreError": true
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 463
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to update edge properties in batches.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id={actionId}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 464
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 465
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Update edge properties in batches. The source vertex of the edge is 46, and the
target vertices of the edge are 39 and 38.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/properties/action?
action_id=batch-update
{
"edges": [
{
"source": "46",
"target": "39",
"properties": {
"Rating": [
5
],
"Datetime": [
"2018-01-0120:30:05"
]
}
},
{
"source": "46",
"target": "38",
"index": "0",
"properties": {
"Rating": [
4
],
"Datetime": [
"2018-01-0120:30:05"
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 466
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
}
],
"ignoreError": true
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to add a label.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 467
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels
Request Parameters
● Request parameters (OBS scenario)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 468
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 469
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 470
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Add a label. The label name is book. The label has one property to add.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels
{
"name": "book",
"type": "vertex",
"properties": [
{
"property": {
"name": "Title",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Version",
"cardinality": "single",
"dataType": "string"
}
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 471
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
In the current version, this API can only add properties to the end of existing
labels, but cannot delete existing properties or update the property sequence.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema?label={labelName}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 472
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 473
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Update a label. The label name is book. The label has one property to update.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/schema?label={labelName}
{
"type": "vertex",
"properties": [
{
"property": {
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 474
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"name": "Title",
"cardinality": "single",
"dataType": "string"
}
},
{
"property": {
"name": "Version",
"cardinality": "single",
"dataType": "string"
}
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 475
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query a label.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema?label={labelName}
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 476
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
type String Label type, indicating that the label is used for
vertices or edges.
Example Request
Query labels.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema?label={labelName}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"data": {
"type": "vertex",
"properties": [
{
"name": "Rating",
"type": "int",
"cardinality": "single"
},
{
"name": "Datetime",
"type": "string",
"cardinality": "single"
}
]
},
"result": "success"
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 477
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query graph metadata details.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/schema
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 478
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
type String Label type, indicating that the label is used for
vertices or edges.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 479
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query metadata details of a graph.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
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",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 480
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"type": "edge",
"properties": [
{
"name": "Score",
"type": "int",
"cardinality": "single"
},
{
"name": "Datetime",
"type": "date",
"cardinality": "single"
}
]
}
]
}
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to create indexes based on the specified information such as
indexName and IndexType. Currently, composite indexes and full-text indexes are
supported.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 481
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Indexes
Feature Fuzzy Search Speed Flexibility
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/indices
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 482
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
NOTE
● If a property is of the string or char array type, the value must be no more than 40
bytes. The excess part will be deleted.
● Cypher queries can be accelerated with indexes whose hasLabel is True.
● If indexProperty is left blank, the created index is a label index, which accelerates
label filtering.
● If indexProperty is specified, the created index is a property index, which
accelerates property filtering.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 483
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Create a composite index. The index name is ageIndex and the index type is
global vertex index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
{
"indexName": "ageIndex",
"indexType": "GlobalCompositeVertexIndex",
"hasLabel": true,
"indexProperty": []
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 484
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"jobType": 8
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to delete an index based on the specified indexName.
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}/indices/{indexName}
project_i Yes String Project ID. For details about how to obtain
d the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 485
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Delete an index by name. The index name is ageIndex.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices/ageIndex
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 486
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query all indexes created on a graph.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/indices
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 487
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query all indexes created on a graph.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 488
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"data": {
"indices": [
{
"indexType": "GlobalCompositeVertexIndex",
"indexName": "ageIndx",
"indexProperty": [
"age"
],
"hasLabel": true
}
]
},
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to create indexes in batches. By doing so, the number of data
scans is reduced and the overall time required is shorten. The types of indexes that
can be created are the same as those of the index creation API. For details, see
Creating an Index.
NOTE
After an index is created, wait for 30 seconds for index synchronization. After the
synchronization is complete, Cypher queries can be accelerated using the index.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 489
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/ indices/action?action_id=batch-
build
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 490
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● If a property is of the string or char array type, the value must be no more than 40
bytes. The excess part will be deleted.
● Cypher queries can be accelerated with indexes whose hasLabel is True.
● If indexProperty is left blank, the created index is a label index, which accelerates
label filtering.
● If indexProperty is specified, the created index is a property index, which
accelerates property filtering.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 491
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Create multiple composite indexes at a time. The index names are vertexIndex,
edgeIndex, and useridIndex.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices/action?action_id=batch-build
{
"indices": [
{
"indexName": "vertexIndex",
"indexType": "GlobalCompositeVertexIndex",
"hasLabel": true,
"indexProperty": []
},
{
"indexName": "edgeIndex",
"indexType": "GlobalCompositeEdgeIndex",
"hasLabel": true,
"indexProperty": []
},
{
"indexName": "useridIndex",
"indexType": "GlobalCompositeEdgeIndex",
"hasLabel": false,
"indexProperty": [
"userid"
]
}
]
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232",
"jobType": 8
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 492
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to create a HyG graph.
NOTE
Computing of graphs of the database edition relies on the HyG engine. Before executing an
algorithm, you need to create a HyG graph and synchronize data from the graph database
to the HyG engine.
URI
POST /ges/v1.0/{project_id}/hyg/{graph_name}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 493
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 494
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
To create a HyG graph, set the partitioning policy to oec and configure the graph
to contain incoming edges.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/hyg/{graph_name}
{
"policy": "oec",
"inEdge": true
}
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 495
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to synchronize graph database updates to the HyG computing
engine.
URI
POST /ges/v1.0/{project_id}/hyg/{graph_name}/sync
project_i Yes String Project ID. For details about how to obtain
d the project ID, see Obtaining a Project ID.
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 496
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 497
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
Suspended edges in a graph database (edges that do not have either a source or a target
node) are not synchronized to the HyG engine.
Example Request
Synchronize the update information of the graph database to the HyG computing
engine, with an empty vertex property list, an edge property list with the property
name Rating, and a label name of rate.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/hyg/{graph_name}/sync
{
"vertex": [],
"edge": [
{
"property": [
"Rating"
],
"label": "rate"
}
]
}
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 498
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to query general information about a HyG graph, such as the
number of vertices, number of edges, properties, and partitioning policies.
URI
GET /ges/v1.0/{project_id}/hyg/{graph_name}/summary
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
None
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 499
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query general information about a HyG graph.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/hyg/{graph_name}/summary
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 500
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"data": {
"inEdge": true,
"idIndex": true,
"policy": "oec",
"updateTime": "2023-08-03 15:13:16",
"vertex": [],
"edge": [
{
"label": "rate",
"property": [
"Rating"
]
}
],
"vertexNum": 150,
"edgeNum": 1659
},
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 501
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to delete a HyG graph.
URI
DELETE /ges/v1.0/{project_id}/hyg/{graph_name}
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
None
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 502
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Delete a HyG graph.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/hyg/{graph_name}
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 503
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to list HyG graphs.
URI
GET /ges/v1.0/{project_id}/hyg
project_id Yes String Project ID. For details about how to obtain
the project ID, see Obtaining a Project ID.
Request Parameters
None
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 504
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
List HyG graphs.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/hyg
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 505
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 506
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to run specified algorithms based on entered parameters.
URL
POST /ges/v1.0/{project_id}/graphs/{graph_name}/hyg/algorithm
Example Request
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/hyg/algorithm
{
"algorithmName":"pagerank",
"data_id": "0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"alpha":0.85,
"convergence":0.00001,
"max_iterations":1000,
"directed":true
}
}
Request Parameters
For details about the parameters, see Common algorithm parameters.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 507
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 508
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Example Response
Algorithms are executed based on input parameters. You can call Querying Job
Status and Execution Results to use the job_id returned by the algorithm to
obtain the algorithm execution result.
Status code: 200
Example response for a successful request
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 509
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"data": {
"outputs": {
$response_data //Result of each algorithm. The results vary with the algorithm.
"runtime": 1.365867,
"data_return_size": 3,
"data_offset": 0,
"data_total_size": 100
}
},
"status": "complete"
}
NOTE
response_data indicates the result of each algorithm. The results vary with algorithms.
Function
This API is used to execute the Shortest Path algorithm based on entered
parameters.
The Shortest Path algorithm is used to find the shortest path between two nodes
in a graph.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 510
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 511
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Parameter Type Description
Example Request
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"shortest_path",
"data_id":"0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"source":"1",
"target":"5",
"directed":true,
"weight":"",
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 512
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
5.2.7.2.3 SSSP
Function
This API is used to execute the SSSP algorithm based on entered parameters.
This algorithm provides the shortest path from a given node (source node) to all
other nodes.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 513
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 514
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
jobType Integer Job type. This parameter is left blank if the request
fails.
Example Request
POST http://{SERVER_URL}/ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"sssp ",
"data_id":"0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"source":"1",
"directed":true,
"weight": "",
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 515
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
5.2.7.2.4 K-Hop
Function
This API is used to run the K-Hop algorithm based on entered parameters.
This algorithm is used to search all nodes in the k layer that are associated with
the source node through Breadth-First Search (BFS). The found sub-graph is the
source node's ego-net. This algorithm returns the number of nodes in the ego-net.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 516
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 517
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Parameter Type Description
jobType Integer Job type. This parameter is left blank if the request
fails.
Example Request
POST http://{SERVER_URL}/ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"k_hop",
"data_id":"0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"k":3,
"source":66,
"mode":"ALL"
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 518
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
5.2.7.2.5 PageRank
Function
This API is used to run the PageRank algorithm based on entered parameters.
PageRank, also known as web page ranking, is a hyperlink analysis algorithm used
to rank web pages (nodes) based on their search engine results. PageRank is a
way of measuring the relevance and importance of web pages (nodes).
● If a web page is linked to many other web pages, the web page is important.
That is, the PageRank value of the web page is relatively high.
● If a web page with a high PageRank value is linked to another web page, the
PageRank value of the linked web page increases accordingly.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 519
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Parameter Type Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 520
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST http://{SERVER_URL}/ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"pagerank",
"data_id":"0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"alpha":0.85,
"convergence":0.00001,
"max_iterations":1000
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 521
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to run the Connected Component algorithm based on entered
parameters.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 522
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Parameter Type Description
jobType Integer Job type. This parameter is left blank if the request
fails.
Example Request
POST http://{SERVER_URL}/ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"connected_component",
"data_id": "0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 523
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"jobType": 1
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
5.2.7.2.7 K-core
Function
This API is used to run the K-core algorithm based on entered parameters.
K-core is a classic graph algorithm used to calculate the number of cores of each
node. The calculation result is one of the most commonly used reference values
for determining the importance of a node so that the propagation capability of
the node can be better understood.
URI
POST /ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 524
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Parameter Type Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 525
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST http://{SERVER_URL}/ges/v1.0/{projectId}/graphs/{graphName}/hyg/algorithm
{
"algorithmName":"kcore",
"data_id":"0-91494cd9-e7da-4fb9-ba56-b2301967688d0000000019090",
"parameters":{
"k":10
}
}
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 526
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to dump the execution results of the algorithm (jobId) to OBS.
URI
POST /ges/v1.0/{project_id}/hyg/{graph_name}/jobs/{job_id}/export-result
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 527
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Dumps algorithm results and returns the job ID.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 528
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
POST /ges/v1.0/{project_id}/hyg/{graph_name}/jobs/{job_id}/export-result
{
"exportPath": "demo_movie/",
"erase": true,
"obsParameters": {
"accessKey": "xxxx",
"secretKey": "xxxx"
}
}
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 529
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to cancel a submitted HyG job. (Currently, only jobs in a queue
can be canceled.)
URI
DELETE /ges/v1.0/{project_id}/hyg/{graph_name}/jobs/{job_id}
Request Parameters
None
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 530
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
● Example request 1: Cancel a submitted job.
DELETE http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}
NOTE
SERVER_URL: URL for accessing the graph. For details about its value, see Using
Service Plane APIs.
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 531
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to run specified algorithms based on entered parameters.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
algorithm
Example Request
Run the shortest_path algorithm to find the shortest route between vertices 46
and 138, taking into account the direction of the edges.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
""algorithmName"":""shortest_path"",
""executionMode"": ""sync"",
""parameters"":{
""source"":""46"",
""target"":""138"",
""directed"":true
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 532
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Request Parameters
For details about the parameters, see Common algorithm parameters.
Response Parameters
jobType Integer Job type. This parameter is left blank when the
request fails.
Example Response
Status code: 200
Example response (successful request)
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 533
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Request Example
{
"algorithmName":"XXX",
"parameters":{
...
}
}
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 534
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Algorithms are executed based on input parameters. You can call Querying Job
Status and Execution Results to use the job_id returned by the algorithm to
obtain the algorithm execution result.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 535
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
{
"data": {
"outputs": {
$response_data //Result of each algorithm. The results vary with the algorithm.
"runtime": 1.365867,
"data_return_size": 3,
"data_offset": 0,
"data_total_size": 100
}
},
"status": "complete"
}
NOTE
response_data indicates the result of each algorithm. The results vary with algorithms.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 536
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 537
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 538
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 539
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 540
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
This API is used to query the general information about a graph, such as the
numbers of vertices and edges.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/summary?
label_details={labelDetails}
project_id Yes String Project ID. For details about how to obtain the
project ID, see Obtaining a Project ID.
Example Request
Query general information about a graph, such as the numbers of vertices and
edges. The value true indicates that the numbers of vertices and edges of
different labels are returned.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 541
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/summary?label_details=true
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Response Parameters
Example Response
Status code: 200
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 542
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Function
This API is used to query the graph version.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/version
Request Parameters
None
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 543
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Query the graph version.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/version
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 544
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to import graph data.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-graph
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 545
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 546
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 547
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Response Parameters
Example Request
Import a graph. The edge file directory is testbucket/demo_movie/edges/ and
the edge data set format is CSV; the vertex file directory is testbucket/
demo_movie/vertices/ and the vertex data set format is CSV; the OBS path of the
metadata file of the new data is testbucket/demo_movie/
incremental_data_schema.xml and the log storage directory is testbucket/
importlogdir.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=import-graph
{
"edgesetPath": "testbucket/demo_movie/edges/",
"edgesetFormat": "csv",
"vertexsetPath": "testbucket/demo_movie/vertices/",
"vertexsetFormat": "csv",
"schemaPath": "testbucket/demo_movie/incremental_data_schema.xml",
"logDir": "testbucket/importlogdir",
"parallelEdge": {
"action":"override",
"ignoreLabel":true
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 548
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
},
"delimiter": ",",
"trimQuote": "\"",
"offline": true,
"obsParameters": {
"accessKey": "xxxxxx",
"secretKey": "xxxxxx"
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to clear graph data.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 549
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=clear-graph
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 550
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Clear a graph by deleting its schema data.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=clear-graph
{
"clearMetadata": true
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to export graph data.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 551
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
If you choose to export CSV files to your local host, the files are opened using the
spreadsheet software by default. You are advised to open the files in a text editor. If the
data contains special characters such as plus signs (+), minus signs (-), equal signs (=), and
at signs (@), the data will be parsed into formulas by the software. To ensure system
security, pay attention to the following when opening such files:
1. Do not select Enable Dynamic Data Exchange Server Launch (not recommended).
2. Do not select Enable or Yes if a dialog box indicating a security issue is displayed.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=export-graph
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 552
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
obsParameters, accessKey, and secretKey are mandatory in OBS scenarios and optional in
HDFS scenarios.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 553
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Example Request
Export a graph. The OBS path for exporting the graph is demo_movie/, the name
of the exported edge data set is set_edge, the name of the exported vertex data
set is set_vertex, and the name of the exported metadata file is set_schema.xml.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=export-graph
{
"graphExportPath": "demo_movie/",
"edgeSetName": "set_edge",
"vertexSetName": "set_vertex",
"schemaName": "set_schema.xml",
"paginate":{
"numThread":8,
"rowCountPerFile":1000000
},
"obsParameters": {
"accessKey": "xxxxxx",
"secretKey": "xxxxxx"
}
}
Example request 2
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=export-graph
{
"graphExportPath": "demo_movie/",
"edgeSetName": "set_edge",
"vertexSetName": "set_vertex",
"schemaName": "set_schema.xml",
"obsParameters": {
"accessKey": "xxxxxx",
"secretKey": "xxxxxx"
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 554
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
}
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to create a graph.
URI
POST /ges/v1.0/{project_id}/graphs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 555
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 556
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
POST /ges/v1.0/{project_id}/graphs
{
"graphName": "xxx",
"idType": "fixedLengthString",
"idLength": 20
}
Example Response
Status code: 200
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to delete a graph.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 557
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
URI
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}
Request Parameters
None
Response Parameters
Example Request
DELETE /ges/v1.0/{project_id}/graphs/{graph_name}
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 558
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Function
This API is used to list graphs.
URI
GET /ges/v1.0/{project_id}/graphs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 559
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
None
Response Parameters
Example Request
GET /ges/v1.0/{project_id}/graphs
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"graphs": [
{
"graphName": "movieee",
"idType": "fixedLengthString",
"idLength": 20,
"averageImportRate": 0.0
},
{
"graphName": "ldbc",
"idType": "fixedLengthString",
"idLength": 20,
"averageImportRate": 0.0
}
],
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 560
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes for Service Plane APIs.
Function
After the ID of an asynchronous job is returned, if the job ID at the service layer is
lost and cannot be obtained through the API, a new API is provided to query all
asynchronous jobs stored in the engine. The job ID, job status, and original request
of each job are returned.
NOTE
A maximum of 100 thousand records can be returned for database edition graphs.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/status?
limit={limit}&offset={offset}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 561
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
project_i Yes String Project ID. For details about how to obtain the
d project ID, see Obtaining a Project ID.
Request Parameters
For details, see the URI parameters.
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 562
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query the job list and return the job ID and status of each job.
GET /ges/v1.0/{project_id}/graphs/movie/jobs/status
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"jobs": [
{
"jobId": "62582163123991943683d0f9aa3-f701-48be-a662-360e6a0455da",
"status": "complete",
"request": {
"command": "import_graph",
"url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
"body": {
"edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
"vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
"schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
}
}
},
{
"jobId": "62582163123991943683fe74caf-f4d3-48b3-b3ee-66daaedcd2ca",
"status": "complete",
"request": {
"command": "import_graph",
"url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
"body": {
"edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
"vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
"schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
}
}
},
{
"jobId": "6258216312399194368daa80df3-e3bd-440d-9764-74f4622a550f",
"status": "complete",
"request": {
"command": "import_graph",
"url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
"body": {
"edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
"vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
"schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
}
}
},
{
"jobId": "62582163123991943680ed2761f-01f7-4fbf-b867-0a9aae6d9c12",
"status": "complete",
"request": {
"command": "import_graph",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 563
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
"url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
"body": {
"edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
"vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
"schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
}
}
}
],
"result": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Function
This API is used to query the execution status of a job. After asynchronous APIs
such as those for querying vertices and edges or executing algorithms are used,
job IDs are returned. You can use the job ID to query the execution status of each
job.
URI
GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?
offset=offset&limit=limit
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 564
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Response Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 565
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Request
Query the execution status of a job. The query offset is 0, and the maximum
number of returned results is 2.
GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?offset=0&limit=2
NOTE
SERVER_URL: Address for accessing a graph. For details about its value, see Using Service
Plane APIs.
Example Response
Status code: 200
Example response for a successful request
Http Status Code: 200
{
"data": {
"outputs": {
"data_return_size": 2,
"vertices": [
{
"id": "Sarah",
"label": "user",
"properties": {
"Occupation": [
"other or not specified"
],
"Name": [
"Sarah"
],
"Zip-code": [
"55105"
],
"Gender": [
"F"
],
"Age": [
"18-24"
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 566
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
},
{
"id": "Sidney",
"label": "user",
"properties": {
"Occupation": [
"writer"
],
"Name": [
"Sidney"
],
"Zip-code": [
"85296"
],
"Gender": [
"M"
],
"Age": [
"18-24"
]
}
}
],
"data_offset": 0,
"data_total_size": 19
}
},
"status": "success"
}
Status Codes
Return Value Description
Error Codes
See Error Codes.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 567
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Function
Cypher is a widely used declarative graph database query language. It can be used
to query data in GES and returns results. Graph statistics are used in Cypher
implementation. Currently, the label-based vertex and edge indexes are used
during Cypher query and compilation. To use Cypher normally, create indexes by
referring to Cypher Prerequisites.
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
cypher-query
Example Request
Execute a Cypher query. The Cypher statement is match (n) return n limit 1. The
returned results are in the format that each element corresponds to a field in the
row.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-cypher-
query
{
"statements": [{
"statement": "match (n) return n limit 1",
"parameters": {},
"resultDataContents": ["row"],
"includeStats": false
}]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 568
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 569
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● You can add the explain or profile prefix before a statement to display the query plan.
The explain prefix displays only the query plan but does not execute the statement. The
profile prefix displays the query plan and executes the statement.
● Description of the runtime field: Compared with the map executor, the slotted executor
completes more statement data flow analysis in the plan generation phase of
statements. In most cases, it executes faster while requiring less memory.
● In asynchronous mode (executionMode is async), cypher query results can be exported
to CSV files (GES 2.3.4 or later supports this function). For details, see Exporting Job
Execution Results to Files. Currently, the following values can be returned:
1. Vertex and edge single-value properties, vertex and edge IDs, and group counts.
2. The current version does not support exporting object types. Objects are converted
to null values in the CSV file.
● Cypher transactions (database edition only):
1. For database edition graphs, Cypher transactions are supported. You can set
transactional to true to enable the function to ensure the atomicity of a single
Cypher statement. Transactions supporting multiple Cypher statements are not
available. Transactions in GES use a serializability isolation level.
2. The transaction time window is limited to 5s in the underlying storage engine of
GES. Cypher transactions cannot last exceeding 5s. For complex queries, such as
multi-hop queries, the running time may exceed 5s. The transaction times out and
the submission fails.
In this case, you can use the dbms.killQuery program of Cypher to terminate a
Cypher transaction (for details, see Cypher API-Functions and Procedures) and
restore all changes caused by the Cypher request.
Response Parameters
errors List Each element in the list contains the code and
message information in string form.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 570
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 571
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Example Response
Status code: 200
Example response for a successful request (synchronous call)
Http Status Code: 200
{
"results": [
{
"columns": ["n"],
"data": [
{
"row": [
{
"occupation": "artist",
"gender": "F",
"Zip-code": "98133",
"userid": 0,
"age": "25-34"
}
],
"meta": [
{
"id": "46",
"type": "node",
"labels": [
"user"
]
}
]
}
],
"stats": {
"contains_updates": false,
"edges_created": 0,
"edges_deleted": 0,
"labels_set": 0,
"properties_set": 0,
"vertices_created": 0,
"vertices_deleted": 0
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 572
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
],
"errors": []
}
Status Codes
Return Value Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 573
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Error Codes
See Error Codes.
Basic Operations
Operation Cypher Statement
Compatibility to Cypher
1. Cypher clauses
Cypher implements a couple of clauses. You can combine clauses to
implement different query semantics, including vertex and edge filtering,
multi-hop query, sorting and deduplication, and grouping and aggregation.
Currently, GES supports the Cypher clauses listed in the following table.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 574
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
1. Currently, merge and foreach operations are not supported. Cypher statements
cannot add or delete indexes.
2. GES metadata is not schema-free, and the vertex and edge label properties are
strictly restricted. Therefore, the remove operation is not supported.
3. The order by clause does not support sorting of the list type. When Cardinality of
the property value is not single, the sorting result is unknown.
– Available items for the match clause
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 575
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Multi- You can enter multiple match clauses. You can 2.2.16
match use with to connect multiple clauses.
match (n)-[r]->(m) with m match (m)-->(s)
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 576
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
2. Parameterized queries
Cypher supports parameterized queries. Numeric and string values in a query
statement are extracted and converted to parameters for faster compilation,
improving the query speed.
There are some examples of parameterized queries:
– Example 1
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?
action_id=execute-cypher-query
{
"statements": [{
"statement": " match (n:user) where n.occupation = $occupation return n",
"parameters": {
"occupation" : "artist"
},
"resultDataContents": ["row"]
}]
}
– Example 2
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?
action_id=execute-cypher-query
{
"statements": [{
"statement": " match (n:user {`Zip-code`:'98133'}) set n = $props return n",
"parameters": {
"props": {
"gender": "M",
"age": "56+"
}
},
"resultDataContents": ["row"]
}]
}
NOTE
There are some scenarios where parameterized queries are not supported. The
following syntax is not valid:
1. Using $param to search by property key and value. For example, match (n) where
n.$param = 'something'
2. Using $code for vertex and edge labels. For example, match (n:user) set n:$code
3. Supported data types
Currently, GES supports 10 data types: char, char_array, float, double, Boolean,
long, Integer, date, enum, and string. Both Boolean and numeric types are
supported in the Cypher syntax. The following table lists the mapping
between other types and Cypher data types.
char String -
char_arra String -
y
string String -
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 577
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Point, No -
Spatial
NOTE
For the special types listed above, only the List type can be used to match multi-value
properties in GES. Other types cannot be used in a set statement for setting the value
of a property.
4. Vertex ID compatibility
– Cypher does not provide the syntax for setting the ID when a vertex is
added. In GES, however, an ID of the string type is required to uniquely
identify a vertex. To use the Cypher syntax in GES, add _ID_ to specify the
ID of a vertex in the create statement. For example, the
create(n{_ID_:'123456'}) statement creates a vertex whose ID is 123456.
– If the ID is not specified, a random ID is generated for the vertex.
NOTE
The _ID_ identifier is supported only in the create statement. The match and set
clauses do not support the _ID_ identifier. In the match clause, you can use the
id() function to obtain the vertex ID.
– Creating a multi-label vertex
GES graphs of the database edition supports the creation of vertices with
multiple labels by running Cypher statements, for example, create
(n:user:student {userid:10, studentName:'Bob'}).
The attributes of all labels are enclosed in a single set of curly braces. The
creation process automatically matches labels with their corresponding
attributes based on the schema, and the order of the attributes has no
impact on their correspondence with the labels.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 578
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Expression
Cypher queries support multiple expressions and can be used in combination to
form various filter criteria. Currently, the following expressions are supported:
Date expressions .year, .mont Year, month, and day of a specific date: with
h, .day, .hou '2000-12-27 23:44:41' as strVal with
r, .minute, .s datetime(strVal) as d2 return d2.year,
econd, .day d2.month, d2.day, d2.hour, d2.minute,
OfWeek d2.second,d2.dayOfWeek, d2.ordinalDay
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 579
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
The where clause in Cypher queries does not support regular expressions.
Function
Cypher supports the following functions for grouping, aggregation, and vertex and
edge operations:
1. Aggregate
2. Regular functions
Based on the types of input parameters, regular functions are classified into
vertex and edge functions, path functions, list functions, and value functions.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 580
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 581
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 582
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 583
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 584
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 585
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 586
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
NOTE
● Aggregate functions, such as sum(), avg(), max(), and min(), are not available for
database edition graphs.
● Degree functions, path functions, and algorithm expressions are not available for 10-
billion-edge graphs and database edition graphs. The toUpper and toLower functions
are not available for the database edition.
Procedure
Currently, GES supports the following procedures.
Procedure Statement
NOTE
● Full-text indexes support six types of queries: prefix, wildcard, regexp, fuzzy, match, and
combine. To use full-text indexes, you need to call the API for creating a full-text index.
● Function and procedure names are case sensitive and must be in lower camel case.
● Example of a full-text index query request
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-
cypher-query
{
"statements": [
{
"statement": "call db.index.fulltext.queryNodes('combine', {title:'1977'}) yield node, score
return node, score skip 1 limit 10",
"resultDataContents": [
"row"
],
"parameters": {}
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 587
Graph Engine Service(GES)
API Reference 5 Service Plane APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 588
Graph Engine Service(GES)
API Reference 6 Application Examples
6 Application Examples
Prerequisites
The HyG computing engine slider was toggled on when creating a graph of the
database edition.
Procedure
1. Create a HyG graph.
a. Send POST /ges/v1.0/{project_id}/hyg/{graph_name}. project_id indicates
the project ID, and graph_name indicates the name of a graph created in
the graph database.
b. Add X-Auth-Token to the request header.
c. Specify the following parameters in the request body:
{
"inEdge": true // Whether the graph contains the incoming edge
}
If the request is abnormal, locate the fault by referring to Error Codes for
Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 589
Graph Engine Service(GES)
API Reference 6 Application Examples
2. Synchronize data from the graph database to the HyG computing engine.
a. Send POST /ges/v1.0/{project_id}/hyg/{graph_name}/sync. project_id
indicates the project ID, and graph_name indicates the graph name.
b. Add X-Auth-Token to the request header.
c. Specify the following parameters in the request body:
{
"vertex": [], // Vertex property list
"edge": [
{
"property": [
"Rating"
],
"label": "rate"
}
] // Edge property list
}
d. Check the response. The request is successful if the following response is
displayed:
{
"jobId": "6-57222f3d-f6b8-41ba-b492-60ed9b879223"
}
If the request is abnormal, locate the fault by referring to Error Codes for
Service Plane APIs.
With this API, you can synchronize any changes made to the graph
database, whether it be adding, deleting, or modifying data, to the HyG
computing engine. During the initial data synchronization, the vertex and
edge parameters specified in the request body will be applied. For
subsequent synchronizations, these parameters will default to the values
specified during the first synchronization.
3. Check details about the HyG graph.
a. Send GET /ges/v1.0/{project_id}/hyg/{graph_name}/summary. project_id
indicates the project ID, and graph_name indicates the graph name.
b. Add X-Auth-Token to the request header.
c. Check the response. The request is successful if the following response is
displayed:
{
"data": {
"inEdge": true,
"idIndex": true,
"policy": "oec",
"updateTime": "2024-01-25 10:55:31",
"vertex": [],
"edge": [
{
"label": "rate",
"property": [
"Rating"
]
}
],
"vertexNum": 146,
"edgeNum": 1659
},
"result": "success"
}
If the request is abnormal, locate the fault by referring to Error Codes for
Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 590
Graph Engine Service(GES)
API Reference 6 Application Examples
d. Check the response based on the job ID. The request is successful if the
following response is displayed:
{
"status": "complete",
"data": {
"outputs": {
"data_offset": 0,
"data_return_size": 147,
"data_total_size": 147,
"pagerank": [
{
"38": 0.02115960730038959
},
{
"13": 0.018535705068819635
},
{
"7": 0.0166381431701182
},
... ...
],
"runtime": 0.022
}
},
"result": "success"
}
If the request is abnormal, locate the fault by referring to Error Codes for
Service Plane APIs.
5. Delete the HyG graph.
a. Send DELETE /ges/v1.0/{project_id}/hyg/{graph_name}. project_id
indicates the project ID, and graph_name indicates the graph name.
b. Add X-Auth-Token to the request header.
c. Check the response. The request is successful if the following response is
displayed:
{
"jobId": "6-e33ba071-f1ab-4e29-b632-30bd086e40ac"
}
If the request is abnormal, locate the fault by referring to Error Codes for
Service Plane APIs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 591
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
7 Monitoring Metrics
Function
This chapter describes information on the metrics reported by GES, including their
namespaces, lists, and dimensions. You can use the provided APIs to query the
information.
Namespace
SYS.GES
Metrics
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 592
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 593
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 594
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 595
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Dimensions
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 596
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Type Name
407 filtered_khop
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 597
Graph Engine Service(GES)
API Reference 7 Monitoring Metrics
Type Name
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 598
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
8 Out-of-Date APIs
Function
This API is used to query tenant quotas.
URI
GET /v1.0/{project_id}/graphs/quotas
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 599
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
quotas GesQuotaRes Resource type list. This field is left blank when
p object the request fails.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 600
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/quotas
Example Response
Status code: 200
OK
{
"quotas" : {
"resources" : [ {
"type" : "graph",
"available" : 1,
"edgeVolume" : 178800
}, {
"type" : "backup",
"available" : 7
}, {
"type" : "metadata",
"available" : 13
}]
}
}
Status Codes
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 601
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to query all graphs owned by the current tenant.
URI
GET /v1.0/{project_id}/graphs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 602
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
id String Graph ID
edgesetPath Array of OBS path for storing the edge data set
edgesetPath_
1 objects
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 603
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
vertexsetPath Array of OBS path for storing the vertex data set
vertexsetPat
h_1 objects
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 604
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 605
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 606
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs?offset=0&limit=10
Example Response
Status code: 200
OK
{
"graphCount": 2,
"graphs": [
{
"id": "f1529b88-c958-493e-8452-fccfe932cde1",
"name": "demo",
"regionCode": "XXX",
"azCode": "XXX",
"schemaPath": [
{
"path": "ges-graphs/demo_movie/schema.xml",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"edgesetPath": [
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 607
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
{
"path": "ges-graphs/demo_movie/edge.csv",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"vertexsetPath": [
{
"path": "",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"status": "200",
"graphSizeTypeIndex": "1",
"vpcId": "2d8af840-fd57-4e3b-a8f1-cda0f55ccd99",
"subnetId": "dc018ec3-67d1-46c9-b2fc-19d83367f4e2",
"securityGroupId": "11d27338-8649-4076-8579-5ebc1a60f79e",
"created": "2018-07-23T04:09:44",
"updated": "2018-07-23T04:09:44",
"privateIp": "192.168.0.4",
"dataStoreVersion": "1.0.5",
"arch": "x86_64",
"enableFullTextIndex" : false
},
{
"id": "53205529-026b-455a-9e07-228fae4b12b9",
"name": "ges_c5de",
"regionCode": "XXX",
"azCode": "XXX",
"schemaPath": [
{
"path": "ges-graphs/demo_movie/schema.xml",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"edgesetPath": [
{
"path": "ges-graphs/demo_movie/edge.csv",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"vertexsetPath": [
{
"path": "",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"status": "200",
"graphSizeTypeIndex": "2",
"vpcId": "2d8af840-fd57-4e3b-a8f1-cda0f55ccd99",
"subnetId": "dc018ec3-67d1-46c9-b2fc-19d83367f4e2",
"securityGroupId": "11d27338-8649-4076-8579-5ebc1a60f79e",
"created": "2018-07-18T13:30:16",
"updated": "2018-07-18T13:30:16",
"privateIp": "192.168.0.168",
"dataStoreVersion": "1.0.5",
"arch": "aarch64",
"enableFullTextIndex" : false
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 608
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Codes
Status Code Description
Function
This API is used to query the details about a graph based on the graph ID.
URI
GET /v1.0/{project_id}/graphs/{graph_id}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 609
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
id String Graph ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 610
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
edgesetPath Array of OBS path for storing the edge data set
edgesetPath
_1 objects
vertexsetPath Array of OBS path for storing the vertex data set
vertexsetPat
h_1 objects
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 611
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 612
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 613
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 614
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/{graph_id}
Example Response
Status code: 200
OK
{
"graph": {
"id": "f1529b88-c958-493e-8452-fccfe932cde1",
"name": "demo",
"regionCode": "XXX",
"azCode": "XXX",
"schemaPath": [
{
"path": "ges-graphs/demo_movie/schema.xml",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"edgesetPath": [
{
"path": "ges-graphs/demo_movie/edge.csv",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
],
"vertexsetPath": [
{
"path": "",
"jobId": "ff80808167bb90340167bc7445670428",
"status": "success"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 615
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
],
"status": "200",
"graphSizeTypeIndex": "1",
"vpcId": "2d8af840-fd57-4e3b-a8f1-cda0f55ccd99",
"subnetId": "dc018ec3-67d1-46c9-b2fc-19d83367f4e2",
"securityGroupId": "11d27338-8649-4076-8579-5ebc1a60f79e",
"created": "2018-07-23T04:09:44",
"privateIp": "192.168.0.4",
"dataStoreVersion": "1.0.5",
"arch": "x86_64"
}
}
Status Codes
Status Code Description
Function
This API is used to create a graph.
URI
POST /v1.0/{project_id}/graphs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 616
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 617
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 618
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 619
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 620
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
NOTE
● For details about the value validity of the schemaPath, edgesetPath, vertexsetPath,
and logDir character strings, see the OBS Object Name Restrictions.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 621
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 622
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
id String Graph ID
Example Request
POST https://Endpoint/v1.0/{project_id}/graphs
{
"graph":{
"name":"demo",
"graphSizeTypeIndex": "1",
"arch":"x86_64",
"vpcId":"2d8af840-fd57-4e3b-a8f1-cda0f55ccd99",
"subnetId":"dc018ec3-67d1-46c9-b2fc-19d83367f4e2",
"securityGroupId":"11d27338-8649-4076-8579-5ebc1a60f79e",
"publicIp":{
"publicBindType":"bind_existing",
"eipId":"30ef2d58-08a9-4481-b526-b2cbe67d020d"
},
"enableMultiAz":false,
,
"enableFullTextIndex" : false,
"cryptAlgorithm": "generalCipher",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 623
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"enableHttps": "false"
}
}
Example Responses
Status code: 200
OK
{
"id" : "f1529b88-c958-493e-8452-fccfe932cde1",
"name" : "demo"
}
Status Codes
Status Code Description
Function
This API is used to stop a graph. After the graph is created, you can disable it if it
is not used temporarily.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 624
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 625
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST https://Endpoint//v1.0/{project_id}/graphs/{graph_id}/action?action_id=stop
Example Response
Status code: 200
OK
{
"jobId" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 626
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to start a graph. You can disable a graph if it is not used
temporarily.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 627
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
Example Request
https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=start
{
"graph_backup_id" : "08a898ae-3ff8-40e8-a7ed-03afe05aedbb"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 628
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Response
Status code: 200
OK
{
"jobId" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Status Code Description
Function
This API is used to delete a graph.
URI
DELETE /v1.0/{project_id}/graphs/{graph_id}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 629
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 630
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
DELETE https://Endpoint/v1.0/{project_id}/graphs/{graph_id}
Example Response
Example response with status code 200:
OK
{
"jobId" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Status Code Description
Function
This API is used to import data to graphs incrementally.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 631
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
NOTE
To prevent failures in restoring the imported graph data during system restarting, do not
delete the data stored on OBS when the graph is in use.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 632
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 633
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 634
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
NOTE
● For details about the value validity of the edgesetPath, vertexsetPath, schemaPath,
and logDir character strings, see the OBS Object Name Restrictions.
Response Parameters
Status code: 200
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=import-graph
{
"edgesetPath": "testbucket/demo_movie/edges/",
"edgesetFormat": "csv",
"vertexsetPath": "testbucket/demo_movie/vertices/",
"vertexsetFormat": "csv",
"schemaPath": "testbucket/demo_movie/incremental_data_schema.xml",
"logDir": "testbucket/importlogdir",
"parallelEdge": {
"action":"override",
"ignoreLabel":true
},
"delimiter": ",",
"trimQuote": "\"",
"offline": true
}
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 635
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
OK
{
"jobId" : "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
}
Bad Request
{
"errorMessage" : "parameter format error",
"errorCode" : "GES.8013"
}
Status Code
Status Code Description
Function
This API is used to export a graph.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 636
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
NOTE
● For details about the value validity of the graphExportPath character strings, see the
OBS Object Name Restrictions.
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 637
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
NOTE
● For details about the value validity of the graphExportPath character strings, see the
OBS Object Name Restrictions.
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=export-graph
{
"graphExportPath" : "demo_movie/",
"edgeSetName" : "set_edge.csv",
"vertexSetName" : "set_vertex.csv",
"schemaName" : "set_schema.xml"
}
Example Response
Status code: 200
OK
{
"jobId" : "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}
Bad Request
{
"errorMessage" : "graph [demo] is not found",
"errorCode" : "GES.8011"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 638
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Code
Status Code Description
Function
This API is used to clear all data in a graph.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 639
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 640
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=clear-graph&clear-metadata=true
Example Response
Status code: 200
OK
{
"jobId" : "ff8080816025a0a1016025a5a2700007"
}
Status Code
Status Code Description
Function
This API is used to upgrade a graph. The GES version is periodically upgraded. You
can upgrade your graphs as required.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 641
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 642
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=upgrade
{
"upgradeVersion" : "1.1.8",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 643
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"forceUpgrade" : false
}
Example Response
Status code: 200
OK
{
"jobId" : "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}
Status Code
Status Code Description
Function
This API enables you to access GES by binding an elastic IP (EIP).
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 644
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 645
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=bindEip
{
"eipId" : "02bd6dc1-5be8-430e-a4cd-2b0f6d0bb042"
}
Example Response
Status code: 200
OK
{}
Bad Request
{
"errorMessage" : "graph [demo] is not found",
"errorCode" : "GES.8011"
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 646
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
If you do not need to use the EIP, this API enabled you to unbind the EIP to release
network resources.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 647
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=unbindEip
{
"eipId" : "02bd6dc1-5be8-430e-a4cd-2b0f6d0bb042"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 648
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Responses
Status code: 200
OK
{}
Status Code
Status Code Description
Function
This API is used to resize a graph instance.
NOTE
URI
POST /v1.0/{project_id}/graphs/{graph_id}/resize
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 649
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 650
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/resize
{
"resize" : {
"graphSizeTypeIndex" : "2"
}
}
Example Response
Status code: 200
OK
{}
Bad Request
{
"errorCode" : "GES.7001",
"errorMessage" : "The graph is not running."
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 651
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Code
Status Code Description
Function
This API is used to forcibly start a graph in the importing, exporting, running, or
clearing state. If a graph is forcibly restarted, asynchronous tasks of the graph are
failed state and the graph is stopped and started.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/action
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 652
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Example Request
POST https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=restart
Example Response
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 653
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
OK
{}
Status Code
Status Code Description
Function
This API is used to expand multiple secondary nodes dynamically. The expanded
secondary nodes can process read requests, improving read performance.
NOTE
1. This API is not supported by graphs of the 10,000-edge and 10-billion-edge types.
2. Graphs cannot be resized after expansion.
3. If you want to resize and expand the graph, resize the graph before you expand it.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/expand
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 654
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 655
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/expand
{
"expand": {
"replication" : "1"
}
}
Example Responses
Status code: 200
OK
{
"jobId" : "ff8080816025a0a1016025a5a2700007"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 656
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Code
Status Code Description
Function
This API is used to query the list of all backups.
URI
GET /v1.0/{project_id}/graphs/backups
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 657
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
backupList Array of List of all backups under the current project ID.
backup This parameter is left blank if the request fails.
objects
id String Backup ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 658
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/backups?offset=0&limit=2
Example Response
Example response with status code 200:
OK
{
"backupCount": 3,
"backupList": [
{
"id": "ada3e720-ab87-48cb-bff7-3ec5ae1a9652",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 659
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"name": "ges060803_nodelete-20210608135513",
"backupMethod": "manual",
"graphId": "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graphName": "ges060803_nodelete",
"graphStatus": "200",
"graphSizeTypeIndex": "1",
"dataStoreVersion": "2.2.21",
"arch": "x86_64",
"status": "success",
"startTimestamp": 1623160513000,
"startTime": "2021-06-08T13:55:13",
"endTimestamp": 1623160568000,
"endTime": "2021-06-08T13:56:08",
"size": 1,
"duration": 54,
"encrypted": false
},
{
"id": "7ed3f51d-816d-4651-9129-fe21b64b5c91",
"name": "ges060803_nodelete_20210609203323_auto",
"backupMethod": "auto",
"graphId": "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graphName": "ges060803_nodelete",
"graphStatus": "200",
"graphSizeTypeIndex": "1",
"dataStoreVersion": "2.2.21",
"arch": "x86_64",
"status": "success",
"startTimestamp": 1623242004000,
"startTime": "2021-06-09T12:33:24",
"endTimestamp": 1623242004000,
"endTime": "2021-06-09T12:33:24",
"size": 1,
"duration": 0,
"encrypted": false
},
{
"id": "604bfb46-04dd-45fc-a9ae-df24a0705b9d",
"name": "ges060802_nodelete-20210608135523",
"backupMethod": "manual",
"graphId": "9b9a05c2-0cdb-41ac-b55f-93caffb0519a",
"graphName": "ges060802_nodelete",
"graphStatus": "400",
"graphSizeTypeIndex": "0",
"dataStoreVersion": "2.2.23",
"arch": "x86_64",
"status": "success",
"startTimestamp": 1623160524000,
"startTime": "2021-06-08T13:55:24",
"endTimestamp": 1623160577000,
"endTime": "2021-06-08T13:56:17",
"size": 1,
"duration": 53,
"encrypted": false
}
]
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 660
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Code
Status Code Description
Function
This API is used to query the backup list of a graph.
URI
GET /v1.0/{project_id}/graphs/{graph_id}/backups
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 661
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
id String Backup ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 662
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/backups?offset=0&limit=2
Example Response
Example response with status code 200:
OK
{
"backupCount": 2,
"backupList": [
{
"id": "ada3e720-ab87-48cb-bff7-3ec5ae1a9652",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 663
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"name": "ges060803_nodelete-20210608135513",
"backupMethod": "manual",
"graphId": "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graphName": "ges060803_nodelete",
"graphStatus": "200",
"graphSizeTypeIndex": "1",
"dataStoreVersion": "2.2.22",
"arch": "x86_64",
"status": "success",
"startTimestamp": 1623160513000,
"startTime": "2021-06-08T13:55:13",
"endTimestamp": 1623160568000,
"endTime": "2021-06-08T13:56:08",
"size": 1,
"duration": 54,
"encrypted": false
},
{
"id": "7ed3f51d-816d-4651-9129-fe21b64b5c91",
"name": "ges060803_nodelete_20210609203323_auto",
"backupMethod": "auto",
"graphId": "4c5f882d-a813-4d78-a8e3-6d3212ddd121",
"graphName": "ges060803_nodelete",
"graphStatus": "200",
"graphSizeTypeIndex": "1",
"dataStoreVersion": "2.2.21",
"arch": "x86_64",
"status": "success",
"startTimestamp": 1623242004000,
"startTime": "2021-06-09T12:33:24",
"endTimestamp": 1623242004000,
"endTime": "2021-06-09T12:33:24",
"size": 1,
"duration": 0,
"encrypted": false
}
]
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 664
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to add a backup. If data in the current graph is incorrect or faulty,
you can start the backup graph to restore the data.
URI
POST /v1.0/{project_id}/graphs/{graph_id}/backups
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 665
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/backups
Example Response
Example response with status code 200:
OK
{
"jobId" : "ff8080815f9a3c84015f9a438ff70001"
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 666
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to delete a backup.
URI
DELETE /v1.0/{project_id}/graphs/{graph_id}/backups/{backup_id}
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 667
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
DELETE https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/backups/{backupId}
Example Response
Status code: 200
OK
{}
Bad Request
{
"errorMessage" : "Parameter error!",
"errorCode" : "GES.0001"
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 668
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
8.1.4.1 Constraints
Table 8-103 and Table 8-104 list the metadata types.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 669
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 670
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to query the metadata list.
URI
GET /v1.0/{project_id}/graphs/metadatas
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 671
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
id String Metadata ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 672
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/metadatas?offset=10&limit=100
Example Response
Status code: 200
OK
{
"schemaCount": 1,
"schemaList" : [ {
"id" : "ff7dddc4-6402-43d7-9aed-c5ec677b47fa",
"name" : "schema_demo",
"description" : "",
"status" : "200",
"metadataPath" : "ges-graphs/demo_movie/schema.xml",
"startTime" : "2018-07-23T02:59:41",
"lastUpdateTime" : "2018-07-23T02:59:41"
}]
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 673
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Function
This API is used to query the metadata of a graph.
URI
GET /v1.0/{project_id}/graphs/metadatas/{metadata_id}
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 674
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/metadatas/{metadata_id}
Example Response
Example response with status code 200:
OK
{
"gesMetadata": {
"labels": [
{
"name": "friends",
"properties": null
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 675
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
},
{
"name": "movie",
"properties": [
{
"dataType": "string",
"name": "Title",
"cardinality": "single"
},
{
"dataType": "int",
"name": "Year",
"cardinality": "single"
},
{
"dataType": "string",
"name": "Genres",
"cardinality": "set"
}
]
},
{
"name": "user",
"properties": [
{
"dataType": "string",
"name": "Title",
"cardinality": "single"
},
{
"dataType": "int",
"name": "Year",
"cardinality": "single"
},
{
"dataType": "string",
"name": "Genres",
"cardinality": "set"
}{
"typeName1": "F",
"typeName2": "M",
"typeNameCount": "2",
"dataType": "enum",
"name": "Gender",
"cardinality": "single"
},
{
"typeName1": "Under 18",
"typeName2": "18-24",
"typeName3": "25-34",
"typeName4": "35-44",
"typeNameCount": "7",
"dataType": "enum",
"name": "Age",
"typeName5": "45-49",
"typeName6": "50-55",
"cardinality": "single",
"typeName7": "56+"
},
{
"dataType": "string",
"name": "Occupation",
"cardinality": "single"
},
{
"dataType": "char array",
"name": "Zip-code",
"maxDataSize": "12",
"cardinality": "single"
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 676
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
}
]
},
{
"name": "rate",
"properties": [
{
"dataType": "int",
"name": "Score",
"cardinality": "single"
},
{
"dataType": "date",
"name": "Datetime",
"cardinality": "single"
}
]
}
]
}
}
Status Code
Status Code Description
Function
This API is used to add the metadata.
URI
POST /v1.0/{project_id}/graphs/metadatas
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 677
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 678
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Response Parameters
Status code: 200
id String Metadata ID
Example Request
POST https://Endpoint/v1.0/{project_id}/graphs/metadatas
{
"metadataPath": "gesdata/demo_movie/schema.xml",
"name": "movie_schema",
"description": "xxxxx",
"isOverwrite": "true",
"gesMetadata": {
"labels": [
{
"name": "friends",
"properties": null
},
{
"name": "movie",
"properties": [
{
"dataType": "string",
"name": "Title",
"cardinality": "single"
},
{
"dataType": "int",
"name": "Year",
"cardinality": "single"
},
{
"dataType": "string",
"name": "Genres",
"cardinality": "set"
}
]
},
{
"name": "user",
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 679
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"properties": [
{
"dataType": "string",
"name": "Name",
"cardinality": "single"
},
{
"typeName1": "F",
"typeName2": "M",
"typeNameCount": "2",
"dataType": "enum",
"name": "Gender",
"cardinality": "single"
},
{
"typeName1": "Under 18",
"typeName2": "18-24",
"typeName3": "25-34",
"typeName4": "35-44",
"typeNameCount": "7",
"dataType": "enum",
"name": "Age",
"typeName5": "45-49",
"typeName6": "50-55",
"cardinality": "single",
"typeName7": "56+"
},
{
"dataType": "string",
"name": "Occupation",
"cardinality": "single"
},
{
"dataType": "char array",
"name": "Zip-code",
"maxDataSize": "12",
"cardinality": "single"
}
]
},
{
"name": "rate",
"properties": [
{
"dataType": "int",
"name": "Score",
"cardinality": "single"
},
{
"dataType": "date",
"name": "Datetime",
"cardinality": "single"
}
]
}
]
}
}
Example Response
Example response with status code 200:
OK
{
"id" : "ff8080815f9a3c84015f9a438ff70001",
"name" : "movie_schema"
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 680
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Status Code
Status Code Description
Function
This API is used to delete the metadata.
URI
DELETE /v1.0/{project_id}/graphs/metadatas/{metadata_id}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 681
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Example Request
DELETE https://Endpoint/v1.0/{project_id}/graphs/metadatas/{metadata_id}
Example Response
Status code: 200
OK
{}
Bad Request
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 682
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
{
"errorCode" : "GES.7024",
"errorMessage" : "The metadata is not exist or has been deleted."
}
Status Code
Status Code Description
Function
This API is used to import metadata from OBS.
URI
POST /v1.0/{project_id}/graphs/metadata/upload_from_obs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 683
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
id String Metadata ID
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 684
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
POST https://Endpoint/v1.0/{project_id}/graphs/metadata/upload_from_obs
{
"metadataPath": "devdata/unionsdk/schema.xml",
"name": "test_schema",
"description": "",
"encryption": {}
}
Example Response
Example response with status code 200:
OK
{
"id" : "d30d2e94-f2ee-4344-af49-eb27fd002eea",
"name" : "test_schema"
}
Status Code
Status Code Description
Function
This API is used to query the execution status of a job. Asynchronous APIs that are
used to create, stop, start, delete, and import graphs will return job IDs after
commands are sent. You can query the job execution status according to the job
IDs.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 685
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
URI
GET /v1.0/{project_id}/graphs/{graph_id}/jobs/{job_id}/status
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 686
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 687
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 688
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/{graph_id}/jobs/{job_id}/status
Example Response
Status code: 200
OK
Http Status Code: 200
{
"jobId": "ff80808167f09aaa0167f19b35ec0305",
"status": "success",
"jobType": "GraphManagement",
"jobName": "ImportGraph",
"relatedGraph": "GES_UI_AUTO",
"beginTime": "2018-11-27T21:39:00",
"endTime": "2018-11-27T21:39:56",
"jobDetail": {
"vertexsetPath": [
{
"path": "ges-ui/auDatas/list_set_vertex.csv",
"log": null,
"cause": null,
"status": "success"
}
],
"edgesetPath": [
{
"path": "ges-ui/auDatas/list_set_edge.csv",
"log": null,
"cause": null,
"status": "success"
}
],
"schemaPath": [
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 689
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
{
"path": "ges-ui/auDatas/list_set_schema.xml",
"log": null,
"cause": null,
"status": "success"
}
]
},
"jobProgress": 0
}
Status Code
Status Code Description
Function
This API is used to query asynchronous job details in the job center on the
management plane. Asynchronous jobs include creating, closing, starting, deleting,
adding, importing, exporting, and upgrading graphs, as well as adding backups.
URI
GET /v1.0/{project_id}/graphs/jobs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 690
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Request Parameters
Response Parameters
Status code: 200
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 691
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 692
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 693
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Example Request
GET https://Endpoint/v1.0/{project_id}/graphs/jobs?offset=0&limit=100
Example Response
Example response with status code 200:
OK
Http Status Code: 200
{
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 694
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
"jobCount": 136,
"jobList": [
{
"jobId": "ff80808167bb90340167bc3c7b5b026a",
"status": "success",
"jobType": "GraphManagement",
"jobName": "ImportGraph",
"relatedGraph": "test1217",
"beginTime": "2018-12-17T12:55:40",
"endTime": "2018-12-17T12:56:32",
"jobDetail": {
"vertexsetPath": null,
"edgesetPath": [
{
"path": "hkmovie/edge.csv",
"log": null,
"cause": null,
"status": "success"
}
],
"schemaPath": [
{
"path": "hkmovie/schema.xml",
"log": null,
"cause": null,
"status": "success"
}
]
},
"jobProgress": 0
},
{
"jobId": "ff80808167bb90340167bc5d0b1d0358",
"status": "success",
"jobType": "GraphManagement",
"jobName": "DeleteGraph",
"relatedGraph": "test1218",
"beginTime": "2018-12-17T13:31:14",
"endTime": "2018-12-17T13:34:48",
"jobProgress": 0
}
]
}
Bad Request
{
"errorMessage" : "failed",
"errorCode" : "GES.9999"
}
Status Code
Status Code Description
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 695
Graph Engine Service(GES)
API Reference 8 Out-of-Date APIs
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 696
Graph Engine Service(GES)
API Reference 9 Appendix
9 Appendix
201 Created The request has been fulfilled and a new resource
has been created.
202 Accepted The request has been received but has not been
processed.
204 NoContent The request has been fulfilled, but the HTTP
response does not contain a response body.
The status code is returned in response to an HTTP
OPTIONS request.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 697
Graph Engine Service(GES)
API Reference 9 Appendix
205 Reset Content The server has successfully processed the request,
but does not return any content.
206 Partial Content The server has successfully processed the partial
GET request.
300 Multiple Choices There are multiple options for the location of the
requested resource. The response contains a list of
resource characteristics and addresses from which a
user terminal (such as a browser) can choose the
most appropriate one.
303 See Other The response to the request can be found under a
different URI.
The response to the request can be found under a
different URI, and should be retrieved using a GET
or POST method.
304 Not Modified The requested resource has not been modified. In
such a case, there is no need to retransmit the
resource since the client still has a previously-
downloaded copy.
401 Unauthorized This status code is returned after the client provides
the authentication information, indicating that the
authentication information is incorrect or invalid.
402 Payment Required This status code is reserved for future use.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 698
Graph Engine Service(GES)
API Reference 9 Appendix
403 Forbidden The server has received the request and understood
it, but the server is refusing to respond to it.
The server has received and understood the request;
yet it refused to respond, because the request is set
to deny access. Do not retry the request before
modification.
406 Not Acceptable The server could not fulfill the request according to
the content characteristics of the request.
407 Proxy This code is similar to 401, but indicates that the
Authentication client must first authenticate itself with the proxy.
Required
408 Request Time-out The server timed out waiting for the request.
The client may repeat the request without
modifications at any time later.
411 Length Required The server is refusing to process the request without
a defined Content-Length.
412 Precondition The server does not meet one of the preconditions
Failed that the requester puts on the request.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 699
Graph Engine Service(GES)
API Reference 9 Appendix
413 Request Entity Too The server is refusing to process a request because
Large the request entity is too large for the server to
process. The server may disable the connection to
prevent the client from sending requests
consecutively. If the server is only temporarily
unable to process the request, the response will
contain a Retry-After header field.
414 Request-URI Too The Request-URI is too long for the server to
Large process.
415 Unsupported The server does not support the media type in the
Media Type request.
417 Expectation Failed The server has failed to meet the requirements of
the Expect request-header field.
500 InternalServerEr- The server is able to receive the request but unable
ror to understand it.
501 Not Implemented The server does not support the requested function.
502 Bad Gateway The server was acting as a gateway or proxy and
received an invalid request from the remote server.
505 HTTP Version not The server does not support the HTTP protocol
supported version used in the request.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 700
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The graph The graph 1. Call the graph query API to
000 does not exist does not query all graphs.
or has been exist or has 2. Check whether the project
deleted. been ID or graph ID in the URL is
deleted. correct.
400 GES.7 The graph is The graph is 1. Call the graph query API to
001 not running. not running. query all graphs.
2. View the graph list returned
in the preceding step and
check whether the graph
status corresponding to the
graph ID in the URL is 200.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 701
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The graph is The graph is 1. Call the graph query API to
002 being backed being query all graphs.
up. backed up. 2. View the graph list returned
in the preceding step and
check whether the graph
status corresponding to the
graph ID in the URL is 903.
400 GES.7 The graph is The graph is 1. Call the graph query API to
003 being stopped being query all graphs.
or is stopped. stopped or 2. View the graph list returned
is stopped. in the preceding step and
check whether the graph
status corresponding to the
graph ID in the URL is 900
or 901.
400 GES.7 The job does The job does Check whether the job ID in the
007 not exist. not exist. URL is correct.
400 GES.7 The job The job The job operation is not
009 operation is operation is supported.
not not
supported. supported.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 702
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The path or The path or Check whether the name of the
011 name of the name of the scheme, vertex, or edge data
schema or schema or file is valid. The name can
data file is data file is contain only letters, digits,
invalid. invalid. underscores (_), exclamation
marks (!), hyphens (-), dot
marks (.), asterisks (*), left
brackets, right brackets, and
slashes (/).
400 GES.7 The graph The graph 1. Call the graph query API to
013 name already name query all graphs.
exists. already 2. Query the graph list
exists. returned in the preceding
step and check whether the
name field in the request
body already exists.
400 GES.7 The graph is The graph is 1. Call the graph query API to
015 not running not running query all graphs.
or is stopped. or is 2. View the graph list returned
stopped. in the preceding step and
check whether the graph
corresponding to the graph
ID in the URL exists or is in
the 900 status.
400 GES.7 The request The request Check the API reference and
016 body or body or ensure that every configuration
header is header is item in the request body and
invalid. invalid. header is correctly configured.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 703
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The object The object Check whether the schema,
017 does not does not vertex, and edge data files in
exist. Check exist. Check the request body exist on OBS.
whether the whether the
bucket or bucket or
object name object name
is correct. is correct.
400 GES.7 The number The number Call the quota query API to
018 of graphs or of graphs or check whether graphs have
edges reaches edges available quotas.
the upper reaches the
limit. upper limit.
400 GES.7 The number The number Call the quota query API to
019 of graph of graph check whether graph backups
backups backups have available quotas.
reaches the reaches the
upper limit. upper limit.
400 GES.7 The VPC does The VPC Check whether the VPC ID in
020 not exist. does not the request body exists.
exist.
400 GES.7 The subnet The subnet Check whether the subnet ID in
021 cannot be cannot be the request body exists or
found in the found in the belongs to the preceding VPC.
specified VPC. specified
VPC.
400 GES.7 The security The security Check whether the security
022 group does group does group ID in the request body
not exist. not exist. exists.
400 GES.7 The graph The graph Check whether the graph size
023 size index is size index is index in the request body is
invalid. invalid. valid.
400 GES.7 The graph The graph 1. Call the backup query API to
024 backup does backup does query all backups of a
not exist or not exist or specified graph.
has been has been 2. Check whether the backup
deleted. deleted. ID or graph ID in the URL is
correct.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 704
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The agency The agency Check whether the agency
029 resource resource resource reaches the quota
exceeds the exceeds the limit on the ManageOne
quota limit. quota limit. operation plane.
400 GES.7 Agency query Agency Check the error message for
030 error. query error. detailed information.
400 GES.7 The EIP The EIP Check whether the EIP resource
032 resource resource reaches the quota limit on the
exceeds the exceeds the VPC page.
quota limit. quota limit.
400 GES.7 Invalid EIP ID. Invalid EIP If the EIP binding type is set to
033 ID. bind_existing, ensure that the
EIP ID exists.
400 GES.7 Invalid region Invalid Enter the correct region code.
035 code. region code.
400 GES.7 The target The target A graph can only be upgraded
036 version is version is to a later version.
earlier than earlier than
the current the current
version. version.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 705
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The graph is The graph is Check whether the graph is in
037 not in the not in the the Stopped state.
Stopped Stopped
state. state.
400 GES.7 The graph is The graph is The graph is being created.
042 being created. being
created.
400 GES.7 Invalid CPU Invalid CPU Check whether the value of
052 architecture architecture arch is set to x86_64 or
of the graph of the graph aarch64 when the graph is
instance. instance. created.
400 GES.7 The graph is The graph is This error occurs in concurrent
054 being deleted being deletion scenarios. Generally, a
or has been deleted or message indicating that the
deleted. has been graph does not exist is
deleted. displayed when you try again
later.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 706
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.7 The IaaS The IaaS Check whether the compute
059 resources of resources of resources are sufficient. For
the graph the graph details about the IaaS resources
flavor to be flavor to be required by each GES flavor, see
scaled out are scaled out the LLD.
insufficient. are
insufficient.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 707
Graph Engine Service(GES)
API Reference 9 Appendix
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 708
Graph Engine Service(GES)
API Reference 9 Appendix
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 709
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.81 Invalid filter Invalid filter Check whether format of the
01 criteria for criteria for filter criteria for edge queries
edge queries. edge is correct.
queries.
400 GES.81 Invalid label Invalid label Check whether the labels are
02 for edge for edge in JSON format.
filtering filtering
queries. queries.
400 GES.81 Both the Both the The condition and label of
03 condition and condition edge filtering queries cannot
label of edge and label of be both empty.
filtering edge
queries are filtering
empty. queries are
empty.
400 GES.81 Invalid edge Invalid edge Check whether the edge
04 filtering query filtering filtering query sequence is
sequence. query valid.
sequence.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 710
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.81 The source The source Ensure that the source vertex
06 vertex or vertex or or target vertex in the edge
target vertex in target vertex details cannot be empty.
the edge in the edge
details is details is
empty. empty.
500 GES.81 Edge details Edge details Try again later or contact
08 query error. query error. technical personnel.
400 GES.81 Invalid edge Invalid edge Ensure that the values of
09 filtering query filtering edge filtering query operators
operator. query are in, out, both, and edge.
operator.
400 GES.82 Invalid label Invalid label Check whether the labels are
01 for vertex for vertex in JSON format.
filtering filtering
queries. queries.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 711
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.82 Both the Both the Ensure that the condition and
03 condition and condition label of vertex filtering
label of vertex and label of queries are not both empty.
filtering vertex
queries are filtering
empty. queries are
empty.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 712
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.82 Failed to add Failed to add Check whether the label
13 the vertex the vertex exists.
label. label.
500 GES.83 Job query error. Job query Try again later or contact
02 error. technical personnel.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 713
Graph Engine Service(GES)
API Reference 9 Appendix
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 714
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.85 The Gremlin The Gremlin Ensure that the Gremlin
05 query query query statement does not
statement does statement contain the command field.
not contain the does not
command contain the
field. command
field.
400 GES.85 The size of the The size of The current limit is 64 MB.
06 Gremlin query the Gremlin
request query
statements request
exceeds the statements
upper limit. exceeds the
upper limit.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 715
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.86 The request The request 1. Check whether the graph
09 body for body for name is correct.
querying path querying 2. Check whether the
details is path details parameter format of the
invalid. is invalid. API for querying path
details is correct.
3. If the fault persists, report
the error information in
errorMessage to technical
personnel.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 716
Graph Engine Service(GES)
API Reference 9 Appendix
400 GES.88 Failed to add a Failed to add 1. Check whether the label to
01 label to a label to be added already exists.
metadata. metadata. 2. Check whether the format
of the parameter for
adding the label is correct.
3. Check whether the
mandatory parameters for
adding the label are set.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 717
Graph Engine Service(GES)
API Reference 9 Appendix
The following is an example response. The value of id under projects is the project
ID. The following is an example response. If GES is deployed in the xxx region, the
value of name in the response body is xxx, and the value of id in projects is the
project ID.
{
"projects": [
{
"domain_id": "65382450e8f64ac0870cd180d14e684b",
"is_domain": false,
"parent_id": "65382450e8f64ac0870cd180d14e684b",
"name": "xxx",
"description": "",
"links": {
"next": null,
"previous": null,
"self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99"
},
"id": "a4a5d4098fb4474fa22cd05f897d6b99",
"enabled": true
}
],
"links": {
"next": null,
"previous": null,
"self": "https://www.example.com/v3/projects"
}
}
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 718
Graph Engine Service(GES)
API Reference 9 Appendix
The service_name indicates the abbreviation of the service name. Perform the
following steps to obtain the values of ges.region0_id and
external_global_domain_name:
Step 3 Choose Resource Statistics > Region to obtain the value of region0_id.
----End
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 719
Graph Engine Service(GES)
API Reference 9 Appendix
----End
After obtaining the service endpoint, you need to add the mapping between the
endpoint and IP address to the system hosts file.
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 720
Graph Engine Service(GES)
API Reference 9 Appendix
{IP}:{Endpoint}
----End
Issue 01 (2024-04-30) Copyright © Huawei Cloud Computing Technologies Co., Ltd. 721