You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/core/flow_def.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -348,7 +348,7 @@ It will use `Staging__doc_embeddings` as the collection name if the current app
348
348
Most time a target storage is created by calling `export()` method on a collector, and this `export()` call comes with configurations needed for the target storage, e.g. options for storage indexes.
349
349
Occasionally, you may need to specify some configurations for target storage out of the context of any specific data collector.
350
350
351
-
For example, for graph database targets like `Neo4j`, you may have a data collector to export data to Neo4j relationships, which will create nodes referenced by various relationships in turn.
351
+
For example, for graph database targets like `Neo4j` and `Kuzu`, you may have a data collector to export data to relationships, which will create nodes referenced by various relationships in turn.
352
352
These nodes don't directly come from any specific data collector (consider relationships from different data collectors may share the same nodes).
353
353
To specify configurations for these nodes, you can *declare* spec for related node labels.
If you don't have a Neo4j database, you can start a Neo4j database using our docker compose config:
@@ -407,14 +413,14 @@ Please read and agree the license before starting the instance.
407
413
408
414
:::
409
415
410
-
The `Neo4j`storage exports each row as a relationship to Neo4j Knowledge Graph. The spec takes the following fields:
416
+
The `Neo4j`target spec takes the following fields:
411
417
412
418
*`connection` (type: [auth reference](../core/flow_def#auth-registry) to `Neo4jConnectionSpec`): The connection to the Neo4j database. `Neo4jConnectionSpec` has the following fields:
413
419
*`url` (type: `str`): The URI of the Neo4j database to use as the internal storage, e.g. `bolt://localhost:7687`.
414
420
*`user` (type: `str`): Username for the Neo4j database.
415
421
*`password` (type: `str`): Password for the Neo4j database.
416
422
*`db` (type: `str`, optional): The name of the Neo4j database to use as the internal storage, e.g. `neo4j`.
417
-
*`mapping` (type: `NodeMapping | RelationshipMapping`): The mapping from collected row to nodes or relationships of the graph. 2 variations are supported:
423
+
*`mapping` (type: `Nodes | Relationships`): The mapping from collected row to nodes or relationships of the graph. For either [nodes to export](#nodes-to-export) or [relationships to export](#relationships-to-export).
418
424
419
425
Neo4j also provides a declaration spec `Neo4jDeclaration`, to configure indexing options for nodes only referenced by relationships. It has the following fields:
420
426
@@ -424,4 +430,26 @@ Neo4j also provides a declaration spec `Neo4jDeclaration`, to configure indexing
424
430
*`primary_key_fields` (required)
425
431
*`vector_indexes` (optional)
426
432
427
-
You can find an end-to-end example [here](https://github.com/cocoindex-io/cocoindex/tree/main/examples/docs_to_knowledge_graph).
433
+
### Kuzu
434
+
435
+
CocoIndex supports talking to Kuzu through its [API server](https://github.com/kuzudb/api-server).
436
+
You can bring up a Kuzu API server locally by running:
437
+
438
+
```bash
439
+
KUZU_DB_DIR=$HOME/.kuzudb
440
+
KUZU_PORT=8123
441
+
docker run -d --name kuzu -p ${KUZU_PORT}:8000 -v ${KUZU_DB_DIR}:/database kuzudb/api-server:latest
442
+
```
443
+
444
+
The `Kuzu` target spec takes the following fields:
445
+
446
+
*`connection` (type: [auth reference](../core/flow_def#auth-registry) to `KuzuConnectionSpec`): The connection to the Kuzu database. `KuzuConnectionSpec` has the following fields:
447
+
*`api_server_url` (type: `str`): The URL of the Kuzu API server, e.g. `http://localhost:8123`.
448
+
*`mapping` (type: `Nodes | Relationships`): The mapping from collected row to nodes or relationships of the graph. For either [nodes to export](#nodes-to-export) or [relationships to export](#relationships-to-export).
449
+
450
+
Kuzu also provides a declaration spec `KuzuDeclaration`, to configure indexing options for nodes only referenced by relationships. It has the following fields:
451
+
452
+
*`connection` (type: auth reference to `KuzuConnectionSpec`)
453
+
* Fields for [nodes to declare](#declare-extra-node-labels), including
0 commit comments