修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      展开

      语句 spread().src().depth() 可以查询一个起点的 KHop 之内的所有边,可以对 K 值,支持对起点、所有边、所有邻居点进行过滤,可限制子查询返回的结果数量。该语句按照由浅到深的顺序返边所代表的一步路径(起点-边-终点)。

      与 K 邻查询相同,展开也是一种 BFS(广度优先)方式的查询,是图计算与分析领域中的一个很常用的手段,用于观察某一个实体周围的层层关系,快速检索并获取数据。

      语法:

      • 语句别名:支持,结构为 PATH
      • 全部参数:
      参数 类型 规范 描述 参数别名结构
      src() filter / 路径起点的过滤条件;多个点满足条件时会报错 NODE
      depth() int >0 展开的最大深度 不支持
      node_filter() filter / 邻居点(非 src)的过滤条件 不支持
      edge_filter() filter / 所有边的过滤条件 不支持
      direction() string left, right 规定边的方向 不支持
      limit() int -1 或 >=0 子查询返回结果的条数,-1 表示返回所有结果 不支持

      示例图集:(以下示例将在本图基础上运行)

      (图中点、边 schema 均为 default)
      在空图集中依次运行以下各行代码以创建该图数据:

      create().edge_property(@default, "weight", int32)
      insert().into(@default).nodes([{_id:"A", _uuid:1}, {_id:"B", _uuid:2}, {_id:"C", _uuid:3}, {_id:"D", _uuid:4}, {_id:"E", _uuid:5}, {_id:"F", _uuid:6}])
      insert().into(@default).edges([{_uuid:1, _from_uuid:1, _to_uuid:3, weight:1}, {_uuid:2, _from_uuid:5, _to_uuid:2 , weight:1}, {_uuid:3, _from_uuid:1, _to_uuid:5 , weight:4}, {_uuid:4, _from_uuid:4, _to_uuid:3 , weight:2}, {_uuid:5, _from_uuid:5, _to_uuid:4 , weight:3}, {_uuid:6, _from_uuid:2, _to_uuid:1 , weight:2}, {_uuid:7, _from_uuid:6, _to_uuid:1 , weight:4}])
      

      过滤路径深度

      示例:查找点 D 的 1~2-Hop 边,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(2) as e
      return e{*}
      

      A --1--> C
      E --5--> D
      A --3--> E
      D --4--> C
      E --2--> B
      B --6--> A
      

      分析:边 6 的起点、终点均为点 D 的 2-Hop 邻居,边 6 是点 D 的 2-hop 边。

      过滤邻居点

      示例:查找点 D 的 1~2-Hop 边,要求不经过点 E,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(2)
        .node_filter({_id != "E"}) as e
      return e{*}
      

      A --1--> C
      D --4--> C
      

      分析:不经过点 E 时,相当于将点 E 及其邻边 2、3、5 从图中去掉,此时边 6 是点 D 的 3-Hop 边,不出现在返回结果中。

      过滤边

      示例:查找点 D 的 1~2-Hop 边,要求不包含边 5,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(2)
        .edge_filter({_uuid != 5}) as e
      return e{*}
      

      A --1--> C
      D --4--> C
      

      分析:不包含边 5 时,相当于将边 5 从图中去掉,此时边 3、6 是点 D 的 3-Hop 边,边 2 是点 D 的 4-Hop 边。

      过滤边方向

      示例:查找点 D 的 1~2-Hop 边,要求边的方向为右,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(2)
        .direction(right) as e
      return e{*}
      

      D --4--> C
      

      分析:边方向为右即表示出边,此时点 D 只有一个 1-Hop 边 4,由于其终点 C 没有任何出边,因此从 2-Hop 开始点 D 没有任何边。

      示例:查找点 D 的 1~2-Hop 边,要求边的方向为左,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(2)
        .direction(left) as e
      return e{*}
      

      E --5--> D
      A --3--> E
      

      分析:边方向为左即表示入边,此时点 D 有一个 1-Hop 边 5,一个 2-Hop 边 3。

      limit()

      示例:查找 3 个点 D 的 1~3-Hop 边,返回路径并携带全部信息

      spread().src({_id == "D"}).depth(3).limit(3) as e
      return e{*}
      

      E --5--> D
      A --3--> E
      D --4--> C
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写