Admin Tool

The Traverse Admin tool (traverse-admin) builds .tvdb database files offline, from CSV files or a Cypher script, with no server running. The files load into traverse-server (at startup, or uploaded and loaded while it runs), open in traverse-cli --file and in the embedded SDKs.

CSV Import

Import CSV files into a new .tvdb database. Specify node files with --nodes LABEL=file.csv and edge files with --edges TYPE=file.csv:

traverse-admin import \
  --nodes Person=people.csv \
  --nodes Company=companies.csv \
  --edges WORKS_AT=employment.csv \
  -o ./data/company.tvdb

Options

FlagShortDescriptionDefault
--nodes LABEL=file.csv-CSV file for nodes with the given label (repeatable)-
--edges TYPE=file.csv-CSV file for edges with the given type (repeatable)-
--output <PATH>-oOutput .tvdb file path-
--id-type <string|int>-ID column type for cross-referencingstring
--delimiter <CHAR>-CSV field delimiter (single character),
--skip-bad-rows-Skip rows that fail to parse instead of aborting-

CSV Format

Node CSV files must include a header row. The :ID column is used as the node identifier for edge resolution. Columns starting with : (Neo4j meta columns) are skipped:

:ID,name,age
1,Alice,30
2,Bob,25
3,Carol,28

Edge CSV files must include :START_ID and :END_ID columns that reference node IDs:

:START_ID,:END_ID,since
1,2,2020
2,3,2021

Type Inference

Property values are auto-inferred from CSV data:

  • true / false → boolean
  • Integer values → 64-bit integer
  • Decimal values → 64-bit float
  • Empty cells → null (skipped)
  • Everything else → string

Cypher Import

Import a file of Cypher statements (one per line) into a new .tvdb database:

traverse-admin cypher-import \
  -i data.cypher \
  -o ./data/mydb.tvdb

Options

FlagShortDescriptionDefault
--input <FILE>-iCypher file (one statement per line)-
--output <PATH>-oOutput .tvdb file path-
--skip-errors-Continue on statement errors-
--index LABEL:PROP-Pre-create an index (repeatable)-

File Format

  • One statement per line; a trailing semicolon is stripped
  • Empty lines and lines starting with // are skipped

Without --skip-errors the first failing statement stops the import. With it, failures are counted, the first 10 are printed, and the import runs to the end.

Auto-Indexing

Without --index flags, the importer watches for the first MATCH after the CREATE statements. At that point it scans the data loaded so far and indexes every (label, property) pair it finds, so the MATCH lookups that follow (typically the ones that create relationships) don't scan every node.

With --index flags, only those indexes are made, before the first statement runs:

traverse-admin cypher-import \
  -i data.cypher \
  -o output.tvdb \
  --index Person:id \
  --index Company:name

Tip: Pre-creating indexes with --index speeds up imports that rely on MERGE or property lookups, because each lookup hits an index instead of scanning.

Using the Result

# start a server with it
traverse-server --data ./data/company.tvdb

# or upload it to a running server: see the HTTP API (PUT /api/files/{name}),
# then load it and point an alias at it