Logo
NeoArc Studio

How to Model a Graph Database

Step-by-step guide to modelling a standalone graph database schema for Neo4j using the graph diagram editor, including typed properties, key roles, 18-rule validation, and Cypher DDL export. For the model-first workflow using model.neoarc, see the Data Model guide.

Goal

Model a standalone graph database schema for Neo4j using the graph diagram editor's graph-db authoring mode. Define nodes with typed properties and key roles, connect them with labelled edges, add composite constraints, validate the schema against 18 rules (10 core plus 8 search-specific), and export to Cypher DDL for Neo4j.

Step 1: Create a Graph Diagram

Step 2: Set the Authoring Mode to Graph DB

The graph editor supports three authoring modes. Set it to graph-db for full schema modelling with typed properties, key roles, and validation.

Step 3: Add Nodes with Labels

Step 4: Define Typed Properties

Each node supports properties with full type information. Select a node and use the right panel to add properties.

Step 5: Set Key Roles

Key roles define how properties participate in identity and referencing.

Step 6: Add Edges with Cardinality

Step 7: Add Composite Constraints

Composite constraints define uniqueness across multiple properties on a single node. Use these when no single property is unique but a combination is (e.g. firstName + lastName + dateOfBirth).

Step 8: Run Validation

The graph editor validates the schema against 18 rules across four categories (structural, semantic, domain, and search).

Step 9: Export to Cypher DDL