Properties with Neo4j types, examples, and constraints

Every node and relationship has a list of properties. Each property has a key, a type from Neo4j's list of property types, and an example value, and can be marked unique or required. Here's how to add, type, order, and export them.

Key, Type, and Example

Properties are edited in three columns, in the side panel's Edit tab and in the box under a node or relationship on the canvas:

The new-property row at the bottom has all three fields. Enter in any of them saves the row as one undo step; Tab moves between the fields. Typing key: TYPE in the Key field saves both. A key that already exists, or that is only digits, is stopped with a message.

Unique and Required

At the top of the type list are two checkboxes, Unique and Required: Neo4j's two property constraints. On the canvas, a required property gets Cypher's exclamation mark after its type (orderId: STRING!) and a unique property the word unique at the end of its line. In the Cypher export each one becomes a CREATE CONSTRAINT … IF NOT EXISTS statement.

Order

Drag a property by the handle (the dots) at the left of its row to move it, in the side panel or on the canvas; a line shows where it will land. The up and down buttons on the handle move it one step. The order matters: the topmost property's example is the caption.

Paste a whole block

Paste into the Key field of the new-property row and toro4n reads the whole block, in one undo step:

A property that is already there keeps its type, example, and rules and only gets what it lacks. A message sums it up: "Added 3 properties · 1 was already there".

How properties are drawn and exported

Under a circle node, and under a relationship's type, the properties are listed on a box whose color is Property background in the Format tab, one line per property: key: TYPE (example), or only what's filled in. The fixed Properties layer hides or shows all of them at once. In Square mode they are three columns inside the card and can't be hidden. In the Cypher export, the value of a property is its example if there is one, otherwise its type name; JSON files always carry everything.

Related