Skip to content
LocusQ

DataLab

What it is

Converts any PostGIS data into the LocusQ schema from a YAML mapping, from the CLI or from a server and web app that runs whole builds.

Each rule names a source table, a target family, lookups for kind and class, and templates for ids and parents. An unknown key is an error, with a hint for a near miss. --dry-run prints the SQL and writes nothing.

A value the vocabulary does not know becomes the kind other, and the original value is kept in the row's tags as source:<column>. Every run reports, per rule, source rows = inserted + excluded.

The server keeps projects, mapping versions and builds, and runs apply-schema, convert, pg2osm and DataGen as stages with a live log. Every /api route needs a bearer token of at least 32 characters.

Install

The repositories and packages are private while LocusQ is in private release. Ask for access and say which tools you need.

Install

Node 24. The CLI runs from source with npx tsx; there is no build step for it.

bash
npm ci                                    # installs the workspaces, including tsx
export LOCUSQ_VOCABULARY=/path/to/locusq-schema/vocabulary.yaml

Convert your data

The password must be in the DSN. Set LOCUSQ_TARGET_DSN to write the schema into another database than the source.

bash
export LOCUSQ_SOURCE_DSN="postgresql://user:pass@127.0.0.1:5432/yourdb?sslmode=disable"
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml

Minimal usage

Check a mapping against your source without writing anything, then convert and keep the counts report:

bash
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml --dry-run
npx tsx bin/locusq-convert.ts mappings/<your-mapping>.yaml --report counts.json

Product page: DataLab. Release notes: Changelog.