Skip to content

We do not allow multiple property values #289

Closed

Description

@enikao

For links (i.e. containments and references) we do allow multiple values: A House can contain multiple rooms, or a StackTrace can refer to multiple frames. We do NOT allow multiple values for properties: A Person cannot have multiple names in the same property.

Rationale: links always refer to a node. Each node has a unique id, thus we can clearly and unambiguously differentiate between several (target) elements in a link. This is important in lots of places, e.g. if we need to decide whether two nodes are equal.
This is harder for property values, as they don't have any identity. Thus, we would need to compare them by value -- and that's a problem. From the perspective of a JavaScript developer, integer 1 and string 1 might be considered equal; a Java developer would consider them different.
We don't want to make any judgement on the semantics of property values.

If we want to have multiple property values, we need to wrap them in their own concept.
Example: A Person contains several PersonName instances. Each instance has one name property.

concept Person {
  property age: integer
  containment names: PersonName[1..*]
}

concept PersonName {
  property name: string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions