修改密码

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

搜索
    中文

      批量插入

      数据类型

      Ultipa 属性与 Java 数据类型的对应关系:

      Ultipa Java
      string String
      text String
      float float
      double double
      int32 int
      uint32 long
      int64 long
      uint64 String
      datetime java.util.Date
      timestamp java.util.Date

      insertNodesBatchBySchema()

      InsertNodesBatchBySchema() 可以为某一个点 schema 导入多条数据,需保证数据携带的属性与声明 schema 时携带的属性一致。

      方法及相关类:

      Response insertNodesBatchBySchema(Schema schema, List<Node> nodes, InsertRequestConfig requestConfig)
      
      class Schema {
          String name;
          String description;
          List<Property> properties;
          Ultipa.DBType dbType;
          int total;
      }
      
      class Property {
          String name;
          String type;
          Boolean lte;
          String schema;
          String description;
      }
      
      class Node {
          Long uuid;
          String id;
          String schema;
          Value values;
      }
      

      示例:为图集 test 的点 schema 'customer' 插入多条数据,采用插入模式

      public class Main {
          public static void main(String[] args) {
              // 创建名为 conn 的连接并使用 default 图集,此部分代码省略
      
              InsertRequestConfig insertRequestConfig = new InsertRequestConfig();
              insertRequestConfig.setInsertType(Ultipa.InsertType.NORMAL);
              insertRequestConfig.setGraphName("test");
              
              List<Property> propertyList = new ArrayList<>();
              Property name = new Property();
              name.setName("name");
              name.setPropertyType(UltipaPropertyType.STRING);
              Property age = new Property();
              age.setName("age");
              age.setPropertyType(UltipaPropertyType.INT32);
              propertyList.add(name);
              propertyList.add(age);
              
              Schema schema = new Schema();
              schema.setName("client");
              schema.setDescription("bank client");
              schema.setDbType(Ultipa.DBType.DBNODE);
              schema.setProperties(propertyList);
              
              List<Node> nodeList = new ArrayList<>();
              Node node1 = new Node();
              node1.setID("1");
              Value value1 = new Value();
              value1.put("name","Jason");
              value1.put("age",35);
              node1.setValues(value1);
              nodeList.add(node1);
      
              Node node2 = new Node();
              node2.setID("2");
              Value value2 = new Value();
              value2.put("name","Alice");
              value2.put("age",29);
              node2.setValues(value2);
              nodeList.add(node2);
      
              Response res = conn.insertNodesBatchBySchema(schema, nodeList, insertRequestConfig);
          }
      }
      

      insertNodesBatchAuto()

      InsertNodesBatchAuto() 可以同时为多个点 schema 导入多条数据,需保证数据携带 schema,且携带的属性与图集中该 schema 的属性一致。

      方法及相关类:

      BatchAutoInsertResponse insertNodesBatchAuto(List<Node> nodeList, InsertRequestConfig requestConfig)
      
      class Node {
          Long uuid;
          String id;
          String schema;
          Value values;
      }
      

      示例:为图集 test 的多个点 schema 插入多条数据,采用插入更新模式

      public class Main {
          public static void main(String[] args) {
              // 创建名为 conn 的连接并使用 default 图集,此部分代码省略
      
              InsertRequestConfig insertRequestConfig = new InsertRequestConfig();
              insertRequestConfig.setInsertType(Ultipa.InsertType.UPSERT);
              insertRequestConfig.setGraphName("test");
              
              List<Node> nodeList = new ArrayList<>();
              Node node1 = new Node();
              node1.setSchema("client");
              node1.setID("1");
              Value value1 = new Value();
              value1.put("name","Jason");
              value1.put("age",30);
              node1.setValues(value1);
              nodeList.add(node1);
      
              Node node2 = new Node();
              node2.setSchema("tag");
              Value value2 = new Value();
              value2.put("balance",3644.7f);
              value2.put("value","VIP");
              node2.setValues(value2);
              nodeList.add(node2);
      
              Response res = conn.insertNodesBatchAuto(nodeList, insertRequestConfig);
          }
      }
      

      insertEdgesBatchBySchema()

      InsertEdgesBatchBySchema() 可以为某一个边 schema 导入多条数据,需保证数据携带的属性与声明 schema 时携带的属性一致。

      方法及相关类:

      Response insertEdgesBatchBySchema(Schema schema, List<Edge> edges, InsertRequestConfig requestConfig)
      
      class Schema {
          String name;
          String description;
          List<Property> properties;
          Ultipa.DBType dbType;
          int total;
      }
      
      class Property {
          String name;
          String type;
          Boolean lte;
          String schema;
          String description;
      }
      
      class Edge {
          Long uuid;
          Long fromUuid;
          Long toUuid;
          String from;
          String to;
          String schema;
          Value values;
      }
      

      示例:为图集 test 的边 schema 'transfer' 插入多条数据,采用插入模式,允许创建不存在的端点

      public class Main {
          public static void main(String[] args) {
              // 创建名为 conn 的连接并使用 default 图集,此部分代码省略
      
              InsertRequestConfig insertRequestConfig = new InsertRequestConfig();
              insertRequestConfig.setInsertType(Ultipa.InsertType.NORMAL);
              insertRequestConfig.setGraphName("test");
              insertRequestConfig.setCreateNodeIfNotExist(true);
      
              List<Property> propertyList = new ArrayList<>();
              Property amount = new Property();
              amount.setName("amount");
              amount.setPropertyType(UltipaPropertyType.DOUBLE);
              Property time = new Property();
              time.setName("time");
              time.setPropertyType(UltipaPropertyType.TIMESTAMP);
              propertyList.add(amount);
              propertyList.add(time);
      
              Schema schema = new Schema();
              schema.setName("transfer");
              schema.setDescription("bank card transfer");
              schema.setDbType(Ultipa.DBType.DBEDGE);
              schema.setProperties(propertyList);
      
              List<Edge> edgeList = new ArrayList<>();
              Edge edge1 = new Edge();
              edge1.setFrom("CARD00002");
              edge1.setTo("CARD00001");
              Value value1 = new Value();
              value1.put("amount",194.5d);
              value1.put("time",Timestamp.valueOf("2022-02-13 9:34:14"));
              edge1.setValues(value1);
              edgeList.add(edge1);
      
              Edge edge2 = new Edge();
              edge2.setFrom("CARD00001");
              edge2.setTo("CARD00002");
              Value value2 = new Value();
              value2.put("amount",400d);
              value2.put("time", Timestamp.valueOf("2022-01-30 17:23:54"));
              edge2.setValues(value2);
              edgeList.add(edge2);
      
              Response res = conn.insertEdgesBatchBySchema(schema, edgeList, insertRequestConfig);
          }
      }
      

      insertEdgesBatchAuto()

      InsertEdgesBatchAuto() 可以同时为多个边 schema 导入多条数据,需保证数据携带 schema,且携带的属性与图集中该 schema 的属性一致。

      方法及相关类:

      BatchAutoInsertResponse insertEdgesBatchAuto(List<Edge> edgeList, InsertRequestConfig requestConfig)
      
      class Edge {
          Long uuid;
          Long fromUuid;
          Long toUuid;
          String from;
          String to;
          String schema;
          Value values;
      }
      

      示例:为图集 test 的多个边 schema 插入多条数据,采用插入覆盖模式,允许创建不存在的端点

      public class Main {
          public static void main(String[] args) {
              // 创建名为 conn 的连接并使用 default 图集,此部分代码省略
      
              InsertRequestConfig insertRequestConfig = new InsertRequestConfig();
              insertRequestConfig.setInsertType(Ultipa.InsertType.OVERWRITE);
              insertRequestConfig.setGraphName("test");
              insertRequestConfig.setCreateNodeIfNotExist(true);
      
              List<Edge> edgeList = new ArrayList<>();
              Edge edge1 = new Edge();
              edge1.setSchema("transfer");
              edge1.setUUID(14L);
              edge1.setFrom("CARD00002");
              edge1.setTo("CARD00001");
              Value value1 = new Value();
              value1.put("amount",1254.5d);
              value1.put("time",Timestamp.valueOf("2022-02-13 9:34:14"));
              edge1.setValues(value1);
              edgeList.add(edge1);
      
              Edge edge2 = new Edge();
              edge2.setSchema("own");
              edge2.setFrom("CLIENT005");
              edge2.setTo("CARD00002");
              edgeList.add(edge2);
      
              Response res = conn.insertEdgesBatchAuto(edgeList, insertRequestConfig);
          }
      }
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写