Change Password

Please enter the password.
Please enter the password. Between 8-64 characters. Not identical to your email address. Contain at least 3 of: uppercase, lowercase, numbers, and special characters.
Please enter the password.
Submit

Change Nickname

Current Nickname:
Submit

Apply New License

License Detail

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

The MAC address of the server you want to deploy.

Please complete this required field.

Please complete this required field.

Cancel
Apply
ID
Product
Status
Cores
Applied Validity Period(days)
Effective Date
Excpired Date
Mac Address
Apply Comment
Review Comment
Close
Profile
  • Full Name:
  • Phone:
  • Company:
  • Company Email:
  • Country:
  • Language:
Change Password
Apply

You have no license application record.

Apply
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

Product Created On ID Amount (USD) Invoice
Product Created On ID Amount (USD) Invoice

No Invoice

Search
    English

      Overwrite

      Overview

      The insert().overwrite().into() clause facilitates either the overwriting of existing nodes or edges within a single schema or the insertion of new nodes or edges.

      Syntax

      // Overwrite or insert nodes
      insert().overwrite().into(@<schema>).nodes([
        {<property1>: <value1>, <property2>: <value2>, ...},
        {<property1>: <value1>, <property2>: <value2>, ...}
      ])
      
      // Overwrite or insert edges
      insert().overwrite().into(@<schema>).edges([
        {<property1>: <value1>, <property2>: <value2>, ...},
        {<property1>: <value1>, <property2>: <value2>, ...}
      ])
      
      • Specify one schema in the into() method.
      • Include one or multiple nodes or edges in the nodes() or edges() method.
        • Provide values of properties for each node or edge enclosed in { }.
        • If there is only one node or edge, the outer [ ] can be omitted.
      • Allow to define an alias for the clause, with the data type being either NODE or EDGE.

      Overwrite or insert nodes:

      • No property is mandatory to be provided.
      • Whether the overwriting or insertion occurs depends on the provision of the unique identifier properties _id and _uuid:
        • If existing _id and/or _uuid are provided, the values of custom properties of the corresponding node are overwritten.
        • If new _id and/or _uuid are provided, a new node is inserted, the system automatically generates the value of the missing _id or _uuid.
        • If both _id and _uuid are missing, the system automatically generates their values, and a new node is inserted.
      • Whether it's overwriting or insertion, the values of missing custom properties will be null.

      Overwrite or insert edges:

      • The properties _from and _to (or _from_uuid and _to_uuid) are mandatory to be provided to specify the start node and end node of the edge. Other properties are optional.
      • Whether the overwriting or insertion occurs depends on the provision of the unique identifier property _uuid:
        • If existing _uuid is provided, the values of custom properties of the corresponding edge is overwritten.
        • If new _uuid is provided, a new edge is inserted.
        • If _uuid is missing, the system automatically generates its value, and a new edge is inserted.
      • Whether it's insertion or overwriting, the values of missing custom properties will be null.

      Example Graph

      Run these UQLs row by row in an empty graphset to create this graph:

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

      Examples

      Overwrite or Insert Nodes

      insert().overwrite().into(@user).nodes([
        {_id: "U001", name: "John"},
        {_id: "U005", name: "Alice"},
        {age: 12}
      ]) as n
      return n{*}
      
      • The first node with the provided _id U001 exists in the graph, so it is overwritten.
      • The second is a new node to be inserted, as the provided _id U005 does not exist in the graph.
      • The third is a new node to be inserted, as both _id and _uuid are missing.

      Result:

      _id
      _uuid name age
      U001 1 John null
      U005 5 Alice null
      ULTIPA8000000000000006 6 null 12

      Overwrite or Insert Edges

      insert().overwrite().into(@follow).edges([
        {_uuid: 1, _from: "U004", _to: "U003"},
        {_uuid: 4, _from: "U002", _to: "U003"},
        {_from: "U002", _to: "U001", time: "2023-9-6"}
      ]) as e
      return e{*}
      
      • The first edge with the provided _uuid 1 exists in the graph, so it is overwritten.
      • The second is a new edge to be inserted, as the provided _uuid 4 does not exist in the graph.
      • The third is a new edge to be inserted, as _uuid is missing.

      Result:

      _uuid _from _to
      _from_uuid
      _to_uuid
      time
      1 U004 U003 4 3 null
      4 U002 U003 2 3 null
      5 U002 U001 2 1 2023-09-06 00:00:00

      Common Reasons for Failures

      • Overwriting fails when the nodes or edges specified by the unique identifier properties (_id, _uuid) do not belong to the given schema.
      • Node overwriting or insertion fails when both _id and _uuid are provided, but one of their values exists in the graph while the other one does not.
      • Edge overwriting or insertion fails when the start node or end node is not specified.
      • Edge overwriting or insertion fails when the specified start node or end node does not exist in the graph.
      Please complete the following information to download this book
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写