Logo
NeoArc Studio

Edge Properties and Cardinality

Define relationship properties with typed attributes. Set cardinality (1:1, 1:N, N:1, N:M) to document relationship semantics. Add notes and configure edge direction.

Edges in graph diagrams can have properties, cardinality, and documentation just like nodes. In Graph DB mode, edge properties are included in Cypher export and represent attributes stored on Neo4j relationships.

Edge Attributes

Every edge supports these core attributes:

Cardinality

Cardinality indicates how many instances can participate in the relationship:

Setting Cardinality

Edge Properties

Relationships can have their own properties, just like nodes. This is useful for storing data about the relationship itself.

Adding Edge Properties

Edge Property Types

Edge properties support the same types as node properties:

Direction

By default, edges are directed (have an arrow). You can make edges undirected for symmetric relationships.

Edge Labels

Edges support three label positions:

Customer ----[PLACED]----> Order
  owner                      item
(sourceLabel)            (targetLabel)

Edge Notes

Add documentation to edges using the Note field. Notes support Markdown formatting and appear in tooltips.

## PLACED Relationship

Represents a customer placing an order.

**Business Rules:**
- A customer can place multiple orders
- Each order belongs to exactly one customer
- The relationship stores the channel (web, mobile, phone)

Cypher Export

Edge properties and cardinality are included in Cypher export:

// Customer -[PLACED]-> Order (1:N)
// A customer places orders through various channels
MATCH (a:Customer {id: $customerId})
MATCH (b:Order {id: $orderId})
CREATE (a)-[:PLACED {
  date: $date,           // datetime, required
  channel: $channel,     // string, enum: [web,mobile,phone]
  promotionCode: $promotionCode  // string, nullable
}]->(b);

Validation

Edge validation in Graph DB mode checks:

Edge Property Storage

Edge properties are stored in the diagram file:

{
  "id": "edge-001",
  "source": "node-customer",
  "target": "node-order",
  "label": "PLACED",
  "cardinality": "1:N",
  "directed": true,
  "properties": [
    {
      "id": "prop-001",
      "name": "date",
      "type": "datetime",
      "required": true
    },
    {
      "id": "prop-002",
      "name": "channel",
      "type": "string",
      "required": false
    }
  ],
  "note": "Customer places an order through a sales channel."
}