修改密码

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

搜索
    中文

      插入更新

      插入更新操作是指向当前图集中单一/批量地插入新的点、边数据,或根据 ID 单一/批量的更新已有的点、边的除 ID 以外的属性,由 upsert() 命令触发。

      upsert() 可能触发:

      • 插入:未携带 ID,或携带的 ID 在图集中不存在
      • 更新:携带的 ID 在图集中存在且与 schema 相匹配
      • 失败:携带的 ID 在图集中存在但与 schema 不匹配;插入边时未携带 FROM、TO,或携带的 FROM、TO 在图集中不存在。

      插入时,细节同 insert() 命令。

      更新时:

      • 未携带的属性保持不变
      • 数据类型错误的属性,将使用默认值

      不建议在算法流式返回之后进行插入更新操作,详见《Ultipa 图分析与图算法》-《算法的使用》-《执行方式》-流式返回 stream() 的相关说明。

      语法:

      • 语句别名:支持,结构为 NODE 或 EDGE

      // 向当前图集的某个 schema 中插入或更新点数据
      upsert().into(@<schema>)
        .nodes([				//只插入更新一个点时可省略中括号
          {<property1>:<value1>, <property2>:<value2>, ...},
          {<property1>:<value1>, <property2>:<value2>, ...},
          ...
        ])
      
      // 向当前图集的某个 schema 中插入或更新边数据,必须携带 _from 和 _to,或必须携带 _from_uuid 和 _to_uuid
      upsert().into(@<schema>)
        .edges([				//只插入更新一个边时可省略中括号
          {<property1>:<value1>, <property2>:<value2>, ...},
          {<property1>:<value1>, <property2>:<value2>, ...},
          ...
        ])
      

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

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

      create().node_schema("account").edge_schema("follow")
      create().node_property(@account, "name").edge_property(@follow, "time", datetime)
      insert().into(@account).nodes([{_id:"U001", _uuid:1, name:"Jason"}, {_id:"U002", _uuid:2, name:"Tim"}, {_id:"U003", _uuid:3, name:"Grace"}, {_id:"U004", _uuid:4, name:"Ted"}])
      insert().into(@follow).edges([{_uuid:1, _from_uuid:4, _to_uuid:1, time:"2021-09-10"}, {_uuid:2, _from_uuid:3, _to_uuid:2, time:"2020-03-12"}, {_uuid:3, _from_uuid:4, _to_uuid:2, time:"2023-07-30"}])
      

      示例:向 @account 中插入三个点,一个点不携带任何信息,即 _id_uuid 由系统自动生成、属性值为 null;另两个点的 ID 与 schema 相匹配,其中一个未携带属性值将保留值不变,另一个携带了错误类型的属性值将被更新为默认值(空字符串)

      upsert().into(@account).nodes([{}, {_id: "U001"}, {_id: "U002", name: [1,2,3]}]) as nodes
      return nodes{*}
      

      |           _id          | _uuid |  name  |
      |------------------------|-------|--------|
      | ULTIPA8000000000000001 |   5   |  null  |
      | U001                   |   1   | Jason  | 
      | U002                   |   2   |        |
      

      示例:更新点时,由于 ID 与 schema 不匹配而得到错误提示

      upsert().into(@card).nodes({_id: "U003", name: "Jack"}) as nodes
      return nodes{*}
      

      The schema: card does not match with U003!
      

      示例:更新边时,由于未提供 FROM/TO 而得到错误提示

      upsert().into(@follow).edges({_uuid: 1, time: "2021-08-31"}) as edges
      return edges{*}
      

      _from_uuid must > 0!
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写