版本

# 图查询接口


# 接口列表

# 1、节点及相关信息查询:

# 2、边及相关信息查询:

# 3、查询邻居:

# 4、路径查询:

# 5、其他:


# 通过节点唯一索引获取节点详细信息

# 简述

通过此接口,可以使用节点外部定义的唯一索引,获取节点详细信息,包括节点的类型,节点id,以及各个属性的值。

# 方法

void get_node(node_s &_return, 
              const string &db_name, 
              const node_index &node_index) 

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
node_index node_index 唯一索引 "" *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return node_s 节点的详细信息 * *

# 通过节点id获取节点详细信息

# 简述

通过此接口,可以使用节点的id,获取节点详细信息,包括节点的类型以及各个属性的值。其中节点的id可以通过其他查询时获得,其他查询包括但不限于查询邻居,路径查询,节点查询。

# 方法

void get_node_with_id(node_s &_return, 
                      const string &db_name, 
                      const int32_t id)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
id int32_t 节点id 0 0

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return node_s 节点的详细信息 * *

# 获取图中所有节点的数量

# 简述

通过此接口,可以使用数据库名,获取该数据库中节点的总数量。

# 方法

void get_graph_all_node_size(graph_node_size &_return, 
                             const string &db_name)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph_node_size 节点的数量 * *

# 通过节点的类型获取图中节点的数量

# 简述

通过此接口,可以使用数据库名与指定的类型名,获取该数据库中该类型下节点的总数量。

# 方法

void get_graph_node_size(graph_node_size &_return, 
                         const string &db_name, 
                         const string &node_type)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
node_type string 节点的类型 "" "person"

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph_node_size 节点的数量 * *

# 批量获取节点属性

# 简述

通过此接口,可以使用数据库名与节点的id,批量获取该数据库中节点的详细信息,包括节点的类型以及各个属性的值。

# 方法

void get_nodes_with_ids(nodes_s &_return, 
                        const string &db_name, 
                        const vector<int32_t> &ids)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
ids vector<int32_t> 节点id的集合 [] [12]

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return nodes_s 节点属性 * *

# 批量获取边的属性

# 简述

通过此接口,可以使用数据库名,边的基础id,批量获取该数据库中节点的详细信息,包括边的起点id,终点id与,边的类型以及边上各个属性的值。

# 方法

get_edges_with_basic_ids(edges_s &_return, 
                         const string &db_name, 
                         const vector<edge_basic_id> &edge_basic_ids)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
edge_basic_ids vector<edge_basic_id> 边的信息 [] []

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return edges_s 边的属性 * *

# 通过边的唯一索引获取边的详细信息

# 简述

通过此接口,可以使用数据库名,边的唯一索引,批量获取该数据库中边的详细信息,包括边的起点id与类型,终点id与类型,边的类型以及边上各个属性的值。

# 方法

void get_edge(edge_s &_return,
              const string &db_name, 
              const edge_index &edge_index)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
edge_index edge_index 唯一索引 "" *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return edge_s 边的详细信息 * *

# 通过边的id获取边的详细信息

# 简述

通过此接口,可以使用数据库名,边的id,获取该数据库中边的详细信息,包括边的起点id,终点id,边的类型以及边上各个属性的值。

# 方法

void get_edge_with_basic_id(edge_s &_return, 
                            const string &db_name, 
                            const edge_basic_id &edge_basic_id)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
edge_basic_id edge_basic_id 边的id * *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return edge_s 边的详细信息 * *

# 获取图中所有边的数量

# 简述

通过此接口,可以使用数据库名,获取对应数据库中边的总数量。

# 方法

void get_graph_all_edge_size(graph_edge_size &_return, 
                             const string &db_name) 

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph_edge_size 边的数量 * *

# 通过边的类型获取图中边的数量

# 简述

通过此接口,可以使用数据库名与指定的类型名,获取该数据库中该类型下边的总数量。

# 方法

void get_graph_edge_size(graph_edge_size &_return, 
                         const string &db_name, 
                         const string &edge_type)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
edge_type string 边的类型 "" "use"

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph_edge_size 边的数量 * *

# 查询一阶邻居

# 方法

void query_one_neighbour(one_neighbour &_return, 
                         const std::string &db_name, 
                         const int32_t node_id, 
                         const search_direction_type::type search_direction)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
node_id int32_t 节点ID 0 0
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return one_neighbour 一阶邻居信息 * *

# 查询邻居

# 方法

void query_neighbour(neighbour &_return, 
                     const std::string &db_name,
                     const int32_t node_id, 
                     const int32_t k_min, 
                     const int32_t k_max,  
                     const search_direction_type::type search_direction,
                     const std::string &condition,
                     const bool return_relations);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_id string 起始节点ID * 1
k_min int32_t 起始邻居层数 * 1 小于等于k_max, 大于0
k_max int32_t 终止邻居层数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明
return_relations bool 是否返回边信息 * true

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return neighbour 邻居结构 * *

# 轻量查询邻居

# 方法

void query_simple_neighbour(neighbour_simple_v2 &_return, 
                            const std::string &db_name,
                            const int32_t node_id, 
                            const int32_t k_min, 
                            const int32_t k_max,  
                            const search_direction_type::type search_direction,
                            const std::string &condition);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_id string 起始节点ID * 1
k_min int32_t 起始邻居层数 * 1 小于等于k_max, 大于0
k_max int32_t 终止邻居层数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return neighbour_simple_v2 邻居结构 * *

# 多点公共邻居查询

# 方法

query_common_simple_neighbour(::ezoodb::thrift::common_simple_neighbour &_return,
                              const std::string &db_name,
                              const std::vector<int32_t> &ids,
                              const int32_t k_min,
                              const int32_t k_max,
                              const ::ezoodb::thrift::search_direction_type::type search_direction,
                              const std::string &condition);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
ids std::vector<int32_t> 节点id列表 * [0, 1, 2]
k_min int32_t 起始邻居层数 * 1 小于等于k_max, 大于0
k_max int32_t 终止邻居层数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return common_simple_neighbour 多节点之间的公共邻居 * *

# 查询邻居数量

# 方法

void query_neighbour_count(::ezoodb::thrift::neighbour_count_v2 &_return, 
                                const std::string &db_name,
                                const int32_t node_id, 
                                const int32_t k_min, 
                                const int32_t k_max,
                                const ::ezoodb::thrift::search_direction_type::type search_direction,
                                const std::string &condition);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_id string 起始节点ID * "6da2kgeqj2nvla1kg3"
k_min int32_t 起始邻居层数 * 1 小于等于k_max, 大于0
k_max int32_t 终止邻居层数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * 2 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return neighbour_count_v2 邻居数量结构 * *

# 路径查询

# 方法

void query_path(paths &_return,
	            const std::string &db_name,
	            const int32_t src_node_id,
	            const int32_t dest_node_id,
                const int32_t k_min,
	            const int32_t k_max,
	            const ::ezoodb::thrift::search_direction_type::type search_direction,
	            const std::string &condition,
	            const int32_t max_size,
                const int32_t query_type);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
src_node_id int32_t 起始节点ID * 1
dest_node_id int32_t 终点节点ID * 2
k_min int32_t 起始邻居层数 * 1 小于等于k_max, 大于0
k_max int32_t 最大跳数 * 2 从起点ID开始以最大条数查询到终点ID
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明
max_size int32_t 返回的最大路径数 * 5
query_type int32_t 查询类型 * 1 1:普通路径查询;2:全路径去重(点);3:全路径不去重。

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths 路径结构 * *

# 轻量路径查询

# 方法

void query_simple_path(paths_simple_v2 &_return,
	            const std::string &db_name,
	            const int32_t src_node_id,
	            const int32_t dest_node_id,
	            const int32_t k_max,
	            const ::ezoodb::thrift::search_direction_type::type search_direction,
	            const std::string &condition,
	            const int32_t max_size);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
src_node_id int32_t 起始节点ID * 1
dest_node_id int32_t 终点节点ID * 2
k_max int32_t 最大跳数 * 2 从起点ID开始以最大条数查询到终点ID
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明
max_size int32_t 返回的最大路径数 * 5

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths_simple_v2 路径结构 * *

# 全路径查询

# 方法

void query_full_path(paths_simple_v2 &_return,
	            const std::string &db_name,
	            const int32_t src_node_id,
	            const int32_t dest_node_id,
	            const int32_t k_max,
	            const ::ezoodb::thrift::search_direction_type::type search_direction,
	            const std::string &condition,
	            const int32_t max_size,
                const bool distinct);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
src_node_id int32_t 起始节点ID * 1
dest_node_id int32_t 终点节点ID * 2
k_max int32_t 最大跳数 * 2 从起点ID开始以最大条数查询到终点ID
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明
max_size int32_t 返回的最大路径数 * 5
distinct bool 是否去重 * true

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths_simple_v2 路径结构 * *

# 通过邻居查询子图

# 方法

void query_subgraph_with_neighbour(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const int32_t node_id,
	                const int32_t k_min,
	                const int32_t k_max,
	                const ::ezoodb::thrift::search_direction_type::type search_direction,
	                const std::string &condition);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_id int32_t 起始节点ID * 1
k_min int32_t 起始跳数 * 1 小于等于k_max, 大于0
k_max int32_t 终止跳数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph 图结构 * *

# 通过节点查询子图

# 方法

void query_subgraph_with_node(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const std::vector<int32_t> &ids);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
ids vector<int32_t> 节点列表 *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph 图结构 * *

# 通过类型查询子图

# 方法

void query_subgraph_with_type(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const std::vector<std::string> &node_type_list,
                    const std::vector<std::string> &edge_type_list);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_type_list vector 节点类型列表 *
edge_type_list vector 边类型列表 *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph 图结构 * *

# 通过邻居创建子图

# 方法

void create_subgraph_with_neighbour(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const int32_t node_id,
	                const int32_t k_min,
	                const int32_t k_max,
	                const ::ezoodb::thrift::search_direction_type::type search_direction,
	                const std::string &condition,
                    const std::string &new_db_name, const bool readonly);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_id int32_t 起始节点ID * 1
k_min int32_t 起始跳数 * 1 小于等于k_max, 大于0
k_max int32_t 终止跳数 * 5 大于等于k_min
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
condition string 过滤条件 * "node::person.age = 10" 条件过滤参数说明
new_db_name string 新的图名 *
readonly bool 新图是否为只读 *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return Response 图结构 * *

# 通过节点创建子图

# 方法

void create_subgraph_with_node(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const std::vector<int32_t> &ids,
                    const std::string &new_db_name, const bool readonly);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
ids vector<int32_t> 节点列表 *
new_db_name string 新的图名 *
readonly bool 新图是否为只读 *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return Response 图结构 * *

# 通过类型创建子图

# 方法

void create_subgraph_with_type(::ezoodb::thrift::graph_v2 &_return,
	                const std::string &db_name,
	                const std::vector<std::string> &node_type_list,
                    const std::vector<std::string> &edge_type_list,
                    const std::string &new_db_name, const bool readonly);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 * "ezoo"
node_type_list vector 节点类型列表 *
edge_type_list vector 边类型列表 *
new_db_name string 新的图名 *
readonly bool 新图是否为只读 *

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return Response 图结构 * *

# 获取SCHEMA集合

# 简述

通过此接口,可以批量获取当前服务中图数据库的结构定义,包括点边类型与各个类型的定义等。

# 方法

void get_graph_schema_list(graph_schema_list &_return,
                           const vector<string> &db_name_list)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name_list vector<string> 数据库名称列表 * ["ezoo"]

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return graph_schema_list schema列表 * *

# 批量获取节点信息

# 简述

通过此接口,可以使用数据库名,起点id,预期获取数量,批量获取从起始id开始,包含节点的唯一索引,类型,节点id。

# 方法

void get_node_s_batch(node_list &_return, 
                      const string &db_name, 
                      const int32_t src_id,
                      const int32_t count)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
src_id int32_t 起点ID 0 0
count int32_t 数量 0 0

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return node_list 节点列表 * *

# 批量获取邻接图的信息

# 简述

通过此接口,可获取图中各节点间的邻接关系(只展示节点间是否存在边,不关心边的类型与数量)。提供了顺序获取与批量获取两种方法。顺序获取输入为起点id(src_id)与获取数量(count)参数,可获取src_id起,count个可用的id与他们身上所有的出边与入边。批量获取输入为起点id的集合(src_ids),可获得集合中所有点与他们身上所有的出边和入边(要求集合中所有的id真实有效)。当选择一种方法后,另一种方法对应的参数的数据不生效。

# 方法

void get_basic_graph(return_graph &_return, 
                   const string &db_name, 
                   const int32_t src_id, 
                   const int32_t count,
                   const vector<int32_t> src_ids,
                   const bool if_order)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
src_id int32_t 顺序获取起点ID 0 0
count int32_t 顺序获取数量 0 0
src_ids vector<int32_t> 批量获取用起点ID 0 0
if_order bool 是否使用顺序获取模式 0 0

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return return_graph 图的基础信息 * *

# 批量获取关系图的信息

# 简述

通过此接口,可获取图中各节点间的关系(展示两点间所有边以及他们的类型与id)。提供了顺序获取与批量获取两种方法。顺序获取输入为起点id(src_id)与获取数量(count)参数,可获取src_id起,count个可用的id与他们身上所有的出边与入边。批量获取输入为起点id的集合(src_ids),可获得集合中所有点与他们身上所有的出边和入边(要求集合中所有的id真实有效)。当选择一种方法后,另一种方法对应的参数的数据不生效。

# 方法

void get_rel_graph(return_graph &_return, 
                   const string &db_name, 
                   const int32_t src_id, 
                   const int32_t count,
                   const vector<int32_t> src_ids,
                   const bool if_order)

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
src_id int32_t 顺序获取起点ID 0 0
count int32_t 顺序获取数量 0 0
src_ids vector<int32_t> 批量获取用起点ID 0 0
if_order bool 是否使用顺序获取模式 0 0

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return return_graph 图的基础信息 * *

# 通过指定属性过滤查询邻居

# 简述

通过此接口,可以通过指定起点,边,终点的类型和属性来查找对应的邻居关系。

# 方法

void query_neighbour_with_prop_filter(::ezoodb::thrift::unified_response &_return, 
                                        const std::string &db_name, 
                                        const ::ezoodb::thrift::node_filter &start_node, 
                                        const ::ezoodb::thrift::edge_filter &edge, 
                                        const ::ezoodb::thrift::node_filter &end_node, 
                                        const ::ezoodb::thrift::search_direction_type::type search_direction, 
                                        const int32_t k_min, 
                                        const int32_t k_max);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
start_node node_filter 起点过滤条件 类型和属性不可空
edge edge_filter 边过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
end_node node_filter 终点过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
k_min int32_t 起始跳数 * 1 小于等于k_max, 大于0
k_max int32_t 终止跳数 * 5 大于等于k_min

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return one_neighbour_l1 * *

# 通过指定属性过滤查询路径

# 简述

通过此接口,可以通过指定起点,边,终点的类型和属性来查找对应的路径。

# 方法

void query_path_with_prop_filter(::ezoodb::thrift::unified_response &_return, 
                                const std::string &db_name, 
                                const ::ezoodb::thrift::node_filter &start_node, 
                                const ::ezoodb::thrift::edge_filter &edge, 
                                const ::ezoodb::thrift::node_filter &end_node, 
                                const ::ezoodb::thrift::search_direction_type::type search_direction, 
                                const int32_t k_min, 
                                const int32_t k_max, 
                                const ::ezoodb::thrift::distinct_type::type distinct);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
start_node node_filter 起点过滤条件 类型和属性不可空
edge edge_filter 边过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
end_node node_filter 终点过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
k_min int32_t 起始跳数 * 1 小于等于k_max, 大于0
k_max int32_t 终止跳数 * 5 大于等于k_min
distinct distinct_type::type 去重策略 * distinct_edge 去重参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths_l1 * *

# 通过指定边类型查询邻居

# 简述

通过此接口,可以通过指定起点,终点的类型和属性以及边的类型来查找对应的一阶邻居关系。

# 方法

void query_neighbour_with_edge_filter(::ezoodb::thrift::unified_response &_return, 
                                        const std::string &db_name, 
                                        const ::ezoodb::thrift::node_filter &start_node, 
                                        const std::string &edge_type, 
                                        const bool is_valid_edge, 
                                        const ::ezoodb::thrift::node_filter &end_node, 
                                        const ::ezoodb::thrift::search_direction_type::type search_direction);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
start_node node_filter 起点过滤条件 类型和属性不可空
edge_type string 边类型过滤条件 与is_valid_edge结合使用
is_valid_edge bool 边类型过滤方式 * true true:符合edge_type的边被选择;false:不符合edge_type的边被选择
end_node node_filter 终点过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return one_neighbour_l1 * *

# 通过指定属性统计邻居数量并排序

# 简述

通过此接口,可以通过指定起点,边的类型和属性以及终点的类型来查找对应的邻居,通过指定终点的属性对其结果进行数量统计和排序。

# 方法

void count_neighbour_with_prop_filter(::ezoodb::thrift::unified_response &_return, 
                                    const std::string &db_name, 
                                    const ::ezoodb::thrift::node_filter &start_node, 
                                    const ::ezoodb::thrift::edge_filter &edge, 
                                    const std::string &end_node_type, 
                                    const std::string &end_node_order_prop_name, 
                                    const ::ezoodb::thrift::search_direction_type::type search_direction, 
                                    const int32_t k_min, 
                                    const int32_t k_max);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
start_node node_filter 起点过滤条件 类型和属性不可空
edge edge_filter 边过滤条件 type不可为空
end_node_type string 终点类型 "" "person"
end_node_order_prop_name string 终点统计属性名称 "" "age"
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
k_min int32_t 起始跳数 * 1 小于等于k_max, 大于0
k_max int32_t 终止跳数 * 5 大于等于k_min

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return count_neighbour_l1 * *

# 通过指定多个边类型查询邻居

# 简述

通过此接口,可以通过指定起点,终点的类型和属性以及多终边类型来查找对应的一阶邻居关系。

# 方法

void query_neighbour_with_multi_edge_filter(::ezoodb::thrift::unified_response &_return, 
                                            const std::string &db_name, 
                                            const ::ezoodb::thrift::node_filter &start_node, 
                                            const std::vector<std::string> &edge_type_list, 
                                            const ::ezoodb::thrift::node_filter &end_node, 
                                            const ::ezoodb::thrift::search_direction_type::type search_direction);

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
start_node node_filter 起点过滤条件 类型和属性不可空
edge_type_list list 多种边类型
end_node node_filter 终点过滤条件 其中type为空时代表不进行任何校验;type不为空props为空时代表只进行类型校验;type和props都不为空时都进行校验
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths_l1 * *

# 查询公共关系

# 简述

通过此接口,可以通过指定多个点的类型和属性查询之间的公共关系。

# 方法

void query_common_relation(::ezoodb::thrift::unified_response &_return, 
                            const std::string &db_name, 
                            const std::vector< ::ezoodb::thrift::node_filter> &node_list, 
                            const int32_t k_max, 
                            const ::ezoodb::thrift::search_direction_type::type search_direction, 
                            const ::ezoodb::thrift::distinct_type::type distinct) override;

# 参数

参数列表 类型 描述 是否可空 默认值 示例 备注
db_name string 数据库名称 "" "ezoo"
node_list list<node_filter> node_filter 起点过滤条件 类型和属性不可空
k_max int32_t 终止跳数 * 5 大于等于1
search_direction search_direction_type::type 搜索方向 * search_direction_in 方向参数说明
distinct distinct_type::type 去重策略 * distinct_edge 去重参数说明

# 返回值

参数列表 类型 描述 是否可空 默认值 示例 备注
_return paths_l1 * *

最近一次更新时间: 9/7/2022, 9:41:26 AM