修改密码

请输入密码
请输入密码 请输入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

搜索
    中文

      reduce()

      函数 reduce() 可以对列表中的所有元素依次迭代进行某种运算,即使用初始值和第一个元素进行运算,再使用得到的运算结果和第二个元素进行运算,以此类推直至列表结束。

      该函数的迭代方式类似于大部分编程语言中的 for 语句,但迭代次数没有暴露出来。

      语法:

      reduce(<result> = <initial_value>, <element> in <list> | <expression>) 
      
      • <result> 为运算结果的变量名
      • <initial_value> 为初始值
      • <element> 为列表元素的变量名
      • <list> 为列表的别名
      • <expression> 为运算表达式

      一般用法

      示例:将列表 [1,2,3,4] 中的数字求和

      with [1,2,3] as list
      return reduce(sum = 0, element in list | sum + element) as mySum
      

      6
      

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

      在空图集中依次运行以下各行代码以创建该图数据:

      create().node_schema("firm").node_schema("human").edge_schema("hold")
      create().edge_property(@hold, "portion", double)
      insert().into(@firm).nodes([{_id:"F001", _uuid:1}, {_id:"F002", _uuid:2}])
      insert().into(@human).nodes([{_id:"H001", _uuid:3}, {_id:"H002", _uuid:4}])
      insert().into(@hold).edges([{_uuid:1, _from_uuid:3, _to_uuid:1, portion:0.3}, {_uuid:2, _from_uuid:2, _to_uuid:1, portion:0.7}, {_uuid:3, _from_uuid:3, _to_uuid:2, portion:0.4}, {_uuid:4, _from_uuid:4, _to_uuid:2, portion:0.6}])
      

      示例:计算公司 F001 的各个最终受益人的持股份额

      n({_id == "F001"}).le()[:5].n({@human} as UBO) as p
      with pedges(p) as edgeList
      call{
        with edgeList
        uncollect edgeList as edges
        with collect(edges.portion) as portionList
        return reduce(init = 1, element in portionList | init * element) as share
      }
      group by UBO
      return table(UBO._id, sum(share))
      

      | UBO._id | sum(share) |
      |---------|------------|
      | H001    | 0.58       |
      | H002    | 0.42       |
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写