修改密码

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

      导入Neo4j

      本文介绍如何将数据从Neo4j数据库导入嬴图数据库。

      以下步骤均在Windows系统上PowerShell中演示。

      生成配置文件

      打开终端程序,导航至ultipa-importer所在文件夹。执行以下命令,选择neo4j,为导入Neo4j数据库中的数据生成样本配置文件:

      ./ultipa-importer --sample
      

      执行命令后,会在ultipa-importer所在目录下生成配置文件import.sample.neo4j.yml。如果目录下已有该文件,数据将被覆盖。

      修改配置文件

      根据实际使用场景修改import.sample.neo4j.yml文件。该文件包含以下部分:

      • mode:设置为neo4j
      • neo4j:配置Neo4j数据库连接。
      • server:提供嬴图服务器信息,并为数据导入指定目标图(新图或已有图)。
      • nodeConfig:定义点schema,其中每个schema对应一个标签。查询结果中的各列将映射为点属性。
      • edgeConfig:定义边schema,其中每个schema对应一个关系。查询结果中的各列将映射为边属性。
      • settings:为数据导入设置全局参数和偏好。

      # 导入模式:csv/json/jsonl/rdf/graphml/bigQuery/sql/kafka/neo4j/salesforce
      mode: neo4j
      
      # Neo4j服务器配置
      neo4j:
        # 主机IP/URI,"neo4j://xxx:" or "neo4j+s://xxx"
        host: "neo4j+s://123xxx.databases.neo4j.io"
        username: "user123"
        password: "password123"
        # 数据库名称
        database: "trading"
      
      # 嬴图服务器配置
      server:
        # 主机IP/URI和端口;若为集群,使用英文逗号分隔
        host: "10.11.22.33:1234"
        username: "admin"
        password: "admin12345"
        # 目标图(新图或已有图)
        graphset: "myGraph"
        # 若上图为新图,指定图所在分片
        shards: "1,2,3"
        # 若上图为新图,指定分片分区算法(Crc32/Crc64WE/Crc64XZ/CityHash64)
        partitionBy: "Crc32"
        # TLS加密证书文件路径
        crt: ""
      
      # 点配置
      nodeConfig:
        # 指定schema
        - schema: "Customer"
          # 指定Neo4j中的标签
          label: "customer"
          # 设置查询条件(如需),使用变量n查询标签 
          where: n.level > 0
          # 设置返回记录数(如需)
          limit:     
          # properties: 将查询结果中的各列映射为属性;映射为系统属性_id、_from或_to的各列必须明确设置
          ## name: Neo4j数据库中的字段名,用作嬴图数据库中的属性名;若需使用Neo4j的identity、start或end属性,将该字段设置为<id>、<start>或<end>
          ## new_name: 嬴图数据库中的属性名;默认为上述名称
          ## type: 属性类型;可设置为 _id,_from,_to或其他嬴图属性,如int64,float,string登;设置为 _ignore时可跳过导入该列
          ## prefix: 为属性值增加前缀;仅适用于_id,_from和_to
          properties:
            - name: <id>
              type: _id
            - name: cust_no
              type: string
            - name: name
              type: string
            - name: level
              type: int32
        - schema: "Merchant"
          label: "merchant"
          properties:
            - name : <id>
              type: _id
      
      # 边配置
      edgeConfig:
        - schema: "Transfers"
          # 指定Neo4j中的关系
          relationship: "transfers"
          # 设置查询条件(如需),使用变量r查询关系
          where: 
          properties:
            - name: <start>
              type: _from
            - name: <end>
              type: _to
            - name: trans_no
              type: string
            - name: time
              type: datetime
      
      # 全局设置     
      settings:
       # 日志文件路径
        logPath: "./logs"
        # 每批次导入的点或边的数量
        batchSize: 10000
        # 插入模式:insert/overwrite/upsert
        importMode: insert
        # 插入边时,自动创建缺失端点
        createNodeIfNotExist: false
        # 报错时停止数据导入
        stopWhenError: false
        # 设置为true时,自动创建新的图、schema和属性
        yes: true
        # 最大线程数
        threads: 32
        # RPC最大消息传输量(单位:MB)
        maxPacketSize: 40
        # 时间戳对应时区
        # 默认时区:"+0200"
        # 时间戳单位,支持毫秒(ms)或秒(s)
        timestampUnit: s
      

      执行导入

      使用--config标志指定配置文件,执行数据导入:

      ./ultipa-importer --config import.sample.neo4j.yml
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写