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:

AttributeDescriptionRequired
LabelRelationship type name (e.g., PLACED, CONTAINS)Optional
Source LabelText displayed near the source nodeOptional
Target LabelText displayed near the target nodeOptional
CardinalityRelationship multiplicity (1:1, 1:N, N:1, N:M)Optional
DirectedWhether the relationship has directionDefault: true
PropertiesTyped attributes on the relationshipOptional
NoteMarkdown documentation for the edgeOptional
ColourEdge stroke colourOptional

Cardinality

Cardinality indicates how many instances can participate in the relationship:

CardinalityMeaningExample
1:1One-to-onePerson HAS_PASSPORT Passport
1:NOne-to-manyCustomer PLACED Order
N:1Many-to-oneOrderLine BELONGS_TO Order
N:MMany-to-manyStudent ENROLLED_IN Course

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:

TypeUse Case
stringRelationship metadata, codes, identifiers
intQuantities, counts, sequence numbers
floatPrices, percentages, measurements
booleanFlags, toggles, status indicators
dateRelationship start/end dates
datetimeTimestamps for relationship events
uuidRelationship identifiers
jsonComplex nested data on relationships

Direction

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

DirectedRenderingUse Case
trueArrow points from source to targetPLACED, CONTAINS, FOLLOWS
falseNo arrow, line onlyFRIENDS_WITH, RELATED_TO, SIBLING_OF

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:

RuleSeverityDescription
missing-cardinalityWarningEdge has no cardinality defined
duplicate-property-nameErrorSame property name used multiple times on edge
missing-labelInfoEdge has no relationship type label

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."
}