Updated on 2024-01-04 GMT+08:00

Common Algorithm Parameters

Request Example

{
 "algorithmName":"XXX",
 "parameters":{
         ...
 }
}

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

algorithmName

Yes

String

Algorithm name.

Available values are as follows (algorithm names you can call):

  • pagerank
  • personalrank
  • kcore
  • k_hop
  • shortest_path
  • all_shortest_paths
  • filtered_shortest_path
  • sssp
  • shortest_path_of_vertex_sets
  • n_paths
  • closeness
  • label_propagation
  • louvain
  • link_prediction
  • node2vec
  • realtime_recommendation
  • common_neighbors
  • connected_component
  • degree_correlation
  • triangle_count
  • cluster_coefficient
  • common_neighbors_of_vertex_sets
  • all_shortest_paths_of_vertex_sets
  • filtered_circle_detection
  • filtered_all_pairs_shortest_paths
  • filtered_all_shortest_paths
  • filtered_n_paths

parameters

Yes

Object

Algorithm parameters. For details, see the parameter description of each algorithm.

Table 2 New Body parameters of version 2.1.7

Parameter

Mandatory

Type

Description

executionMode

No

String

  • sync: synchronous
  • async: asynchronous

The default value is async.

Supported algorithms are as follows (algorithm names you can call):

  • k_hop
  • shortest_path
  • all_shortest_paths
  • filtered_shortest_path
  • shortest_path_of_vertex_sets
  • n_paths
  • realtime_recommendation

offset

No

Integer

Synchronization result offset. The default value is 0.

NOTE:

This parameter is available when executionMode is sync.

Supported algorithms are as follows (algorithm names you can call):

  • k_hop
  • shortest_path
  • all_shortest_paths
  • shortest_path_of_vertex_sets
  • n_paths
  • realtime_recommendation
  • filtered_all_pairs_shortest_paths
  • filtered_all_shortest_paths

limit

No

Integer

Maximum number of returned synchronization results. The maximum value is 100000. The default value is 100000.

NOTE:

This parameter is available when executionMode is sync.

Supported algorithms are as follows (algorithm names you can call):

  • k_hop
  • shortest_path
  • all_shortest_paths
  • shortest_path_of_vertex_sets
  • n_paths
  • realtime_recommendation
  • filtered_all_pairs_shortest_paths
  • filtered_all_shortest_paths
Table 3 New Body parameters of version 2.2.4

Parameter

Mandatory

Type

Description

vertex_filter

No

Object

Filter criteria for the vertices on a path.

Supported algorithms are as follows (algorithm names you can call):

  • filtered_shortest_path
  • filtered_all_pairs_shortest_paths
  • filtered_all_shortest_paths

For details about the format, see Table 6 in "Filtered-query API".

edge_filter

No

Object

Filter criteria for the edges (relationships) on a path.

Supported algorithms are as follows (algorithm names you can call):

  • filtered_shortest_path
  • filtered_all_pairs_shortest_paths
  • filtered_all_shortest_paths

For details about the format, see Table 6 in "Filtered-query API".

filters

No

Object

Filter criteria. Each element in the array corresponds to a filter. This parameter applies only to filtered circle detection. For details about the format, see filters element formats.

Supported algorithms:

  • filtered_n_paths

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

{
    "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"
}

response_data indicates the result of each algorithm. The results vary with algorithms.

Status code: 400

Example response for a failed request

Http Status Code: 400
{
"errorMessage":"Running algorithm [XXXX] error: YYYYYYYYY!",
"errorCode":"GES.8301"
}

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

errorMessage

String

System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error message.

errorCode

String

System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error code.

status

String

Returned job status for a successful query. Possible values are waiting, running, and complete. This parameter is left blank when the query fails.

data

Object

Algorithm execution result. This parameter is left blank when the query fails.