修改密码

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

搜索
    中文

      RETURN

      RETURN 可以对数据流进行函数运算,将多个返回值组装到一起返回给用户。返回值不同源时不进行裁剪。

      语法:RETURN <expression> as <alias>, <expression> as <alias>, ...
      参数:

      • <expression>:返回值
      • <alias>:返回值的别名,可省略

      RETURN 子句通常出现在 UQL 语句的末尾,个别情况时其后可以出现 ORDER BY、LIMIT、SKIP。在 RETURN 子句中对某别名进行去重操作时,不影响其同源别名。

      例如,同时返回三个值,其中 n1 与另两个返回值不同源;对 n2.color 的去重操作也不影响其同源流 pnodes(path)

      find().nodes() as n1 limit 5
      n(3).e()[2].n(as n2) as path
      return n1, pnodes(path), dedup(n2.color)
      

      关于 RETURN 子句中如何指定有效的返回格式,请参见本篇末尾的表格。

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

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

      create().node_schema("account").node_schema("movie").edge_schema("rate").edge_schema("wishlist")
      create().node_property(@*, "name").node_property(@account, "age", int32).node_property(@movie, "year", int32).edge_property(@rate, "score", int32)
      insert().into(@account).nodes([{_id:"S001", _uuid:1, name:"Pepe", age:24}, {_id:"S002", _uuid:2, name:"Lina", age:23}, {_id:"S003", _uuid:3, name:"Emma", age:26}])
      insert().into(@movie).nodes([{_id:"M001", _uuid:4, name:"Léon", year:1994}, {_id:"M002", _uuid:5, name:"Avatar", year:2009}])
      insert().into(@rate).edges([{_uuid:1, _from_uuid:1, _to_uuid:4, score:9}, {_uuid:2, _from_uuid:3, _to_uuid:5, score:8}])
      insert().into(@wishlist).edges([{_uuid:3, _from_uuid:2, _to_uuid:4}, {_uuid:4, _from_uuid:3, _to_uuid:4}])
      

      返回 NODE

      示例:携带全部属性

      find().nodes({@account}) as n
      return n{*} 
      

      |-------- @account ---------|
      | _id  | _uuid | name | age |
      |------|-------|------|-----|
      | S001 | 1     | Pepe | 24  |
      | S002 | 2     | Lina | 23  |
      | S003 | 3     | Emma | 26  |
      

      示例:携带部分自定义属性

      find().nodes() as n
      return n{name, year} 
      

      |------ @account -----|
      | _id  | _uuid | name |
      |------|-------|------|
      | S001 | 1     | Pepe |
      | S002 | 2     | Lina |
      | S003 | 3     | Emma |
      
      |----------- @movie -----------|
      | _id  | _uuid |  name  | year |
      |------|-------|--------|------|
      | M001 | 4     | Léon   | 1994 |
      | M002 | 5     | Avatar | 2009 |
      

      分析:NODE 仅携带其自身具有的属性。

      示例:仅携带系统属性

      find().nodes({@movie}) as n
      return n 
      

      |--- @movie ---|
      | _id  | _uuid |
      |------|-------|
      | M001 | 4     |
      | M002 | 5     |
      

      返回 EDGE

      示例:携带全部属性

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

      |------------------------ @rate -----------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid | score |
      |-------|-------|------|------------|----------|-------|
      |   1   | S001  | M001 | 1          | 4        | 9     |
      |   2   | S003  | M002 | 3          | 5        | 8     |
      

      示例:仅携带系统属性

      find().edges() as e
      return e 
      

      |-------------------- @rate -------------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid |
      |-------|-------|------|------------|----------|
      |   1   | S001  | M001 | 1          | 4        |
      |   2   | S003  | M002 | 3          | 5        |
      
      |------------------ @wishlist -----------------|
      | _uuid | _from | _to  | _from_uuid | _to_uuid |
      |-------|-------|------|------------|----------|
      |   3   | S002  | M001 | 2          | 4        |
      |   4   | S003  | M001 | 3          | 4        |
      

      返回 PATH

      示例:携带部分自定义属性

      n({@account}).e({@rate}).n({@movie}) as p
      return p{name}{*}
      

      [
        {
          "nodes":[
            {"id":"S001","uuid":"1","schema":"account","values":{"name":"Pepe"}},
            {"id":"M001","uuid":"4","schema":"movie","values":{"name":"Léon"}}
          ],
          "edges":[
            {"uuid":"1","from":"S001","to":"M001","from_uuid":"1","to_uuid":"4","schema":"rate","values":{"score":"9"}}
          ],
          "length":1
        },
        {
          "nodes":[
            {"id":"S003","uuid":"3","schema":"account","values":{"name":"Emma"}},
            {"id":"M002","uuid":"5","schema":"movie","values":{"name":"Avatar"}}
          ],
          "edges":[
            {"uuid":"2","from":"S003","to":"M002","from_uuid":"3","to_uuid":"5","schema":"rate","values":{"score":"8"}}
          ],
          "length":1
        }
      ]
      

      示例:仅携带系统属性

      n({@movie}).e({@rate}).n({@account}).e({@wishlist}).n({@movie}) as p
      return p
      

      [
        {
          "nodes":[
            {"id":"M002","uuid":"5","schema":"movie","values":{}},
            {"id":"S003","uuid":"3","schema":"account","values":{}},
            {"id":"M001","uuid":"4","schema":"movie","values":{}}
          ],
          "edges":[
            {"uuid":"2","from":"S003","to":"M002","from_uuid":"3","to_uuid":"5","schema":"rate","values":{}},
            {"uuid":"4","from":"S003","to":"M001","from_uuid":"3","to_uuid":"4","schema":"wishlist","values":{}}
          ],
          "length":2
        }
      ]
      

      返回 TABLE

      示例:查找 1 步路径 账号-电影,将点的 name 组装为表格

      n({@account} as a).e({@wishlist}).n({@movie} as b)
      return table(a.name, b.name)
      

      | a.name | b.name |
      |--------|--------|
      | Lina   | Léon   | 
      | Emma   | Léon   | 
      

      返回 ATTR - 原子

      示例:独立返回点的自定义属性

      find().nodes() as n
      return n.name, n.age, n.year 
      

      Pepe
      Lina
      Emma
      Léon
      Avatar
      

      24
      23
      26
      null
      null
      

      null
      null
      null
      1994
      2009
      

      分析:调用不存在的属性时,返回 null

      返回 ATTR - 列表

      示例:将每个电影的 1-Hop 邻居的 name 组装为列表

      khop().n({@movie} as a).e().n() as b
      group by a
      return a.name, collect(b.name)
      

      Léon
      Avatar
      

      ["Pepe","Lina","Emma"]
      ["Emma"]
      

      有效的返回格式

      假设别名 nodesedgespathsmytablemylistmypointmyitem 分别指代类型为 NODE,EDGE,PATH,TABLE,listpoint 及其他类型的数据。这些别名在 UQL 句末返回时有效格式为:

      返回格式 返回内容
      返回类型
      nodes 点(携带 schema 和系统属性) NODE
      nodes.<property> 点的某个属性 ATTR(属性不存在时返回 null
      nodes.@ 点的 schema ATTR
      nodes{<property>, ...} 点(携带 schema、系统属性和列出的自定义属性) NODE
      nodes{*} 点(携带 schema、系统属性和全部自定义属性) NODE
      edges 边(仅携带 schema 和系统属性) EDGE
      edges.<property> 边的某个属性 ATTR(属性不存在时返回 null
      edges.@ 边的 schema ATTR
      edges{<property>, ...} 边(携带 schema、系统属性和列出的自定义属性) EDGE
      edges{*} 边(携带 schema、系统属性和全部自定义属性) EDGE
      paths 路径(点、边携带 schema 和系统属性) PATH
      paths{<property>, ...}{<property>, ...} 路径(点、边携带 schema、系统属性和分别列出的自定义属性) PATH
      paths{*}{<property>, ...} 路径(点、边携带 schema、系统属性,点携带全部自定义属性,边携带列出的自定义属性) PATH
      paths{<property>, ...}{*} 路径(点、边携带 schema、系统属性,点携带列出的自定义属性,边携带全部自定义属性) PATH
      paths{<property>, ...} 路径(点、边携带 schema、系统属性和列出的自定义属性) PATH
      paths{*} 路径(点、边携带 schema、系统属性和全部自定义属性) PATH
      mytable 整个表格 TABLE
      mylist 整个列表 ATTR
      mylist[n] 下标为 n 的元素 ATTR
      mylist[n1:n2] 由下标为 n1~n2 的元素构成的列表 ATTR
      mylist[:n] 由下标为 0~n 的元素构成的列表 ATTR
      mylist[n:] 由下标为 n~<长度-1> 的元素构成的列表 ATTR
      mypoint 整个坐标 ATTR
      mypoint.x 坐标 x ATTR
      mypoint.y 坐标 y ATTR
      myitem 数据本身 ATTR
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写