# 图更新接口
# 接口列表
# 图实体更新:
- 添加节点
- 添加或更新节点
- 通过节点id删除节点
- 修改节点
- 通过节点id修改节点
- 批量修改节点
- 通过节点id批量修改节点
- 添加边
- 通过节点id添加边
- 添加或更新边
- 通过节点id添加或更新边
- 通过边id删除边
- 删除起终点之间的所有边
- 修改边
- 通过边id修改边
- 批量修改边
- 通过边id批量修改边
# 图定义更新:
# 基于文件导入
# 添加节点
# 方法
void add_node(add_node_response &_return,
const string &db_name,
const string &node_type,
const vector<map<string, string>> &node_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "use" | |
node_props_list | vector<map> | 节点属性 | 否 | * | [{"name":"ezoo"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_node_response | 添加节点响应结果 | 否 | * | * |
# 添加或更新节点
# 方法
void add_or_update_node(add_node_response &_return,
const string &db_name,
const string &node_type,
const vector<map<string, string>> &node_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "use" | |
node_props_list | vector<map> | 节点属性 | 否 | * | [{"name":"ezoo"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_node_response | 添加节点响应结果 | 否 | * | * |
# 通过节点id删除节点
# 方法
void remove_node(Response &_return,
const string &db_name,
const int32_t id)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
id | int32_t | 节点ID | 否 | 0 | 0 |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 删除节点响应结果 | 否 | * | * |
# 修改节点
# 方法
void update_node(update_node_response &_return,
const string &db_name,
const node_index &node_index,
const map<string, string> &node_props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_index | node_index | 节点索引 | 否 | * | ||
node_props | map<string, string> | 节点属性 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_node_response | 修改节点响应结果 | 否 | * | * |
# 通过节点id修改节点
# 方法
void update_node_with_id(update_node_response &_return,
const string &db_name,
const int32_t id,
const map<string, string> &node_props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
id | int32_t | 节点ID | 否 | * | 0 | |
node_props | map | 节点属性 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_node_response | 修改节点响应结果 | 否 | * | * |
# 批量修改节点
# 方法
void update_nodes(update_node_response &_return,
const string &db_name,
const vector<node_index> &node_index_list,
const vector<map<string, string>> &node_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_index_list | vector<node_index> | 节点索引列表 | 否 | * | node_index | |
node_props_list | vector<map<string, string>> | 节点属性列表 | 否 | * |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_nodes_response | 修改节点响应结果 | 否 | * | * |
# 通过节点id批量修改节点
# 方法
void update_nodes_with_ids(update_node_response &_return,
const string &db_name,
const vector<int32_t> ids,
const vector<map<string, string>> &node_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
ids | vector<int32_t> | 节点ID列表 | 否 | * | 0 | |
node_props_list | vector<map<string, string>> | 节点属性列表 | 否 | * |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_nodes_response | 修改节点响应结果 | 否 | * | * |
# 添加边
# 方法
void add_edge(add_edge_response &_return,
const string &db_name,
const string &edge_type,
const vector<node_index> &src_node_index_list,
const vector<node_index> &dest_node_index_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
src_node_index_list | vector<node_index> | 起点索引列表 | 否 | * | * | |
dest_node_index_list | vector<node_index> | 终点索引列表 | 否 | * | * | |
edge_props_list | vector<map> | 边属性列表 | 否 | * | [{"name":"name"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_edge_response | 添加边响应结果 | 否 | * | * |
# 通过节点id添加边
# 方法
void add_edge_by_id(add_edge_response &_return,
const string &db_name,
const string &edge_type,
const vector<int32_t> &src_node_id_list,
const vector<int32_t> &dest_node_id_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
src_node_id_list | vector<int32_t> | 起点id列表 | 否 | * | * | |
dest_node_id_list | vector<int32_t> | 终点id列表 | 否 | * | * | |
edge_props_list | vector<map> | 边属性列表 | 否 | * | [{"name":"name"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_edge_response | 添加边响应结果 | 否 | * | * |
# 添加或更新边
# 方法
void add_or_update_edge(add_edge_response &_return,
const string &db_name,
const string &edge_type,
const vector<node_index> &src_node_index_list,
const vector<node_index> &dest_node_index_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
src_node_index_list | vector<node_index> | 起点索引列表 | 否 | * | * | |
dest_node_index_list | vector<node_index> | 终点索引列表 | 否 | * | * | |
edge_props_list | vector<map> | 边属性列表 | 否 | * | [{"name":"name"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_edge_response | 添加边响应结果 | 否 | * | * |
# 通过节点id添加或更新边
# 方法
void add_or_update_edge_with_id(add_edge_response &_return,
const string &db_name,
const string &edge_type,
const vector<int32_t> &src_node_id_list,
const vector<int32_t> &dest_node_id_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
src_node_id_list | vector<int32_t> | 起点id列表 | 否 | * | * | |
dest_node_id_list | vector<int32_t> | 终点id列表 | 否 | * | * | |
edge_props_list | vector<map> | 边属性列表 | 否 | * | [{"name":"name"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | add_edge_response | 添加边响应结果 | 否 | * | * |
# 通过边id删除边
# 方法
void remove_edge(Response &_return,
const string &db_name,
const edge_basic_id &edge_id)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_id | edge_basic_id | 边的基础信息 | 否 | * | * |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 删除边响应结果 | 否 | * | * |
# 删除起终点之间的所有边
# 方法
void remove_all_edge(Response &_return,
const string &db_name,
const int32_t src_node_id,
const int32_t dest_node_id,
const string &type);
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
src_node_id | int32_t | 起始节点ID | 否 | * | 1 | |
dest_node_id | int32_t | 终点节点ID | 否 | * | 2 | |
type | string | 边类型 | 否 | * | "use" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 删除边响应结果 | 否 | * | * |
# 修改边
# 方法
void update_edge(update_edge_response &_return,
const string &db_name,
const edge_index &edge_index,
const map<string, string> &edge_props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_index | edge_index | 边索引 | 否 | * | * | |
node_props | map | 边属性 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_edge_response | 修改边响应结果 | 否 | * | * |
# 通过边id修改边
# 方法
void update_edge_with_id(update_edge_response &_return,
const string &db_name,
const edge_basic_id &edge_id,
const map<string, string> &edge_props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_id | edge_basic_id | 边id | 否 | * | * | edge_basic_id |
node_props | map | 边属性 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_edge_response | 修改边响应结果 | 否 | * | * |
# 批量修改边
# 方法
void update_edges(update_edge_response &_return,
const string &db_name,
const vector<edge_index> &edge_index_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_index_list | vector<edge_index> | 边索引列表 | 否 | * | * | edge_index |
edge_props_list | vector<map<string, string>> | 边属性列表 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_edges_response | 修改边响应结果 | 否 | * | * |
# 通过边id批量修改边
# 方法
void update_edges_with_ids(update_edge_response &_return,
const string &db_name,
const vector<edge_basic_id> &edge_id_list,
const vector<map<string, string>> &edge_props_list)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_id_list | vector<edge_basic_id> | 边id列表 | 否 | * | * | edge_basic_id |
edge_props_list | vector<map<string, string>> | 边属性列表 | 否 | * | {"name":"ezoo"} |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | update_edges_response | 修改边响应结果 | 否 | * | * |
# 添加节点定义属性
# 方法
void add_node_property(Response &_return,
const string &db_name,
const string &node_type,
const string &name,
const string &type,
const string &default_value,
const int32_t cache_level)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "user" | |
name | string | 属性名称 | 否 | * | "age" | |
type | string | 属性类型 | 否 | * | "int" | 数据类型说明 |
default_value | string | 默认值 | 否 | * | "0" | |
cache_level | int32_t | 是否启用内存加速 | 否 | * | 0 |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 删除节点定义属性
# 方法
void remove_node_property(Response &_return,
const string &db_name,
const string &node_type,
const string &name)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "user" | |
name | string | 属性名称 | 否 | * | "age" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 添加边定义属性
# 方法
void add_edge_property(Response &_return,
const string &db_name,
const string &edge_type,
const string &name,
const string &type,
const string &default_value,
const bool cache_level)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
name | string | 属性名称 | 否 | * | "age" | |
type | string | 属性类型 | 否 | * | "int" | 数据类型说明 |
default_value | string | 默认值 | 否 | * | "0" | |
cache_level | int32_t | 是否启用内存加速 | 否 | * | 0 |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 删除边定义属性
# 方法
void remove_edge_property(Response &_return,
const string &db_name,
const string &edge_type,
const string &name)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
name | string | 属性名称 | 否 | * | "food" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 新增节点类型
# 方法
void create_node_type(Response &_return,
const string &db_name,
const string &node_type,
const vector<index> &indexes,
const vector<map<string, string>> &props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "person" | |
indexes | vector<index> | 唯一索引 | 否 | * | * | index |
props | vector<map> | 节点属性 | 否 | * | [{"name":"identity","type":"string"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 新增边类型
# 方法
void create_edge_type(Response &_return,
const string &db_name,
const string &edge_type,
const vector<index> &indexes,
const vector<map> &props)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "eat" | |
indexes | vector<index> | 唯一索引 | 否 | * | * | index |
props | vector<map> | 边属性 | 否 | * | [{"name":"lasttime","type":"int"}] |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 删除节点类型及相关数据
# 方法
void drop_node_type(Response &_return,
const string &db_name,
const string &node_type)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
node_type | string | 节点类型 | 否 | * | "eat" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 删除边类型及相关数据
# 方法
void drop_edge_type(Response &_return,
const string &db_name,
const string &edge_type)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | * | "ezoo" | |
edge_type | string | 边类型 | 否 | * | "use" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 修改节点响应结果 | 否 | * | * |
# 通过文件导入节点信息
# 方法
void import_node_from_file(Response& _return,
const string& db_name,
const string& node_type,
const vector<map<string, string>>& props,
const string& path,
const string& file_type);
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | "" | "ezoo" | |
node_type | string | 节点类型 | 否 | "" | "person" | |
props | vector<map> | 属性 | 否 | [] | [{"name": "name","column": 0}] | |
path | string | 数据文件路径 | 否 | "" | "./person.csv" | |
file_type | string | 文件格式 | 否 | "" | "csv" |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 获取数据库状态响应结果 | 否 | * | * |
# 通过文件导入边的信息
# 方法
void import_edge_from_file(Response& _return,
const string& db_name,
const string& edge_type,
const vector<map<string, string>>& props,
const string& path,
const string& file_type,
const unique_node &start_node,
const unique_node &end_node)
# 参数
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
db_name | string | 数据库名称 | 否 | "" | "ezoo" | |
edge_type | string | 边类型 | 否 | "" | "use" | |
props | vector<map> | 属性 | 否 | [] | [{"name": "name","column": 0}] | |
path | string | 数据文件路径 | 否 | "" | "./use.csv" | |
file_type | string | 文件格式 | 否 | "" | "csv" | |
start_node | unique_node | 起点ID对应的文件列 | 否 | * | * | |
end_node | unique_node | 终点ID对应的文件列 | 否 | * | * |
# 返回值
参数列表 | 类型 | 描述 | 是否可空 | 默认值 | 示例 | 备注 |
---|---|---|---|---|---|---|
_return | Response | 获取数据库状态响应结果 | 否 | * | * |