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

Filtered Circle Detection

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
        }
    ]
}

Parameters

Table 1 Parameter description

Parameter

Mandatory

Description

Type

Value Range

Default Value

sources

No

Set of source vertex IDs to be queried

String

-

The value is in the standard CSV format. IDs are separated by commas (,), for example, Alice, Nana.

n

No

Upper limit of the number of enumerated circles that meet the filter criteria

Integer

[1,100000]

100

statistics

No

Whether to export the number of circles that meet the filter criteria

Boolean

true or false

false

batch_number

No

Number of source vertices for batch processing

Integer

[1,1000]

10

output_format

No

Output format

String

vertexId, edgeId, or edgeObject

edgeObject

filters

Yes

Filter criteria. Each element in the array corresponds to a filter.

Object

-

-

Table 2 filters element formats

Parameter

Mandatory

Description

Type

Value Range

Default Value

operator

No

Direction of the query to be performed at the current layer

String

out, in, or both

out

edge_filter

No

Filter criteria for the current layer. For details, see Table 6 in the Filtered-query API.

Object

-

-

vertex_filter

No

Filter criteria of vertices at the current layer. For details, see Table 6 in the Filtered-query API.

Object

-

-

times

No

Number of layers queried using the same filter criteria

Integer

[1,10]

1

  • 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.
Table 3 response_data parameter description

Parameter

Mandatory

Type

Description

circles

Yes

List

Set of circles found. The format is [[circle1],[circle2], ...]. The circle format is as follows:

  • If output_format is edgeObject, the format is [{"source": sourceId, "target": targetId, "index": edgeIndex}, ...], where sourceId, targetId, and edgeIndex are of the string type.
  • If output_format is edgeId, the format is [sourceId-targetId-edgeIndex,…], where sourceId-targetId-edgeIndex is of the string type.
  • If output_format is vertexId, the format is [vertexId, ...], where vertexId is of the string type.

runtime

Yes

Double

Algorithm running time

n

Yes

Integer

Maximum number of enumerated circles

circle_number

No

Integer

When statistics is set to true, the number of circles that meet filter criteria is displayed.