A new syntax for Entity-Relationship (or Information Enineering) ERD diagrams

0 votes
asked Mar 19, 2019 in Closed feature request by nicamlg (140 points)

I would like to point there's already some kind of "textual representation" for ER that could have been ported to PlantUML. I have found a comprehensive document about it. In short, it could have been like this:

@startuml

' __ could signal the Primary Key (just a suggestion)

entity Bus (__reg_no, make, size, deck, no_of_pass)
entity Route (__route_no, avg_pass)
entity Driver (__emp_no, name, cell)
entity Stage (__stage_no)
entity Town (__name)

Bus   m..1 Route : is serviced by
Route 1..m Stage : comprises
Driver m..1  : is allocated to
Stage n..m Town : Passes-though
Route n..m Town : Passes-though

@enduml

 

Which is more readable than the cryptic }|-|| (which is related to the drawn symbols, I know).
Also, the attributes can be written in a more classical way, less "java-ish", as shown in the entities declarations. I.e., the "Bus" entity would be shown as:

If attributes are listed and not hidden (`hide attributes`, i.e.) they could be also drawn following the ERD stadard, UseCase-like oval surrounding their entity, something like this:

NOTE: Since I used a Use-case diagram, I couldn't add the ERD symbols to the line ends.

And, just for completeness and drive the developers crazy, declare the relationships as diamonds if declared:

skinparam erdModel chen

etc.

But, just a thought. Document the current implementation would be nice enough. O:)

[NOTE 2: I admit I do not usually add the attributes in E-R diagrams...]

commented Mar 19, 2019 by zimchaa (1,020 points)
It may be possible to recreate this type of approach using the Macros, and some examples already exist for the more descriptive relationships - examples include the C4 PlantUML library https://github.com/RicardoNiepel/C4-PlantUML with a simple approach (using Rel keyword) but there are more complex examples, https://github.com/ebbypeter/Archimate-PlantUML - using Rel_RelationType keywords -

"The RelationTypes supported are:

    Access
    Aggregation
    Assignment
    Association
    Composition
    Flow
    Influnce
    Realization
    Serving
    Specilization
    Triggering
"
commented Apr 11, 2019 by nicamlg (140 points)
The question is that, AFAIK, using macros means that "standard"

  Bus   m..1 Route : is serviced by

Would become something like:

  er_relationship ('Bus',  'm..1', 'Route' , 'is serviced by')

The attribute drawing would not be a problem, I think (unless macros need a fixed number of parameters...), because the syntax is already similar (I suppose this is what led you to suggest it :-)).

But, aliasing ' }|-|{ ' to 'm..m' etc., would increase the readability of the diagram source code.
commented Aug 23, 2019 by nicamlg (140 points)
Any new on this?

That way we could have a true ERD instead of a version of the class UML diagram.

An example of ERD, and how could be accomplished with PlantUML, since all the elements exist already.

https://www.smartdraw.com/entity-relationship-diagram/

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...