文档首页> 图引擎服务 GES> API参考(吉隆坡区域)> 业务面API> 算法API> 算法API参数参考> 带一般过滤条件环路检测(filtered_circle_detection)(2.2.15)
更新时间:2022-08-09 GMT+08:00

带一般过滤条件环路检测(filtered_circle_detection)(2.2.15)

请求样例

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

参数说明

表1 parameters参数说明

参数

是否必选

说明

类型

取值范围

默认值

sources

查询的起始节点ID集合

String

-

标准csv格式,ID之间以英文逗号分隔,例如:“Alice,Nana”

n

枚举的满足过滤条件的圈的个数的上限

Integer

[1,100000]

100

statistics

是否输出所有满足过滤条件的圈的个数

Boolean

true或false

false

batch_number

批量处理的起始节点的个数

Integer

[1,1000]

10

output_format

输出结果的格式

String

vertexId,edgeId或edgeObject

edgeObject

filters

过滤条件列表,数组的每个元素分别对应每一层要做的查询和过滤条件。

Json

-

-

表2 filters元素格式

参数

是否必选

说明

类型

取值范围

默认值

operator

表示当前层要做的查询的方向

String

out,in 或both

out

edge_filter

表示当前层查询时边的过滤条件。具体格式请见 Filtered-query API中的表6 property_filter元素格式

Json

-

-

vertex_filter

表示当前层查询时点的过滤条件。具体格式请见 Filtered-query API中的表6 property_filter元素格式

Json

-

-

times

以相同的过滤条件查询的层数

Integer

[1,10]

1

  • 第一层的过滤条件是对初始节点的过滤,因此仅vertex_filter参数有效。
  • 最后一层的点过滤条件也是对初始节点的过滤。
  • 环路的长度范围是 3-10,因此过滤层数是 4-11 层。
表3 response_data 参数说明

参数

是否必选

类型

说明

circles

List

找到的圈集合。格式: [[circle1],[circle2],…], 其中circle的格式:

  • 若output_format=edgeObject,则为 [{“source”: sourceId,“target”: targetId, “index”:edgeIndex},…],其中,sourceId、targetId和edgeIndex均为string类型。
  • 若output_format=edgeId,则为 [sourceId-targetId-edgeIndex,…],其中sourceId-targetId-edgeIndex为string类型。
  • 若output_format=vertexId,则为[vertexId,…],其中vertexId为string类型。

runtime

Double

算法运行时间。

n

Integer

枚举圈的个数的上限。

circle_number

Integer

当statistics=true时,输出所有满足条件的圈的个数。