Pomentumgraphos

A spreadsheet in, checked first

A CSV file from a spreadsheet or another system should become nodes, with every row checked before anything is written.

Analysts and data stewards5 stepsTested

Step through it, animated →

The situation

For a team that receives data as spreadsheets or exports from other systems, and has no loader for them. Without one, each file needs a script of its own, and a bad row is found only after half the file is written.

Step by step

  1. Problem 1. A loader per file

    Each spreadsheet needs its own script to turn rows into nodes, and its mistakes show up only once rows are written.

    Rows checked before writing: none · A row with no id: — · Sending the file again: —

  2. With graphos 2. The file, sent as it is

    The CSV file goes to POST …/graph/nodes:csv?label=Person as it is; edges go to …/graph/edges:csv with their type and their two labels.

    graphos reads it as UTF-8, detects a comma, semicolon or tab as the separator, and takes the first row as the header.

  3. How it works 3. Its columns, mapped

    The id column defaults to id or key. Any column can be renamed to a property, given a type (text, number or boolean), or left out.

    In the web UI, the import dialog maps each column, shows a preview, and checks again after every change.

  4. With graphos 4. Every row checked, nothing written

    With dry_run=true, graphos checks every row and writes nothing. It answers how many rows became how many records, and lists each issue with a count and up to three examples.

    A row with an empty or overlong id is refused. A ragged row, a repeated id, or a value that doesn't fit its type (that value is left out) is written anyway and reported. Rows sharing an id merge into one record, a later non-empty cell winning.

    Rows checked before writing: every one, in a dry run · A row with no id: refused, and reported

  5. How it works 5. Written in batches

    The import goes through the same bulk path as a stream: 500-row batches, so sending the file again is safe. It isn't one transaction, and a file over 256 MiB is refused.

    Sending the file again: safe

What graphos does here

Writes through the API
The same 500-row bulk path as a stream.
Web UI
The import dialog: mapping, preview and the check.
graphos-api
Reads the file as it is, with its separator detected.

What shows it: Tested

Tested: graphos's tests check the separator detection, rows of one id merged with a later non-empty cell winning, and that a dry run answers as the import would and writes nothing; the web UI's import dialog has tests of its own. No benchmark covers it. The file and its rows drawn are examples, as in the screenshot.

In graphos's latest release and covered by graphos's automated tests; no result is measured for it here.

See it in graphosImporting a CSV file: the columns mapped to a label's properties, and graphos's check of every row before anything is written.
The CSV import dialog: a semicolon-separated file of people mapped to the Person label, its columns as properties with their types, and graphos's check of every row before anything is written: one row refused for an empty id, a repeated id merged, a value that does not read as a number left out.

Try it

The usage guide's section on CSV import shows a dry run and its issues, for nodes and for relationships.

Read the usage guide

Related use cases