# htsql / doc / dia / singular-links.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  \documentclass{article} \include{prelude} \begin{document} \tikzset{ > = stealth', node distance = 0.5cm and 2cm, entity/.style = {fill=black!10, circle, text width=1.5cm, minimum size=4cm, text centered, font=\small\ttfamily}, value/.style = {fill=black!10, rectangle, text width=4cm, minimum size=4cm, text centered, font=\small\ttfamily}, link/.style = {font=\ttfamily, above}, brace/.style = {decorate, decoration={brace,amplitude=8pt,raise=4pt}, draw=blue!50}, brace header/.style = {below=10pt, font=\itshape\color{blue!75}} } \begin{tikzpicture} \node[entity, label=above:school] (school) {$\vdots$ \\ {[eng]} \\ {[la]} \\ {[ns]} \\ $\vdots$}; \node[entity, label=above:department] (department) [right=of school] {$\vdots$ \\ {[be]} \\ {[ee]} \\ {[me]} \\ {[hist]} \\ {[psych]} \\ {[chem]} \\ $\vdots$}; \node[value, label=above:string] (string) [left=of school] {$\vdots$ \\ {'north'} \\ {'old'} \\ {'south'} \\ $\vdots$}; \coordinate (eng 1 out) at ($(school) +(15pt,9pt)$); \coordinate (la 1 out) at ($(school) +(15pt,-2pt)$); \coordinate (ns 1 out) at ($(school) +(15pt,-13pt)$); \coordinate (eng 2 out) at ($(school) +(-15pt,9pt)$); \coordinate (la 2 out) at ($(school) +(-15pt,-2pt)$); \coordinate (ns 2 out) at ($(school) +(-15pt,-13pt)$); \coordinate (be in) at ($(department) +(-15pt,26pt)$); \coordinate (ee in) at ($(department) +(-15pt,15pt)$); \coordinate (me in) at ($(department) +(-15pt,4pt)$); \coordinate (hist in) at ($(department) +(-20pt,-8pt)$); \coordinate (psych in) at ($(department) +(-20pt,-19pt)$); \coordinate (chem in) at ($(department) +(-20pt,-30pt)$); \coordinate (north in) at ($(string) +(20pt,9pt)$); \coordinate (old in) at ($(string) +(20pt,-2pt)$); \coordinate (south in) at ($(string) +(20pt,-13pt)$); \draw[->] (eng 1 out) to node[link, above=0.5cm] {department} (be in); \draw[->] (eng 1 out) to (ee in); \draw[->] (eng 1 out) to (me in); \draw[->] (la 1 out) to (hist in); \draw[->] (la 1 out) to (psych in); \draw[->] (ns 1 out) to (chem in); \draw[->] (eng 2 out) to node[link, above=0.5cm] {campus} (north in); \draw[->] (la 2 out) to (old in); \draw[->] (ns 2 out) to (old in); \draw[brace] ($(department.south) -(5pt,0)$) -- node[brace header] {a plural link} ($(school.south) +(5pt,0)$); \draw[brace] ($(school.south) -(5pt,0)$) -- node[brace header] {a singular link} ($(string.south) +(5pt,0)$); \end{tikzpicture} \end{document}