This page demonstrates the process of importing data from a Neo4j database into an Ultipa graphset.

Generate Configuration File
Execute the following command in your command line tool and select neo4j
.
./ultipa-importer --sample
The import.sample.neo4j.yml
file will be generated in the same directory as ultipa-importer.exe
. If a import.sample.neo4j.yml
file already exists in that directory, it will be overwritten.
Modify Configuration File
The configuration file consists of several sections. Modify the configuration file according to your needs.
# Mode options: csv/json/jsonl/rdf/graphml/bigQuery/sql/kafka/neo4j/salesforce; only one mode can be used
# SQL supports mysql/postgresSQL/sqlserver/snowflake/oracle
mode: neo4j
# Neo4j server configurations
neo4j:
# Host Address or URI, "neo4j://xxx:" or "neo4j+s://xxx"
host: "neo4j+s://123xxx.databases.neo4j.io"
username: "user123"
password: "password123"
# Database name
database: "trading"
# Ultipa server configurations
server:
# Host IP/URI and port
# If it is a cluster, separate hosts with commas, i.e., "<ip1>:<port1>,<ip2>:<port2>,<ip3>:<port3>"
host: "10.11.22.33:1234"
username: "admin"
password: "admin12345"
# The new or existing graphset where data will be imported
graphset: "trading"
# If the above graphset is new, specify the shards where it will be stored
shards: "1,2,3"
# If the above graphset is new, specify the partition function (Crc32/Crc64WE/Crc64XZ/CityHash64) used for sharding
partitionBy: "Crc32"
# Path of the certificate file for TLS (optional)
crt: ""
# Node configurations
nodeConfig:
# Specify the node type (schema) that the imported nodes belong to in Ultipa
- schema: "merchant"
# Specify the node type (label) that the imported nodes belong to in Neo4j
label: "merchant"
# Set a condition, if needed, to query the label using the variable 'n'
where: n.level > 0
# Set a limit, if needed, to restrict the number of returned records
limit:
# properties: Map Neo4j query results to Ultipa graph database properties
# For each property, you can configure the following:
## name: The property name from the Neo4j database
## new_name: The property name to which the column will be mapped; if unset, it defaults to the column name
## type: Supported types include _id, _from, _to, _ignore (to skip importing the column), and other Ultipa property types like int64, int32, float, string, etc.
## prefix: Add a prefix to the values of the _id, _from, or _to types; it does not apply to other types
# If you need to use Neo4j's identity, start, or end properties, configure the name as <id>, <start>, or <end>
# Columns mapped to system properties such as _id, _from or _to in the Neo4j query results must be explicitly configured
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
# Edge configurations
edgeConfig:
- schema: "transaction"
# Specify the edge type (relationship) that the imported nodes belong to in Neo4j
relationship: "transaction"
# Set a condition, if needed, to query the label using the variable 'r'
where: r.time > "2025-01-21 00:00"
properties:
- name: <start>
type: _from
- name: <end>
type: _to
- name: trans_no
type: string
- name: time
new_name: transtime
type: datetime
# Global settings
settings:
# Define the path to output the log file
logPath: "./logs"
# Number of rows included in each insertion batch
batchSize: 10000
# Import mode supports insert/overwrite/upsert
importMode: insert
# Automatically create missing end nodes for edges (applicable only when importing edges)
createNodeIfNotExist: false
# Stops the importing process when error occurs
stopWhenError: false
# Set to true to automatically create missing graphset, schemas and properties
yes: true
# The maximum threads
threads: 32
# The maximum size (in MB) of each packet
maxPacketSize: 40
# Timezone for the timestamp values
# timeZone: "+0200"
# Timestamp value unit, support ms/s
timestampUnit: s
Configuration Items
Neo4j server configurations
Field |
Type |
Description |
---|---|---|
host |
String | IP address or URI of the database. |
username |
String | Database username. |
password |
String | Password of the above user. |
database |
String | Name of the database. |
Ultipa server configurations
Field |
Type |
Description |
---|---|---|
host |
String | IP address or URI of the source database. |
username |
String | Database username. |
password |
String | Password of the above user. |
graphset |
String | Name of the target graphset for JSONL file import. If the specified graphset does not exist, it will be created automatically. |
shards |
String | Specifies the shards where data will be processed. |
partitionBy |
String | Specifies the patitioning algorithm, including Crc32 , Crc64WE , Crc64XZ and CityHash64 . |
crt |
String | Path to the certificate (CRT) file used for TLS encryption. |
Node/Edge configurations
Field |
Type |
Description |
---|---|---|
schema |
String | The node type (schema) to which the imported nodes belong. |
label |
String | The node type (label) to which the imported nodes belong in Neo4j. |
where |
String | The condition to query the label using the variable 'n'. |
limit |
String | The number of records returned. |
name |
String | The column name from the Neo4j query results, serving as the property name. |
type |
String | Specify the data type. See supported property value types. |
prefix |
String | Add a prefix to the data. This is only supported for data types including _id , _from , and _to . |
new_name |
String | Modify the property name specified in name to a new value. |
Global settings
Field |
Type |
Default |
Description |
---|---|---|---|
logPath |
String | "./logs" | The path to save the log file. |
batchSize |
Integer | 10000 | Number of nodes or edges to insert per batch. |
importMode |
String | upsert | Specifies how the data is inserted into the graph, including overwrite , insert and upsert . When updating nodes or edges, use the upsert mode to prevent overwriting existing data. |
createNodeIfNotExist |
Bool | false | Whether missing nodes are automatically created when inserting edges:true : The system automatically creates nodes that do not exist.false : The related edges will not be imported. |
stopWhenError |
Bool | false | Whether to stop the import process when an error occurs. |
yes |
Bool | false | Whether to automatically create missing graphset, schemas and properties. |
threads |
Integer | 32 | The maximum number of threads. 32 is suggested. |
maxPacketSize |
Integer | 40 | The maximum size of data packets in MB that can be sent or received. |
timestampUnit |
String | s | The unit of measurement for timestamp data. Supported units are ms (milliseconds) and s (seconds). |
Execute Import
The import process uses the configuration file specified by the -config
parameter to import data from the Neo4j database into the target server and display it in the Ultipa graph structure.
./ultipa-importer --config import.sample.neo4j.yml