Dia is a diagram drawing program. If you want to use dia to draw Entity-Relationship diagrams, these notes will help you to get started.
Start dia using the command dia.
If the “dia” command is not found, install it first.
Select the E/R modelling tools. To do this, use the drop-down menu in the “Dia v0.97” window (Other sheets → ER).
To draw an:
- Entity: Select the E and place it.
- Weak entity: Select the E and place it. Double click on it and select “Weak”.
- Relationship: Select R and place it.
- Supporting relationship (to a weak entity): Select R and place it. Double click on it and select “Identifying”.
- Attribute: Select A and place it.
- Key attribute: Select A and place it. Double click on it and select “Key” or “Weak key”.
- Isa: Select “Flowchart” from the drop down box where ER is selected (and “Assorted” was selected when you started dia). Select the triangle and place it. Observe that you do not have to double click (and can’t) this triangle to change the label in it.
- Connecting arrow/line: Select the straight line in the upper tools box (not in the “ER”-tool box). Draw the line. Make sure both ends hooks in (becomes red). Double click on the arrow. Select the start and end arrow to match your needs. The default arrow is not the correct one for a “one relationship”. It should be arrow number 4 from the top of the list. For an “exactly one” arrow it should be the arrow number 4 from the bottom of the list. The straight line is at the top.
To save your diagram right click on the diagram background and select File → Save as. To export it into for instance .png, right click on the diagram background and select File → Export. Remember that the only accepted formats on the lab hand-in are .png, .jpg, .gif and .pdf.