Data Import
Import Neo4j-compatible Cypher scripts via CLI, REST API, or the Hammer UI. Supports semicolon-separated statements, multi-CREATE without semicolons, MERGE with ON CREATE SET, and variable binding across CREATE clauses.
CLI Import
anvil import cypher ./movies.cypher
REST API Import
curl -X POST http://localhost:7474/db/import/cypher \
-H "Content-Type: text/plain" \
-H "Authorization: Bearer $TOKEN" \
--data-binary @movies.cypher
# Response:
# {
# "total": 2,
# "success": 2,
# "nodesCreated": 171,
# "relationshipsCreated": 253,
# "errors": []
# }Hammer UI
Navigate to the Import page. Paste a Cypher script or upload a .cypher file. The result displays statements executed, nodes created, and relationships created.
Supported Formats
| Format | Description |
|---|---|
| Semicolon-separated | Standard format: each statement ends with ; |
| Multi-CREATE (no semicolons) | Neo4j initialDatabase.cypher format with variable binding across CREATEs |
| MERGE | MERGE with ON CREATE SET / ON MATCH SET for upserts |
| MATCH + MERGE | MATCH to bind variables, then MERGE relationships |
Automatic Skipping
The import engine automatically skips unsupported DDL (CREATE CONSTRAINT, CREATE INDEX) and standalone MATCH without RETURN/SET/DELETE/MERGE. These count as successful in the response.