# htsql / doc / dia / sample-model.tex

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113  \documentclass{article} \include{prelude} \begin{document} \tikzset{ > = stealth', shorten > = 1pt, shorten < = 1pt, node distance = 3cm and 3cm, unit node/.style = {fill, star, star points=8, inner sep=0pt, minimum size=3mm}, class node/.style = {fill, circle, inner sep=0pt, minimum size=2mm}, domain node/.style = {fill, rectangle, inner sep=0pt, minimum size=2mm}, arrow/.style = {font=\small\ttfamily, above, sloped}, legend/.style = {font=\small\color{black!70}}, information/.style = {rounded corners, inner sep=1ex, fill=blue!5} } \pgfdeclarelayer{background} \pgfsetlayers{background,main} \begin{tikzpicture} \node[unit node] (unit) {}; \node[class node] (school) [below right=3cm and 1.5cm of unit] {}; \node[class node] (program) [right=of school] {}; \node[class node] (department) [below left=3cm and 1.5cm of unit] {}; \node[class node] (course) [left=of department] {}; \node[domain node] (string) [below=of department] {}; \draw[->] (unit) to[bend left] node[arrow, near end] {program} (program); \draw[->, very thick] (unit) to[bend left] node[arrow] {school} (school); \draw[->] (unit) to[bend right] node[arrow] {department} (department); \draw[->] (unit) to[bend right] node[arrow, near end] {course} (course); \draw[->] (program) to[bend right] node[arrow] {school} (school); \draw[->] (school) to[bend right] node[arrow] {program} (program); \draw[->, very thick] (school) to[bend right] node[arrow] {department} (department); \draw[->] (department) to[bend right] node[arrow] {school} (school); \draw[->] (department) to[bend right] node[arrow] {course} (course); \draw[->] (course) to[bend right] node[arrow] {department} (department); \draw[->] (program) edge[loop, min distance=2cm, in=-35, out=35] node[arrow] {part\_of} (program); \draw[<-] (program) edge[loop, min distance=6cm, in=-60, out=60] node[arrow] {program\_via\_part\_of} (program); \draw[->] (department) to[bend left] node[arrow] {code} (string); \draw[->, very thick] (department) to node[arrow] {name} (string); \draw[->] (department) to[bend right] node[arrow, below, rotate=180] {school\_code} (string); \node[unit node] (unit node) [below=2 of school] {}; \node[class node] (class node) [below=1ex of unit node] {}; \node[domain node] (domain node) [below=1ex of class node] {}; \node[legend] (unit legend) [right=.5em of unit node] {unit node}; \node[legend] (class legend) [right=.5em of class node] {class node}; \node[legend] (domain legend) [right=.5em of domain node] {domain node}; \begin{pgfonlayer}{background} \node[information] [fit=(unit node) (class node) (domain node) (unit legend) (class legend) (domain legend)] {}; \end{pgfonlayer} \end{tikzpicture} \end{document}