You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mermaid.js should add an option for Entity Relationship diagrams to indicate reading direction of a relationship.
There might be multiple relationships between entities in both directions that shall appear on a diagram.
For example, I want to express a relationship:
A fop can contain 0 or multiple gop.
A gop can call 0 or 1 different fop.
The current available notation will not be able to express this unambigously, as the diagram will imply: A fop can call 0 or 1 gop
To workaround this limiation, but only under the precondition of assuming a reading direction from top-to-bottom, one could rename "calls" to "called by". Yet, this stays ambiguous.
For example: PROPERTY ||--|{ ROOM : contains
This statement can be read as a property contains one or more rooms, and a room is part of one and only one property.
It should read: A property contains one or more rooms, and a room is partcontained by one and only one property.
In general, the passive voice should be used to reverse a relationship, as anything different will require additional knowledge of the domain (and vocabulary)
The next statement is correct for many cased, but is based on too simplistic assumptions for technical documenation, as I tried to demonstrate in this issue.
When considered from the perspective of the second entity, the equivalent label is usually very easy to infer. (Some ER diagrams label relationships from both perspectives, but this is not supported here, and is usually superfluous).
Proposal
Mermaid.js should add an option for Entity Relationship diagrams to indicate reading direction of a relationship.
There might be multiple relationships between entities in both directions that shall appear on a diagram.
For example, I want to express a relationship:
A
fop
can contain 0 or multiplegop
.A
gop
can call 0 or 1 differentfop
.The current available notation will not be able to express this unambigously, as the diagram will imply: A
fop
can call 0 or 1gop
To workaround this limiation, but only under the precondition of assuming a reading direction from top-to-bottom, one could rename "calls" to "called by". Yet, this stays ambiguous.
The following paragraph from the documentation is in my opinion technically not 100% correct:
It should read:
A property contains one or more rooms, and a room is
partcontained by one and only one property.In general, the passive voice should be used to reverse a relationship, as anything different will require additional knowledge of the domain (and vocabulary)
The next statement is correct for many cased, but is based on too simplistic assumptions for technical documenation, as I tried to demonstrate in this issue.
Example
Screenshots
The text was updated successfully, but these errors were encountered: