修改密码

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

v5.0
搜索
    v5.0

      找边

      概述

      使用语句find().edges()可以从当前图集获取符合过滤条件的边。

      语法

      find().edges(<filter?>)
      
      • 语句别名:类型为EDGE;默认名称为edges
      • 方法:
      方法
      参数
      描述
      别名类型
      edges() <filter?> 将过滤条件包裹在{}中,或使用别名指定待获取的边。留空时会作用在所有边上 N/A

      示例图集

      在一个空图集中,逐行运行以下语句,创建示例图集:

      create().node_schema("User").node_schema("Club").edge_schema("Follows").edge_schema("Joins")
      create().node_property(@User, "name").node_property(@Club, "name").edge_property(@Follows, "time", datetime).edge_property(@Joins, "memberNo", uint32).edge_property(@Joins, "time", datetime)
      insert().into(@User).nodes([{_id:"U01", name:"Rowlock"},{_id:"U02", name:"Brainy"},{_id:"U03", name:"purplechalk"},{_id:"U04", name:"mochaeach"},{_id:"U05", name:"lionbower"}])
      insert().into(@Club).nodes([{_id:"C01", name:"Rowlock Tennis"},{_id:"C02", name:"Super Yacht"}])
      insert().into(@Follows).edges([{_from:"U01", _to:"U02", time:"2024-1-5"},{_from:"U02", _to:"U03", time:"2024-2-1"},{_from:"U04", _to:"U02", time:"2024-2-10"},{_from:"U03", _to:"U05", time:"2024-5-3"}])
      insert().into(@Joins).edges([{_from:"U02", _to:"C01", memberNo:1, time:"2023-12-14"},{_from:"U05", _to:"C01", memberNo:2, time:"2024-2-25"},{_from:"U04", _to:"C02", memberNo:9, time:"2024-6-15"}])
      

      找所有边

      获取所有边:

      find().edges() as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U01 U02 UUID of U01 UUID of U02 Follows {time: "2024-01-05 00:00:00" }
      Sys-gen U02 U03 UUID of U02 UUID of U03 Follows {time: "2024-02-01 00:00:00"}
      Sys-gen U03 U05 UUID of U03 UUID of U05 Follows {time: "2024-05-03 00:00:00"}
      Sys-gen U04 U02 UUID of U04 UUID of U02 Follows {time: "2024-02-10 00:00:00"}
      Sys-gen U02 C01 UUID of U02 UUID of C01 Joins {memberNo: 1, time: "2023-12-14 00:00:00"}
      Sys-gen U05 C01 UUID of U05 UUID of C01 Joins {memberNo: 2, time: "2024-02-25 00:00:00"}
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins {memberNo: 9, time: "2024-06-15 00:00:00"}

      根据schema找边

      获取schema为Joins的边:

      find().edges({@Joins}) as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U02 C01 UUID of U02 UUID of C01 Joins {memberNo: 1, time: "2023-12-14 00:00:00"}
      Sys-gen U05 C01 UUID of U05 UUID of C01 Joins {memberNo: 2, time: "2024-02-25 00:00:00"}
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins {memberNo: 9, time: "2024-06-15 00:00:00"}

      获取schema为JoinsFollows的边:

      find().edges({@Joins || @Follows}) as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U01 U02 UUID of U01 UUID of U02 Follows {time: "2024-01-05 00:00:00" }
      Sys-gen U02 U03 UUID of U02 UUID of U03 Follows {time: "2024-02-01 00:00:00"}
      Sys-gen U03 U05 UUID of U03 UUID of U05 Follows {time: "2024-05-03 00:00:00"}
      Sys-gen U04 U02 UUID of U04 UUID of U02 Follows {time: "2024-02-10 00:00:00"}
      Sys-gen U02 C01 UUID of U02 UUID of C01 Joins {memberNo: 1, time: "2023-12-14 00:00:00"}
      Sys-gen U05 C01 UUID of U05 UUID of C01 Joins {memberNo: 2, time: "2024-02-25 00:00:00"}
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins {memberNo: 9, time: "2024-06-15 00:00:00"}

      根据属性找边

      在过滤条件中,属性可与schema共同使用,也可独立使用。独立使用时,适用于所有具备该属性的边,而不论其schema。特别注意,系统属性_uuid_from_to_from_uuid_to_uuid无法与schema共同使用(如@Joins._uuid)。

      获取@JoinsmemberNo属性为2的边:

      find().edges({@Joins.memberNo == 2}) as e
      return e.time
      

      结果:

      e.time
      2024-02-25 00:00:00

      获取time大于2024-5-1的边:

      find().edges({time > "2024-5-1"}) as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U03 U05 UUID of U03 UUID of U05 Follows {time: "2024-05-03 00:00:00"}
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins {memberNo: 9, time: "2024-06-15 00:00:00"}

      获取_from为U01或U04的边:

      find().edges({_from in ["U01", "U04"]}) as e
      return e{*}
      

      结果:e

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      values
      Sys-gen U01 U02 UUID of U01 UUID of U02 Follows {createdOn: "2024-01-05 00:00:00" }
      Sys-gen U04 U02 UUID of U04 UUID of U02 Follows {createdOn: "2024-02-10 00:00:00"}
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins {memberNo: 9}

      使用默认别名

      find().edges()语句中,可以使用默认别名edges,,无需显式声明。

      获取所有边并返回其time(同时默认返回schema和系统属性):

      find().edges()
      return edges{time}
      

      结果:edges

      _uuid
      _from
      _to
      _from_uuid
      _to_uuid
      schema
      time
      Sys-gen U01 U02 UUID of U01 UUID of U02 Follows 2024-01-05 00:00:00
      Sys-gen U02 U03 UUID of U02 UUID of U03 Follows 2024-02-01 00:00:00
      Sys-gen U03 U05 UUID of U03 UUID of U05 Follows 2024-05-03 00:00:00
      Sys-gen U04 U02 UUID of U04 UUID of U02 Follows 2024-02-10 00:00:00
      Sys-gen U02 C01 UUID of U02 UUID of C01 Joins 2023-12-14 00:00:00
      Sys-gen U05 C01 UUID of U05 UUID of C01 Joins 2024-02-25 00:00:00
      Sys-gen U04 C02 UUID of U04 UUID of C02 Joins 2024-06-15 00:00:00

      限制边数量

      紧跟在find().edges()语句之后使用LIMIT语句,可以限制传递给后续语句的边数。

      获取任意3个@Follows边:

      find().edges({@Follows}) as e limit 3
      return e.time
      

      结果:

      e.time
      2024-02-10 00:00:00
      2024-02-01 00:00:00
      2024-01-05 00:00:00

      使用前缀OPTIONAL

      在此查询中,find().edges()语句会执行三次,每次使用num中的一条记录。使用前缀OPTIONAL后,如果执行过程中未找到结果,查询将返回null

      uncollect [1,2,3] as num
      optional find().edges({memberNo == num}) as e
      return e.time
      

      结果:

      e.time
      2023-12-14 00:00:00
      2024-02-25 00:00:00
      null

      如果不使用前缀OPTIONAL,只会返回两条记录:

      uncollect [1,2,3] as num
      find().edges({memberNo == num}) as e
      return e.time
      

      结果:

      e.time
      2023-12-14 00:00:00
      2024-02-25 00:00:00
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写