Skip to main content
Cardinality is a Powersheet domain model concept. Polarion link roles do not have a cardinality setting — Powersheet uses the cardinality value to control how the sheet renders and navigates relationship data.

Cardinality Property

NameTypeDefaultDescription
cardinalitystringNone (required)Defines the relationship multiplicity between the from and to entity types
The cardinality property is declared within each entry of the relationships array in the domain model YAML. It works together with from, to, storage, linkRole, direct, and back to form a complete relationship definition.

Supported Cardinality Values

ValueFrom SideTo SideDescription
one-to-oneSingle entitySingle entityEach source entity links to exactly one target entity
one-to-manySingle entityMultiple entitiesEach source entity links to multiple target entities
many-to-oneMultiple entitiesSingle entityMultiple source entities link to one target entity
many-to-manyMultiple entitiesMultiple entitiesMultiple source entities link to multiple target entities

How the Three Configuration Layers Connect

The domain model, sheet sources, and sheet columns are connected through navigation property names. The cardinality of a relationship determines which expand pattern and column binding syntax to use.
  • Domain model defines entity types and relationships (including cardinality, direct, and back navigation property names)
  • Sheet sources define how to query and expand those relationships using the navigation property names
  • Sheet columns define how to display the resulting data using binding paths derived from the same navigation property names
diagram

Shared Domain Model for Examples

All examples on this page use the following minimal domain model:
domainModelTypes:
  Chapter:
    polarionType: heading

  UserNeed:
    polarionType: user_need
    properties:
      description:
      severity:

  SystemRequirement:
    polarionType: sys_req
    properties:
      description:
      severity:

  DesignRequirement:
    polarionType: des_req
    properties:
      description:

relationships:
  - from: UserNeed
    to: Chapter
    cardinality: many-to-one
    storage: linkedWorkItems
    linkRole: parent
    direct:
      name: chapter
    back:
      name: userNeeds

  - from: SystemRequirement
    to: UserNeed
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: decomposes
    direct:
      name: userNeeds
    back:
      name: systemRequirements

Many-to-One (N:1)

Scenario: Each UserNeed belongs to exactly one Chapter. The relationship uses the direct direction with name: chapter (singular, scalar navigation property). Because the cardinality is many-to-one, the navigation property on the “from” side points to a single entity.

Relationship Definition

- from: UserNeed
  to: Chapter
  cardinality: many-to-one
  storage: linkedWorkItems
  linkRole: parent
  direct:
    name: chapter
  back:
    name: userNeeds

Source Configuration

sources:
  - id: user_needs
    query:
      from: UserNeed
    expand:
      - name: chapter
The expand uses the direct navigation property name chapter. Because it is a scalar property (N:1), the expand resolves to a single related entity per row.

Column Configuration

columns:
  title:
    title: Title
    hasFocus: true
  chapter:
    title: Chapter
    display: title
    list:
      search:
        - title
  chapter.title:
    title: Chapter Title
    isReadOnly: true
Column KeyBehaviorDescription
chapterSingle-value reference pickerScalar navigation property renders as a dropdown picker. The display property controls the displayed label. The list.search array defines searchable fields.
chapter.titleRead-only displayDot-notation accesses a property on the referenced entity. Set isReadOnly: true to prevent editing.
A singular navigation property name (e.g., chapter) indicates a N:1 cardinality. The sheet renders this as a single-value reference picker, not an expandable child level.

One-to-Many (1:N)

Scenario: Each Chapter has multiple child UserNeed items. This is the reverse side of the many-to-one relationship above. It uses the back direction with name: userNeeds (plural, collection navigation property).

Relationship Definition

The same relationship entry is used — the 1:N perspective is simply the back direction of the N:1 relationship:
- from: UserNeed
  to: Chapter
  cardinality: many-to-one
  storage: linkedWorkItems
  linkRole: parent
  direct:
    name: chapter
  back:
    name: userNeeds
When querying from Chapter, the back.name value userNeeds provides the collection navigation property.

Source Configuration

sources:
  - id: chapters
    query:
      from: Chapter
    expand:
      - name: userNeeds
The expand uses the back navigation property name userNeeds. Because it is a collection property (1:N), the expand creates child rows underneath each Chapter.

Column Configuration

columns:
  title:
    title: Chapter
    hasFocus: true
  userNeeds:
    title: Title
    hasFocus: true
Column KeyBehaviorDescription
userNeedsChild row expansionCollection navigation property expands into a new hierarchical level in the sheet. Each child row displays one UserNeed.
When a collection navigation property is used as a column key, it opens a new sheet level with child rows. No dot-notation is needed — the expand directly opens the child level.

Many-to-Many (M:N)

Scenario: UserNeed items are linked to multiple SystemRequirement items, and vice versa. Many-to-many relationships use an association entity as an intermediate layer. The source expand is two levels deep, and column binding uses dot-notation to reach through the association to the target entity.

Relationship Definition

- from: SystemRequirement
  to: UserNeed
  cardinality: many-to-many
  storage: linkedWorkItems
  linkRole: decomposes
  direct:
    name: userNeeds
  back:
    name: systemRequirements

Source Configuration

sources:
  - id: user_needs
    query:
      from: UserNeed
    expand:
      - name: systemRequirements
        expand:
          - name: systemRequirement
The expand is two levels:
  1. systemRequirements — navigates to the association entity (collection)
  2. systemRequirement — navigates from the association to the actual target entity (scalar)

Column Configuration

columns:
  title:
    title: Title
    hasFocus: true
  systemRequirements.systemRequirement:
    title: System Requirement
    list:
      search:
        - objectId
        - title
      createNew: true
  systemRequirements.systemRequirement.title:
    title: SysReq Title
    hasFocus: true
Column KeyBehaviorDescription
systemRequirements.systemRequirementMulti-item reference pickerTwo-level dot-notation traverses association then target. Renders as a multi-item picker. list.search enables search; createNew: true allows creating new linked items.
systemRequirements.systemRequirement.titleDisplay field on targetThree-level dot-notation accesses a property on the target entity through the association.
M:N relationships always require a two-level expand in the source configuration. If you omit the inner expand (- name: systemRequirement), the column will bind to the association entity rather than the target entity, and data will not display correctly.

One-to-One (1:1)

The one-to-one cardinality value means each entity on both sides links to exactly one entity on the other side. The behavior is identical to many-to-one from a source expand and column binding perspective — the navigation property is scalar, and the column renders as a single-value reference picker.
- from: DesignRequirement
  to: SystemRequirement
  cardinality: one-to-one
  storage: linkedWorkItems
  linkRole: derives_from
  direct:
    name: systemRequirement
  back:
    name: designRequirement
The direct.name is singular (systemRequirement), and the column key systemRequirement behaves the same as in a N:1 relationship. The navigation property names declared in direct and back follow consistent naming conventions that signal the cardinality:
DirectionCardinality SideNaming ConventionExample
directN:1 (scalar)Singular, camelCasechapter, systemRequirement
directM:N (collection)Plural, camelCaseuserNeeds, riskControls
back1:N (collection)Plural, camelCaseuserNeeds, designRequirements
backM:N (collection)Plural, camelCasesystemRequirements, hazards
Singular navigation property names (e.g., chapter) indicate scalar references (N:1 or 1:1). Plural names (e.g., userNeeds) indicate collections (1:N or M:N). Consistent naming makes sheet configurations easier to read and debug.

Relationship Context Properties

Each relationship entry that includes a cardinality value also requires the following sibling properties:
PropertyTypeRequiredDescription
fromstringYesSource entity type name. Must match a key in domainModelTypes.
tostringYesTarget entity type name. Must match a key in domainModelTypes.
cardinalitystringYesOne of: one-to-one, one-to-many, many-to-one, many-to-many.
storagestringYesStorage mechanism. Typically linkedWorkItems for Polarion link-based relationships.
linkRolestringYesPolarion link role identifier (e.g., parent, refines, decomposes, mitigates).
directobjectYesForward navigation direction. Contains name (the navigation property name from from to to).
backobjectYesReverse navigation direction. Contains name (the navigation property name from to back to from).
The direct and back objects each contain a name property that defines the navigation property used in source expands and column binding paths.

Cardinality Summary

CardinalityModelSource ExpandColumn BindingUI Behavior
N:1cardinality: many-to-one, direct.name: chapter- name: chapterchapter, chapter.titleSingle-value reference picker
1:NReverse of N:1, back.name: userNeeds- name: userNeedsuserNeedsChild rows (new sheet level)
M:Ncardinality: many-to-many, back.name: systemRequirements- name: systemRequirements then - name: systemRequirementsystemRequirements.systemRequirementMulti-item reference picker
1:1cardinality: one-to-one, direct.name: systemRequirement- name: systemRequirementsystemRequirement, systemRequirement.titleSingle-value reference picker

Complete YAML Example

A full domain model demonstrating all cardinality patterns with the standard RTM entity set:
domainModelTypes:
  UserNeed:
    polarionType: user_need
    properties:
      description:
      severity:

  SystemRequirement:
    polarionType: sys_req
    properties:
      description:
      severity:

  DesignRequirement:
    polarionType: des_req
    properties:
      description:

  Hazard:
    polarionType: hazard
    properties:
      description:

  RiskControl:
    polarionType: risk_control
    properties:
      description:

relationships:
  # N:1 — each SystemRequirement derives from one UserNeed
  - from: SystemRequirement
    to: UserNeed
    cardinality: many-to-one
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: userNeed
    back:
      name: systemRequirements

  # 1:N — each UserNeed has many SystemRequirements (reverse of above)
  # No separate entry needed; use the back direction of the N:1 above.

  # 1:1 — each DesignRequirement derives from one SystemRequirement
  - from: DesignRequirement
    to: SystemRequirement
    cardinality: one-to-one
    storage: linkedWorkItems
    linkRole: derives_from
    direct:
      name: systemRequirement
    back:
      name: designRequirement

  # M:N — Hazards linked to multiple RiskControls and vice versa
  - from: Hazard
    to: RiskControl
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: mitigates
    direct:
      name: riskControls
    back:
      name: hazards
Source Code
  • Relationship.java
  • DomainModelV2.java
  • DatabridgeConstants.java
  • DomainModelTypeV2.java