Skip to content

Commit 97b31ba

Browse files
gkorlandCopilot
andcommitted
docs(integration): add dedicated bulk-loader page and expand Data import section
- Add integration/bulk-loader.md: installation, quick-start, key flags table, --enforce-schema usage with typed CSV headers, bulk-update command, and links to GitHub + GRAPH.BULK spec. - integration/index.md: add Bulk Loader entry to the Topics list. - index.md: expand the one-liner Data import section with a pip install command, basic usage, and a link to the new dedicated page. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 57945c3 commit 97b31ba

3 files changed

Lines changed: 119 additions & 1 deletion

File tree

index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,14 @@ The full list and links can be found on the [Client Libraries](/getting-started/
258258

259259
## Data import
260260

261-
When loading large graphs from CSV files, we recommend using [falkordb-bulk-loader](https://github.com/falkordb/falkordb-bulk-loader)
261+
When loading large graphs from CSV files, use the [falkordb-bulk-loader](https://github.com/falkordb/falkordb-bulk-loader):
262+
263+
```sh
264+
pip install falkordb-bulk-loader
265+
falkordb-bulk-insert GRAPHNAME -n nodes.csv -r edges.csv
266+
```
267+
268+
See the [Bulk Loader documentation](/integration/bulk-loader) for the full reference.
262269

263270
## Mailing List / Forum
264271

integration/bulk-loader.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: "Bulk Loader"
3+
description: "Import large graphs from CSV files into FalkorDB using the falkordb-bulk-loader tool"
4+
---
5+
6+
# Bulk Loader
7+
8+
The [falkordb-bulk-loader](https://github.com/falkordb/falkordb-bulk-loader) is a Python utility for building FalkorDB graphs from CSV files. It uses the `GRAPH.BULK` endpoint to import nodes and relationships efficiently in binary batches — much faster than issuing individual `CREATE` queries.
9+
10+
## Requirements
11+
12+
- Python 3.10 or later
13+
- A running FalkorDB instance (see [Get Started](https://docs.falkordb.com))
14+
15+
## Installation
16+
17+
```sh
18+
pip install falkordb-bulk-loader
19+
```
20+
21+
## Quick Start
22+
23+
Given two CSV files — `Person.csv` (nodes) and `KNOWS.csv` (relationships) — import them into a graph named `SocialGraph`:
24+
25+
```sh
26+
falkordb-bulk-insert SocialGraph \
27+
-n Person.csv \
28+
-r KNOWS.csv
29+
```
30+
31+
The label (for nodes) and relationship type (for relationships) are derived from the CSV filename. Multiple node and relation files can be provided by repeating the flags:
32+
33+
```sh
34+
falkordb-bulk-insert SocialGraph \
35+
-n Person.csv \
36+
-n Country.csv \
37+
-r KNOWS.csv \
38+
-r VISITED.csv
39+
```
40+
41+
## Connecting to FalkorDB
42+
43+
By default the loader connects to `redis://127.0.0.1:6379`. Use `--redis-url` to point it at a different instance:
44+
45+
```sh
46+
falkordb-bulk-insert SocialGraph \
47+
--redis-url redis://myhost:6379 \
48+
-n Person.csv
49+
```
50+
51+
## Key Options
52+
53+
| Flag | Extended flag | Description |
54+
|:----:|---------------|-------------|
55+
| `-u` | `--redis-url TEXT` | Server URL (default: `redis://127.0.0.1:6379`) |
56+
| `-n` | `--nodes TEXT` | Node CSV file (filename → label) |
57+
| `-N` | `--nodes-with-label TEXT` | Explicit label followed by node CSV file |
58+
| `-r` | `--relations TEXT` | Relationship CSV file (filename → type) |
59+
| `-R` | `--relations-with-type TEXT` | Explicit type followed by relationship CSV file |
60+
| `-o` | `--separator CHAR` | Field delimiter (default: `,`) |
61+
| `-d` | `--enforce-schema` | Require typed column headers (see below) |
62+
| `-j` | `--id-type TEXT` | Type of node ID property: `STRING` or `INTEGER` |
63+
| `-s` | `--skip-invalid-nodes` | Skip duplicate node IDs instead of erroring |
64+
| `-e` | `--skip-invalid-edges` | Skip edges with unknown endpoints instead of erroring |
65+
| `-i` | `--index Label:Property` | Create a range index after import |
66+
| `-f` | `--full-text-index Label:Property` | Create a full-text index after import |
67+
68+
## Enforcing a Schema
69+
70+
By default the loader infers each property's type. Use `--enforce-schema` (`-d`) when you want explicit control. Column headers must follow the `name:TYPE` format:
71+
72+
**User.csv**
73+
```csv
74+
:ID(User),name:STRING,rank:INT
75+
0,"Alice",5
76+
1,"Bob",8
77+
```
78+
79+
**FOLLOWS.csv**
80+
```csv
81+
:START_ID(User),:END_ID(User),weight:DOUBLE
82+
0,1,0.9
83+
1,0,0.4
84+
```
85+
86+
```sh
87+
falkordb-bulk-insert SocialGraph \
88+
--enforce-schema \
89+
-n User.csv \
90+
-r FOLLOWS.csv
91+
```
92+
93+
Accepted type strings: `ID`, `START_ID`, `END_ID`, `IGNORE`, `STRING`, `INT` / `INTEGER` / `LONG`, `DOUBLE` / `FLOAT`, `BOOL` / `BOOLEAN`, `ARRAY`.
94+
95+
## Bulk Updates
96+
97+
The companion command `falkordb-bulk-update` reads a CSV in batches and issues a parameterized Cypher query for each row — useful for incremental updates or when you want full control over the Cypher:
98+
99+
```sh
100+
falkordb-bulk-update SocialGraph \
101+
--csv User.csv \
102+
--query "MERGE (:User {id: row[0], name: row[1], rank: row[2]})"
103+
```
104+
105+
> **Note:** `falkordb-bulk-update` commits changes incrementally. Sanitize your CSV inputs beforehand to avoid leaving the graph in a partially-updated state.
106+
107+
## Further Reading
108+
109+
- [GitHub repository](https://github.com/falkordb/falkordb-bulk-loader) — full CLI reference, input constraints, and ID namespaces
110+
- [GRAPH.BULK specification](/design/bulk-spec) — technical wire-format specification for the underlying endpoint

integration/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Learn how to leverage FalkorDB's flexible APIs and SDKs to build high-performanc
1717
- [Apache Jena](./jena.md): Learn how to use FalkorDB with Apache Jena via the jena-falkordb-adapter.
1818
- [BOLT protocol support](./bolt-support.md): Learn how to connect to FalkorDB using the BOLT protocol.
1919
- [Spring Data FalkorDB](./spring-data-falkordb.md): Learn how to use FalkorDB with Spring Data for JPA-style object-graph mapping.
20+
- [Bulk Loader](./bulk-loader.md): Import large graphs from CSV files using the falkordb-bulk-loader Python utility.
2021

2122

0 commit comments

Comments
 (0)