Commits

Kirill Simonov  committed 8e7070e

Updated model reference.

  • Participants
  • Parent commits 47da614

Comments (0)

Files changed (8)

File doc/dia/prelude.tex

 \usepackage[landscape]{geometry}
 \usepackage{array}
 \usepackage{tikz}
-\usetikzlibrary{arrows,shapes,positioning,fit,calc,decorations.pathreplacing}
+\usetikzlibrary{arrows,shapes,shapes.arrows,positioning,fit,calc,decorations.pathreplacing,chains}
 \pagestyle{empty}
 \renewcommand*\familydefault{\sfdefault}
 

File doc/dia/sample-instance-1.tex

 \begin{document}
 
 \tikzset{
+    > = stealth', shorten > = 1pt, shorten < = 1pt,
     node distance = 1.5cm,
-    entity/.style = {fill=black!10, circle,
-                     text width=1.5cm, minimum size=3cm,
-                     text centered, font=\small\ttfamily},
-    value/.style = {fill=black!10, rectangle,
-                    text width=1.5cm, minimum size=3cm,
-                    text centered, font=\small\ttfamily}
+    unit node/.style = {fill=black!10, star, star points=8, minimum size=3cm},
+    domain node/.style = {fill=black!10, rectangle, minimum size=3cm},
+    class node/.style = {fill=black!10, circle, minimum size=3cm},
+    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
+                                          inner sep=.5pt,
+                                          text depth=.25ex, text height=1.5ex}},
+    node header/.style = {font=\itshape}
 }
 
 \begin{tikzpicture}
 
-\node[entity, label=above:school] (school)
-    {$\vdots$ \\ {[eng]} \\ {[la]} \\ {[ns]} \\ $\vdots$};
-\node[value, label=above:boolean] (boolean) [right=of school]
-    {false \\ true};
-\node[value, label=above:integer] (school) [right=of boolean]
-    {$\vdots$ \\ -1 \\ 0 \\ 1 \\ $\vdots$};
+\node[unit node] (unit) {};
+\node[domain node] (integer) [right=of unit] {};
+\node[class node] (school) [right=of integer] {};
+
+\node[node header] at (unit.north) [above]
+    {unit};
+\node[node header] at (integer.north) [above]
+    {integer};
+\node[node header] at (school.north) [above]
+    {school};
+
+\node[node content] at (unit)
+{
+    \node[text height=2ex] {\large{@}}; \\
+};
+
+\node[node content] at (integer)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node {-1}; \\
+    \node {0}; \\
+    \node {1}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
+
+\node[node content] at (school)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node {{[eng]}}; \\
+    \node {{[ns]}}; \\
+    \node {{[sc]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
 \end{tikzpicture}
 

File doc/dia/sample-instance-2.tex

 \begin{document}
 
 \tikzset{
-    > = stealth',
-    node distance = 0.5cm and 2.5cm,
-    unit/.style = {fill=black!10, star, star points=8,
-                   text width=1cm,
-                   text centered, font=\large\ttfamily},
-    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=5cm, minimum size=4cm,
-                    text centered, font=\small\ttfamily},
-    link/.style = {font=\ttfamily},
+    > = stealth', shorten > = 1pt, shorten < = 1pt,
+    node distance = 0.1cm,
+    unit node/.style = {fill=black!10, star, star points=8, minimum size=3cm},
+    domain node/.style = {fill=black!10, rectangle, minimum size=3cm,
+                          text width=4cm},
+    class node/.style = {fill=black!10, circle, minimum size=3cm},
+    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
+                                          inner sep=.5pt,
+                                          text depth=.25ex, text height=1.5ex}},
+    arrow/.style = {single arrow, fill=black!5, minimum height=3cm,
+                    minimum width=2.5cm, single arrow head extend=.1cm,
+                    single arrow tip angle=120},
+    arrow header/.style = {font=\ttfamily}
 }
 
 \begin{tikzpicture}
 
-\node[unit] (unit)
-    {{@}};
-\node[entity] (school) [right=of unit]
-    {$\vdots$ \\ {[eng]} \\ {[la]} \\ {[ns]} \\ $\vdots$};
-\node[entity] (department) [below=of school]
-    {$\vdots$ \\ {[chem]} \\ {[hist]} \\ {[psych]} \\
-     {[be]} \\ {[ee]} \\ {[me]} \\ $\vdots$};
-\node[value] (string) [left=of department]
-    {$\vdots$ \\ {'Chemistry'} \\ {'History'} \\ {'Psychology'} \\
-     {'Bioengineering'} \\ {'Electrical Engineering'} \\ {'Mechanical Engineering'} \\ $\vdots$};
+\node[unit node] (unit) {};
+\node[arrow] (unit to school) [right=of unit] {};
+\node[class node] (school) [right=of unit to school] {};
+\node[arrow, shape border rotate=270, xshift=2cm] (school to department) [below=of school] {};
+\node[class node, xshift=-2cm] (department) [below=of school to department] {};
+\node[arrow, shape border rotate=180] (department to name) [left=of department] {};
+\node[domain node] (string) [left=of department to name] {};
 
-\coordinate (unit out)
-    at ($ (unit) +(5pt,0pt) $);
+\node[arrow header] at (unit to school.north) [above]
+    {school};
+\node[arrow header, rotate=270] at (school to department.east) [above]
+    {department};
+\node[arrow header] at (department to name.north) [above]
+    {name};
 
-\coordinate (eng in)
-    at ($ (school) +(-15pt,9pt) $);
-\coordinate (la in)
-    at ($ (school) +(-15pt,-2pt) $);
-\coordinate (ns in)
-    at ($ (school) +(-15pt,-13pt) $);
-\coordinate (eng out)
-    at ($ (school) +(15pt,9pt) $);
-\coordinate (la out)
-    at ($ (school) +(15pt,-2pt) $);
-\coordinate (ns out)
-    at ($ (school) +(15pt,-13pt) $);
+\node[node content] at (unit)
+{
+    \node[text height=2ex] (I) {\large{@}}; \\
+};
 
-\coordinate (chem in)
-    at ($ (department) +(20pt,26pt) $);
-\coordinate (hist in)
-    at ($ (department) +(20pt,15pt) $);
-\coordinate (psych in)
-    at ($ (department) +(20pt,4pt) $);
-\coordinate (be in)
-    at ($ (department) +(15pt,-8pt) $);
-\coordinate (ee in)
-    at ($ (department) +(15pt,-19pt) $);
-\coordinate (me in)
-    at ($ (department) +(15pt,-30pt) $);
-\coordinate (chem out)
-    at ($ (department) +(-20pt,26pt) $);
-\coordinate (hist out)
-    at ($ (department) +(-20pt,15pt) $);
-\coordinate (psych out)
-    at ($ (department) +(-20pt,4pt) $);
-\coordinate (be out)
-    at ($ (department) +(-15pt,-8pt) $);
-\coordinate (ee out)
-    at ($ (department) +(-15pt,-19pt) $);
-\coordinate (me out)
-    at ($ (department) +(-15pt,-30pt) $);
+\node[node content] at (school)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (eng) {{[eng]}}; \\
+    \node (ns) {{[ns]}}; \\
+    \node (sc) {{[sc]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
-\coordinate (chem name)
-    at ($ (string) +(35pt,26pt) $);
-\coordinate (hist name)
-    at ($ (string) +(35pt,15pt) $);
-\coordinate (psych name)
-    at ($ (string) +(35pt,4pt) $);
-\coordinate (be name)
-    at ($ (string) +(50pt,-8pt) $);
-\coordinate (ee name)
-    at ($ (string) +(60pt,-19pt) $);
-\coordinate (me name)
-    at ($ (string) +(60pt,-30pt) $);
+\node[node content] at (department)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (astro) {{[astro]}}; \\
+    \node (career) {{[career]}}; \\
+    \node (chem) {{[chem]}}; \\
+    \node (comp) {{[comp]}}; \\
+    \node (ee) {{[ee]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
+
+\node[node content] at (string)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (astro name) {'Astronomy'}; \\
+    \node (career name) {'Career Development'}; \\
+    \node (chem name) {'Chemistry'}; \\
+    \node (comp name) {'Computer Science'}; \\
+    \node (ee name) {'Electrical Engineering'}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
 \draw[->]
-    (unit out) to node[link, above=0.2cm] {school} (eng in);
+    (I.east) to (eng.west);
 \draw[->]
-    (unit out) to (la in);
+    (I.east) to (ns.west);
 \draw[->]
-    (unit out) to (ns in);
+    (I.east) to (sc.west);
 
+\draw[->, bend left=75]
+    (eng.east) to (ee.east);
+\draw[->, bend left=75]
+    (eng.east) to (comp.east);
 \draw[->, bend left=60]
-    (eng out) to node[link, right=0.2cm] {department} (me in);
+    (ns.east) to (chem.east);
 \draw[->, bend left=60]
-    (eng out) to (ee in);
-\draw[->, bend left=60]
-    (eng out) to (be in);
-\draw[->, bend left=45]
-    (la out) to (hist in);
-\draw[->, bend left=45]
-    (la out) to (psych in);
-\draw[->, bend left=30]
-    (ns out) to (chem in);
+    (ns.east) to (astro.east);
 
 \draw[->]
-    (chem out) to node[link, above=0.2cm] {name} (chem name);
+    (astro.west) to (astro name.east);
 \draw[->]
-    (hist out) to (hist name);
+    (career.west) to (career name.east);
 \draw[->]
-    (psych out) to (psych name);
+    (chem.west) to (chem name.east);
 \draw[->]
-    (be out) to (be name);
+    (comp.west) to (comp name.east);
 \draw[->]
-    (ee out) to (ee name);
-\draw[->]
-    (me out) to (me name);
+    (ee.west) to (ee name.east);
 
 \end{tikzpicture}
 

File doc/dia/sample-model.tex

 \tikzset{
     > = stealth', shorten > = 1pt, shorten < = 1pt,
     node distance = 3cm and 3cm,
-    unit/.style = {fill, star, star points=8, inner sep=0pt, minimum size=3mm},
-    entity/.style = {fill, circle, inner sep=0pt, minimum size=2mm},
-    value/.style = {fill, rectangle, inner sep=0pt, minimum size=2mm},
-    link/.style = {font=\small\ttfamily, above, sloped},
-    label/.style = {font=\small\color{black!70}},
+    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}
 }
 
 
 \begin{tikzpicture}
 
-\node[unit] (unit) {};
-\node[entity] (school) [below right=3cm and 1.5cm of unit] {};
-\node[entity] (program) [right=of school] {};
-\node[entity] (department) [below left=3cm and 1.5cm of unit] {};
-\node[entity] (course) [left=of department] {};
-\node[value] (string) [below=of department] {};
+\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[link, near end] {program}
+    to[bend left] node[arrow, near end] {program}
     (program);
 \draw[->, very thick]
     (unit)
-    to[bend left] node[link] {school}
+    to[bend left] node[arrow] {school}
     (school);
 \draw[->]
     (unit)
-    to[bend right] node[link] {department}
+    to[bend right] node[arrow] {department}
     (department);
 \draw[->]
     (unit)
-    to[bend right] node[link, near end] {course}
+    to[bend right] node[arrow, near end] {course}
     (course);
 
 \draw[->]
     (program)
-    to[bend right] node[link] {school}
+    to[bend right] node[arrow] {school}
     (school);
 \draw[->]
     (school)
-    to[bend right] node[link] {program}
+    to[bend right] node[arrow] {program}
     (program);
 \draw[->, very thick]
     (school)
-    to[bend right] node[link] {department}
+    to[bend right] node[arrow] {department}
     (department);
 \draw[->]
     (department)
-    to[bend right] node[link] {school}
+    to[bend right] node[arrow] {school}
     (school);
 \draw[->]
     (department)
-    to[bend right] node[link] {course}
+    to[bend right] node[arrow] {course}
     (course);
 \draw[->]
     (course)
-    to[bend right] node[link] {department}
+    to[bend right] node[arrow] {department}
     (department);
 \draw[->]
     (program)
-    edge[loop, min distance=2cm, in=-35, out=35] node[link] {part\_of}
+    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[link] {program\_via\_part\_of}
+    edge[loop, min distance=6cm, in=-60, out=60] node[arrow] {program\_via\_part\_of}
     (program);
 
 \draw[->]
     (department)
-    to[bend left] node[link] {code}
+    to[bend left] node[arrow] {code}
     (string);
 \draw[->, very thick]
     (department)
-    to node[link] {name}
+    to node[arrow] {name}
     (string);
 \draw[->]
     (department)
-    to[bend right] node[link, below, rotate=180] {school\_code}
+    to[bend right] node[arrow, below, rotate=180] {school\_code}
     (string);
 
-\node[unit] (unit info) [below=2 of school] {};
-\node[entity] (entity info) [below=1ex of unit info] {};
-\node[value] (value info) [below=1ex of entity info] {};
-\node[label] (unit label) [right=.5em of unit info]
-    {unit class};
-\node[label] (entity label) [right=.5em of entity info]
-    {entity class};
-\node[label] (value label) [right=.5em of value info]
-    {value class};
+\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 info) (entity info) (value info)
-             (unit label) (entity label) (value label)] {};
+        [fit=(unit node) (class node) (domain node)
+             (unit legend) (class legend) (domain legend)] {};
 \end{pgfonlayer}
 
 \end{tikzpicture}

File doc/dia/singular-links.tex

 \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},
+    > = stealth', shorten > = 1pt, shorten < = 1pt,
+    node distance = 0.1cm,
+    class node/.style = {fill=black!10, circle, minimum size=3cm},
+    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
+                                          inner sep=.5pt,
+                                          text depth=.25ex, text height=1.5ex}},
+    node header/.style = {font=\itshape},
+    arrow/.style = {single arrow, fill=black!5, minimum height=3cm,
+                    minimum width=2.5cm, single arrow head extend=.1cm,
+                    single arrow tip angle=120},
+    arrow header/.style = {font=\ttfamily},
+    brace/.style = {decorate, decoration={brace, amplitude=8pt, raise=1.5cm},
                     draw=blue!50},
-    brace header/.style = {below=10pt, font=\itshape\color{blue!75}}
+    brace header/.style = {below=1.75cm, 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$};
+\node[class node] (program) {};
+\node[arrow] (program to school) [right=of program] {};
+\node[class node] (school) [right=of program to school] {};
+\node[arrow] (school to department) [right=of school] {};
+\node[class node] (department) [right=of school to department] {};
 
-\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) $);
+\node[node header] at (program.north) [above]
+    {program};
+\node[arrow header] at (program to school.north) [above]
+    {school};
+\node[node header] at (school.north) [above]
+    {school};
+\node[arrow header] at (school to department.north) [above]
+    {department};
+\node[node header] at (department.north) [above]
+    {department};
 
+\node[node content] at (program)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (gee) {{[eng.gee]}}; \\
+    \node (uelec) {{[eng.uelec]}}; \\
+    \node (pmth) {{[ns.pmth]}}; \\
+    \node (gmth) {{[ns.gmth]}}; \\
+    \node (umth) {{[ns.umth]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
-\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) $);
+\node[node content] at (school)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (eng) {{[eng]}}; \\
+    \node (ns) {{[ns]}}; \\
+    \node (sc) {{[sc]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
-\coordinate (north in)
-    at ($ (string) +(20pt,9pt) $);
-\coordinate (old in)
-    at ($ (string) +(20pt,-2pt) $);
-\coordinate (south in)
-    at ($ (string) +(20pt,-13pt) $);
+\node[node content] at (department)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (ee) {{[ee]}}; \\
+    \node (comp) {{[comp]}}; \\
+    \node (chem) {{[chem]}}; \\
+    \node (career) {{[career]}}; \\
+    \node (astro) {{[astro]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
 \draw[->]
-    (eng 1 out) to node[link, above=0.5cm] {department} (be in);
+    (gee.east) to (eng.west);
 \draw[->]
-    (eng 1 out) to (ee in);
+    (uelec.east) to (eng.west);
 \draw[->]
-    (eng 1 out) to (me in);
+    (pmth.east) to (ns.west);
 \draw[->]
-    (la 1 out) to (hist in);
+    (gmth.east) to (ns.west);
 \draw[->]
-    (la 1 out) to (psych in);
-\draw[->]
-    (ns 1 out) to (chem in);
+    (umth.east) to (ns.west);
 
 \draw[->]
-    (eng 2 out) to node[link, above=0.5cm] {campus} (north in);
+    (eng.east) to (ee.west);
 \draw[->]
-    (la 2 out) to (old in);
+    (eng.east) to (comp.west);
 \draw[->]
-    (ns 2 out) to (old in);
+    (ns.east) to (chem.west);
+\draw[->]
+    (ns.east) to (astro.west);
 
 \draw[brace]
-    ($ (department.south) -(5pt,0) $)
+    (school.west)
+    -- node[brace header] {a singular link}
+    (program.east);
+\draw[brace]
+    (department.west)
     -- 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) $);
+    (school.east);
 
 \end{tikzpicture}
 

File doc/dia/total-links.tex

 \begin{document}
 
 \tikzset{
-    > = stealth',
-    node distance = 0.5cm and 2cm,
-    entity/.style = {fill=black!10, circle,
-                     text width=2cm, 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},
+    > = stealth', shorten > = 1pt, shorten < = 1pt,
+    node distance = 0.1cm,
+    domain node/.style = {fill=black!10, rectangle, minimum size=3cm},
+    class node/.style = {fill=black!10, circle, minimum size=3cm},
+    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
+                                          inner sep=.5pt,
+                                          text depth=.25ex, text height=1.5ex}},
+    node header/.style = {font=\itshape},
+    arrow/.style = {single arrow, fill=black!5, minimum height=3cm,
+                    minimum width=2.5cm, single arrow head extend=.1cm,
+                    single arrow tip angle=120},
+    arrow header/.style = {font=\ttfamily},
+    brace/.style = {decorate, decoration={brace, amplitude=8pt, raise=1.5cm},
                     draw=blue!50},
-    brace header/.style = {below=10pt, font=\itshape\color{blue!75}}
+    brace header/.style = {below=1.75cm, font=\itshape\color{blue!75}}
 }
 
 \begin{tikzpicture}
 
-\node[entity, label=above:school] (school)
-    {$\vdots$ \\ {[eng]} \\ {[la]} \\ {[ns]} \\ $\vdots$};
-\node[entity, label=above:program] (program) [right=of school]
-    {$\vdots$ \\ {[eng.gee]} \\ {[eng.uelec]} \\ {[la.uhist]} \\
-     {[ns.pmth]} \\ {[ns.gmth]} \\ {[ns.umth]} \\ $\vdots$};
+\node[class node] (program) {};
+\node[arrow] (program to school) [right=of program] {};
+\node[class node] (school) [right=of program to school] {};
+\node[arrow] (school to string) [right=of school] {};
+\node[domain node] (string) [right=of school to string] {};
 
-\coordinate (eng in)
-    at ($ (school) +(15pt,9pt) $);
-\coordinate (la in)
-    at ($ (school) +(15pt,-2pt) $);
-\coordinate (ns in)
-    at ($ (school) +(15pt,-13pt) $);
+\node[node header] at (program.north) [above]
+    {program};
+\node[arrow header] at (program to school.north) [above]
+    {school};
+\node[node header] at (school.north) [above]
+    {school};
+\node[arrow header] at (school to string.north) [above]
+    {campus};
+\node[node header] at (string.north) [above]
+    {string};
 
-\coordinate (gee 1 out)
-    at ($ (program) +(-30pt,26pt) $);
-\coordinate (uelec 1 out)
-    at ($ (program) +(-30pt,15pt) $);
-\coordinate (uhist 1 out)
-    at ($ (program) +(-30pt,4pt) $);
-\coordinate (pmth 1 out)
-    at ($ (program) +(-25pt,-8pt) $);
-\coordinate (gmth 1 out)
-    at ($ (program) +(-25pt,-19pt) $);
-\coordinate (umth 1 out)
-    at ($ (program) +(-25pt,-30pt) $);
-\coordinate (gee 2 out)
-    at ($ (program) +(30pt,26pt) $);
-\coordinate (uelec 2 out)
-    at ($ (program) +(30pt,15pt) $);
-\coordinate (uhist 2 out)
-    at ($ (program) +(30pt,4pt) $);
-\coordinate (pmth 2 out)
-    at ($ (program) +(25pt,-8pt) $);
-\coordinate (gmth 2 out)
-    at ($ (program) +(25pt,-19pt) $);
-\coordinate (umth 2 out)
-    at ($ (program) +(25pt,-30pt) $);
+\node[node content] at (program)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (gee) {{[eng.gee]}}; \\
+    \node (uelec) {{[eng.uelec]}}; \\
+    \node (pmth) {{[ns.pmth]}}; \\
+    \node (gmth) {{[ns.gmth]}}; \\
+    \node (umth) {{[ns.umth]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
+
+\node[node content] at (school)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (eng) {{[eng]}}; \\
+    \node (ns) {{[ns]}}; \\
+    \node (sc) {{[sc]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
+
+\node[node content] at (string)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (north) {'north'}; \\
+    \node (old) {'old'}; \\
+    \node (south) {'south'}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
 \draw[->]
-    (gee 1 out) to node[link, above=0.5cm] {school} (eng in);
+    (gee.east) to (eng.west);
 \draw[->]
-    (uelec 1 out) to (eng in);
+    (uelec.east) to (eng.west);
 \draw[->]
-    (uhist 1 out) to (la in);
+    (pmth.east) to (ns.west);
 \draw[->]
-    (pmth 1 out) to (ns in);
+    (gmth.east) to (ns.west);
 \draw[->]
-    (gmth 1 out) to (ns in);
+    (umth.east) to (ns.west);
+
 \draw[->]
-    (umth 1 out) to (ns in);
-
-\draw[->, bend right=90, looseness=15]
-    (uelec 2 out) to (gee 2 out);
-\draw[->, bend right=90, looseness=15]
-    (gmth 2 out) to (pmth 2 out);
-\draw[->, bend right=90, looseness=15]
-    (umth 2 out) to (gmth 2 out);
+    (eng.east) to (north.west);
+\draw[->]
+    (ns.east) to (old.west);
 
 \draw[brace]
-    ($ (program.south) -(5pt,0) $)
+    (school.west)
     -- node[brace header] {a total link}
-    ($ (school.south) +(5pt,0) $);
+    (program.east);
 \draw[brace]
-    ($ (program.north east) +(35pt,0) $)
-    -- node[brace header, sloped, above=10pt] {a partial link}
-    ($ (program.south east) +(35pt,0) $);
+    (string.west)
+    -- node[brace header] {a partial attribute}
+    (school.east);
 
 \end{tikzpicture}
 

File doc/dia/unique-links.tex

 \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=4.5cm, minimum size=4cm,
-                    text centered, font=\small\ttfamily},
-    link/.style = {font=\ttfamily, above},
-    brace/.style = {decorate, decoration={brace,amplitude=8pt,raise=4pt},
+    > = stealth', shorten > = 1pt, shorten < = 1pt,
+    node distance = 0.1cm,
+    domain node/.style = {fill=black!10, rectangle, minimum size=3cm,
+                          text width=4cm},
+    class node/.style = {fill=black!10, circle, minimum size=3cm},
+    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
+                                          inner sep=.5pt,
+                                          text depth=.25ex, text height=1.5ex}},
+    node header/.style = {font=\itshape},
+    arrow/.style = {single arrow, fill=black!5, minimum height=3cm,
+                    minimum width=2.5cm, single arrow head extend=.1cm,
+                    single arrow tip angle=120},
+    arrow header/.style = {font=\ttfamily},
+    brace/.style = {decorate, decoration={brace, amplitude=8pt, raise=1.5cm},
                     draw=blue!50},
-    brace header/.style = {below=10pt, font=\itshape\color{blue!75}}
+    brace header/.style = {below=1.75cm, font=\itshape\color{blue!75}}
 }
 
 \begin{tikzpicture}
 
-\node[entity, label=above:school] (school)
-    {$\vdots$ \\ {[eng]} \\ {[la]} \\ {[ns]} \\ $\vdots$};
-\node[entity, label=above:department] (department) [left=of school]
-    {$\vdots$ \\ {[be]} \\ {[ee]} \\ {[me]} \\
-     {[hist]} \\ {[psych]} \\ {[chem]} \\ $\vdots$};
-\node[value, label=above:name] (name) [left=of department]
-    {$\vdots$ \\
-     {'Bioengineering'} \\ {'Electrical Engineering'} \\ {'Mechanical Engineering'} \\
-     {'History'} \\ {'Psychology'} \\ {'Chemistry'} \\ $\vdots$};
+\node[domain node] (string) {};
+\node[arrow, shape border rotate=180] (department to string) [right=of string] {};
+\node[class node] (department) [right=of department to string] {};
+\node[arrow] (department to school) [right=of department] {};
+\node[class node] (school) [right=of department to school] {};
 
-\coordinate (eng in)
-    at ($ (school) +(-15pt,9pt) $);
-\coordinate (la in)
-    at ($ (school) +(-15pt,-2pt) $);
-\coordinate (ns in)
-    at ($ (school) +(-15pt,-13pt) $);
+\node[node header] at (string.north) [above]
+    {string};
+\node[arrow header] at (department to string.north) [above]
+    {name};
+\node[node header] at (department.north) [above]
+    {department};
+\node[arrow header] at (department to school.north) [above]
+    {school};
+\node[node header] at (school.north) [above]
+    {school};
 
-\coordinate (be 1 out)
-    at ($ (department) +(15pt,26pt) $);
-\coordinate (ee 1 out)
-    at ($ (department) +(15pt,15pt) $);
-\coordinate (me 1 out)
-    at ($ (department) +(15pt,4pt) $);
-\coordinate (hist 1 out)
-    at ($ (department) +(20pt,-8pt) $);
-\coordinate (psych 1 out)
-    at ($ (department) +(20pt,-19pt) $);
-\coordinate (chem 1 out)
-    at ($ (department) +(20pt,-30pt) $);
-\coordinate (be 2 out)
-    at ($ (department) +(-15pt,26pt) $);
-\coordinate (ee 2 out)
-    at ($ (department) +(-15pt,15pt) $);
-\coordinate (me 2 out)
-    at ($ (department) +(-15pt,4pt) $);
-\coordinate (hist 2 out)
-    at ($ (department) +(-20pt,-8pt) $);
-\coordinate (psych 2 out)
-    at ($ (department) +(-20pt,-19pt) $);
-\coordinate (chem 2 out)
-    at ($ (department) +(-20pt,-30pt) $);
+\node[node content] at (string)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (ee name) {'Electrical Engineering'}; \\
+    \node (comp name) {'Computer Science'}; \\
+    \node (chem name) {'Chemistry'}; \\
+    \node (career name) {'Career Development'}; \\
+    \node (astro name) {'Astronomy'}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
-\coordinate (be name)
-    at ($ (name) +(50pt,26pt) $);
-\coordinate (ee name)
-    at ($ (name) +(60pt,15pt) $);
-\coordinate (me name)
-    at ($ (name) +(60pt,4pt) $);
-\coordinate (hist name)
-    at ($ (name) +(35pt,-8pt) $);
-\coordinate (psych name)
-    at ($ (name) +(35pt,-19pt) $);
-\coordinate (chem name)
-    at ($ (name) +(35pt,-30pt) $);
+\node[node content] at (department)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (ee) {{[ee]}}; \\
+    \node (comp) {{[comp]}}; \\
+    \node (chem) {{[chem]}}; \\
+    \node (career) {{[career]}}; \\
+    \node (astro) {{[astro]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
+
+\node[node content] at (school)
+{
+    \node[text height=2.5ex] {\vdots}; \\
+    \node (eng) {{[eng]}}; \\
+    \node (ns) {{[ns]}}; \\
+    \node (sc) {{[sc]}}; \\
+    \node[text height=2.5ex] {\vdots}; \\
+};
 
 \draw[->]
-    (be 1 out) to (eng in);
+    (ee.west) to (ee name.east);
 \draw[->]
-    (ee 1 out) to (eng in);
+    (comp.west) to (comp name.east);
 \draw[->]
-    (me 1 out) to (eng in);
+    (chem.west) to (chem name.east);
 \draw[->]
-    (hist 1 out) to (la in);
+    (career.west) to (career name.east);
 \draw[->]
-    (psych 1 out) to (la in);
-\draw[->]
-    (chem 1 out) to (ns in);
+    (astro.west) to (astro name.east);
 
 \draw[->]
-    (be 2 out) to (be name);
+    (ee.east) to (eng.west);
 \draw[->]
-    (ee 2 out) to (ee name);
+    (comp.east) to (eng.west);
 \draw[->]
-    (me 2 out) to (me name);
+    (chem.east) to (ns.west);
 \draw[->]
-    (hist 2 out) to (hist name);
-\draw[->]
-    (psych 2 out) to (psych name);
-\draw[->]
-    (chem 2 out) to (chem name);
+    (astro.east) to (ns.west);
 
 \draw[brace]
-    ($ (school.south) -(5pt,0) $)
+    (department.west)
+    -- node[brace header] {a unique attribute}
+    (string.east);
+\draw[brace]
+    (school.west)
     -- node[brace header] {a non-unique link}
-    ($ (department.south) +(5pt,0) $);
-\draw[brace]
-    ($ (department.south) -(5pt,0) $)
-    -- node[brace header] {a unique link}
-    ($ (name.south) +(5pt,0) $);
+    (department.east);
 
 \end{tikzpicture}
 

File doc/ref/model.rst

    :align: center
 
 
-Classes and Links
-=================
+Model Graph
+===========
 
-HTSQL represents a database model in form of a directed graph; the nodes
-of the graph are called *classes* and the arcs are called *links*.
+HTSQL represents a database model as a directed graph, or a collection
+of nodes connected by arrows.
 
-We distinguish several types of classes:
+A model graph may contain several types of nodes:
 
-* A *value class* represents a scalar data type such as `boolean`,
-  `integer`, `string`, `date`.
-* An *entity class* represents a collection of homogeneous entities
-  modeled by the database.  For instance, a student enrollment database
-  may contain entity classes such as `school`, `program`, `department`,
-  `course`.
-* Each database model contains one instance of a *unit class*.  It
+* A *domain* node represents a scalar data type such as boolean,
+  integer, string, date.
+* A *class* node represents a collection of homogeneous business
+  entities.  For instance, a student enrollment database may contain
+  classes for school, program, department, and course entities.
+* Each model graph contains one instance of a *unit* node.  The unit
   serves as an origin node when we construct paths in the model graph.
 
-A link represents a relationship between two classes.
+Arrows in the model graph are categorized by the type of nodes they
+connect:
 
-* Each entity class has a link from the unit class.  This link
-  represents the set of all entities from the class.
-* A link connecting an entity class to a value class represents an
-  entity attribute.
-* A link between two entity classes denotes a relation between the
-  respective entities.
+* There is exactly one arrow connecting the unit node to each class
+  node.  We call it a *class* arrow.  It represents the set of all
+  entities of the target class.
+* An arrow connecting a class node to a domain node is called an
+  *attribute* arrow and represents an entity attribute.
+* An arrow between two class nodes denotes a relationship between
+  entities of the respective classes and is called a *link* arrow.
 
-Each link has a name, which must be unique among all links sharing the
-same origin class.  We use a dot-separated sequence of link names to
-identify a path in the model graph that starts at the unit class.
-Thus ``school.department.name`` identifies a path with three links:
-``school`` connecting the unit class to an entity class, ``department``
-connecting two entity classes and ``name`` connecting an entity class to
-a value class.
+Each arrow has a *name*.  The arrow name must be unique among all arrows
+with the same origin node.
 
-We will routinely use the dotted notation to refer to the last link or
-the target class in the path.  For example, we write ``school`` to
-indicate the `school` class, ``department.name`` to indicate link
-``name`` from `department` class to `string` class.
-
-The following diagram shows a fragment of the model graph for our
-student enrollment database (most of the value classes and attribute
-links are omitted for clarity).
+The following diagram shows a fragment of the model graph for the
+student enrollment database (most of the domain nodes and attribute
+arrows are omitted for clarity).
 
 .. diagram:: ../dia/sample-model.tex
    :align: center
 
-The marked path on the diagram represents the query:
+A *navigation* in the model graph is a path, or a sequence of arrows,
+where the first arrow starts at the unit node and the target of each
+arrow coincides with the origin of the next arrow.  We denote a
+navigation using arrow names separated by a period (``.``).  For
+example, in the diagram above, the selected navigation is denoted by
+``school.department.name``.
+
+A navigation expresses a respective HTSQL query:
 
 .. htsql:: /school.department.name
    :cut: 3
 
+.. note::
 
-Entities and Relations
-======================
+   We will routinely use the navigational notation to refer to various
+   components of the model graph.  Since there is a one-to-one
+   correspondence between class arrows and class nodes, we can use the
+   arrow name to refer to the target class; for example, we say "class
+   ``school``" referring to the target of the class arrow called
+   ``school``.  In the same manner, we will often say "link
+   ``school.department``" or "attribute ``department.name``" referring
+   to the last component of the navigation.
 
-As we focus from the database model to a specific instance, classes
-are populated with values and entities, and each link splits into
-connections between individual class elements.
 
-A value class is populated with all values of the respective type.
-Thus, `boolean` class acquires two values: ``true`` and ``false``,
-`integer` class is filled with all integer numbers, and so on.
+Instances
+=========
 
-An entity class becomes a set of homogeneous business entities; e.g.
-`school` class becomes a set of university schools, `department` a set
-of departments, etc.
+As we focus from the database model to a specific instance, nodes
+are populated with values and entities, and each arrow splits into
+connections between individual node elements.
 
-In HTSQL, individual entities are not observable, only entity attributes
-are.  When we need to refer to a specific entity in writing, we use the
-value of some entity attribute that can uniquely identify it, enclosed
-in brackets.  For example, attribute `school.code` uniquely identifies
-`school` entities, therefore we may say that ``[eng]``, ``[la]``,
-``[ns]`` are respectively entities representing schools of
-*Engineering*, of *Arts and Humanities*, and of *Natural Sciences*.
+A domain node is populated with all values of the respective type.
+Thus, boolean domain acquires two values: ``true`` and ``false``,
+integer domain is filled with all integer numbers, and so on.
 
-The unit class contains a single value, which is called *unit*
+A class node becomes a set of entities of the respective class; e.g.
+``school`` class becomes a set of university schools, ``department`` a
+set of departments, etc.
+
+The unit node contains a single value, which is called a *unit*
 and denoted by ``@``.
 
 .. diagram:: ../dia/sample-instance-1.tex
    :align: center
 
-A link between two classes splits into a binary relation between
-elements of these classes:
+.. note::
 
-* A link from the unit class to an entity class connects the unit
-  to every entity in the entity class.
-* A link between two entity classes connects each entity of the
-  origin class to all related entities from the target class.
-* A link from an entity class to a value class connects each
+   In HTSQL, we can only observe entity attributes, but not the entities
+   themselves.  When we need to refer to a specific entity in writing,
+   we enclose in brackets the value of an entity attribute which
+   uniquely identifies the entity.  For example, attribute
+   ``school.code`` uniquely identifies ``school`` entities, therefore we
+   may say that ``[eng]``, ``[ns]``, ``[sc]`` are respectively entities
+   representing schools of *Engineering*, of *Natural Sciences*, and
+   of *Continuing Studies*.
+
+An arrow between two nodes splits into a binary relation between
+elements of these nodes:
+
+* An arrow from the unit node to a class node connects the unit
+  to every entity in the target class.
+* An arrow between two class nodes connects each entity of the
+  origin class to all related entities in the target class.
+* An arrow from a class node to a domain node connects each
   entity with the respective attribute value.
 
-The following diagram demonstrates how the path
-``school.department.name`` looks for some specific database instance.
+The following diagram visualizes the navigation
+``school.department.name`` on a specific database instance.
 
 .. diagram:: ../dia/sample-instance-2.tex
    :align: center
 
 
-Link Constraints
-================
+Arrow Constraints
+=================
 
-Links may enforce constraints on connections between elements.  We
+Arrows may enforce constraints on connections between elements.  We
 recognize the following constraints: singularity, totality and
 uniqueness.
 
-Note that links constraints are defined on the database model
-and applied to all instances of the model.
+Note that arrow constraints are defined on the database model and
+applied to all instances of the model.
 
-Singular and Plural Links
--------------------------
+Singular and Plural Arrows
+--------------------------
 
-A link is called *singular* if any element of the origin class is
-connected to no more than one element of the target class.  Otherwise,
-the link is called *plural*.
+An arrow is called *singular* if any element of the origin node is
+connected to no more than one element of the target node.  Otherwise,
+the arrow is called *plural*.
 
-* All attribute links are singular.
-* Any link from the unit class to an entity class is plural.
-* A link between two entity classes may be singular or plural.  For
-  example, link ``department.school`` is singular because each
-  department may be associated with just one school, but the *reverse*
-  link ``school.department`` is plural since a school may include more
-  than one department.
+* All attribute arrows are singular.
+* All class arrows are plural.
+* A link arrow, which connects two class nodes, may be singular or
+  plural.  For example, link ``department.school`` is singular because
+  each department may be associated with just one school, but the
+  *reverse* link ``school.department`` is plural since a school may
+  include more than one department.
 
-The following diagram visualises a singular link ``school.campus`` and
-a plural link ``school.department``.
+The following diagram visualises a singular link ``program.school``
+and a plural link ``school.department``.
 
 .. diagram:: ../dia/singular-links.tex
    :align: center
 
-Total and Partial Links
------------------------
+Total and Partial Arrows
+------------------------
 
-A link is called *total* if each element of the origin class is
-connected to at least one element of the target class.  Otherwise, the
-link is called *partial*.
+An arrow is called *total* if each element of the origin node is
+connected to at least one element of the target node.  Otherwise, the
+arrow is called *partial*.
 
-For example, we require every program to be associated with some school,
-so link `program.school` is total.  At the same time, not every program
-is a part of another program, therefore link `program.part_of` is
-partial.
+* A class arrow is always partial.  It represents the fact that in some
+  database instances the class may contain no entities.
+* Links and attributes could be total or partial.  For example,
+  attribute ``school.name`` is total since each school must have a name,
+  but attribute ``school.campus`` is partial since some schools do not
+  belong to any campus.
+
+The following diagram shows a total link ``program.school`` and a
+partial attribute ``school.campus``.
 
 .. diagram:: ../dia/total-links.tex
    :align: center
 
-Unique and Non-unique Links
----------------------------
+Unique and Non-unique Arrows
+----------------------------
 
-A link is called *unique* if any element of the target class is
-connected to no more than one element of the origin class.  Otherwise,
-the link is *non-unique*.
+An arrow is called *unique* if any element of the target node is
+connected to no more than one element of the origin node.  Otherwise,
+the arrow is *non-unique*.
 
-Attribute `department.name` is unique since different department
-entities must have different names, but link `department.school` is
-non-unique as different departments are allowed to be associated with
-the same school.
+* A class arrow is non-unique since the class may contain more than one
+  entity.
+* Links and attributes could be unique and non-unique.  For example,
+  attribute ``school.name`` is unique since we require that each school
+  has a distinct name, but attribute ``school.campus`` is non-unique
+  since several schools may share the same campus.
+
+The following diagram shows a unique attribute ``department.name`` and a
+non-unique link ``department.school``.
 
 .. diagram:: ../dia/unique-links.tex
    :align: center
 is translated to HTSQL data model.
 
 For the most part, translation of relational structure to HTSQL model is
-straightforward.  SQL data types become value classes, SQL tables become
-entity classes, table columns become class attributes.  Links between
-entity classes are inferred from FOREIGN KEY constraints.
+straightforward.  SQL data types become domain nodes, SQL tables become
+class nodes, table columns become attributes.  Links between classes are
+inferred from FOREIGN KEY constraints.
 
 HTSQL allows the administrator to restrict access to specific tables and
-columns, configure additional database constraints, and rename link
-names.  In the following sections we describe how HTSQL describes
-database model in the absence of any configuration.
+columns, configure additional database constraints, and rename links.
+Here we describe how HTSQL creates a database model from the given SQL
+database in the absence of any configuration.
 
 A name in HTSQL is a sequence of letters, digits and ``_`` characters
-which doesn't start with a digit.  When an HTSQL name is generated from
+which does not start with a digit.  When an HTSQL name is generated from
 a SQL name which contains non-alphanumeric characters, those are
 replaced with an underscore (``_``).
 
-Entity Names
-------------
+Classes
+-------
 
-Each SQL table induces an entity class, which, in general, borrows its
+Each SQL table induces a class node, which, in general, borrows its
 name from the table.
 
-Some SQL database servers support a notion of *schemas*, namespaces for
-tables, which may cause a naming conflict when two or more different
-schemas have tables with the same name.  This conflict is resolved as
+Some SQL database servers support a notion of *schemas*, or collections
+of tables.  Tables in the same schema must have unique names, but two or
+more tables in different schemas may share the same name, in which case
+HTSQL cannot use the name directly.  This naming conflict is resolved as
 follows:
 
 * If one of the schemas is marked as "default" for the purposes of name
   resolution, the name of the respective table is borrowed unadorned.
-* For the remaining tables, the assigned name has the form
+* For the remaining tables, the assigned HTSQL name has the form
   ``<schema>_<name>``.
 
-Attribute Names
----------------
+Attributes
+----------
 
-Each table column induces an entity attribute with the same name.
+Each table column induces a class attribute with the same name.
 
-When the column is a ``FOREIGN KEY`` constraint, the column name is also
-used to refer to the respective entity link.  The usage is determined
-from the context; compare
+When the column has a ``FOREIGN KEY`` constraint, the column name is
+also used to refer to the respective link.  In this case, whether the
+name refers to an attribute or a link is determined from context;
+compare
 
 .. htsql:: /department.school_code
    :cut: 3
 .. htsql:: /department.school_code.*
    :cut: 3
 
-Entity Links
-------------
+Links
+-----
 
 Each ``FOREIGN KEY`` constraint generates two links between respective
-entity classes, one in the direction of the constraint, called
-*direct*, and the other in the opposite direction, called *reverse*.
+class nodes, one in the direction of the constraint, called *direct*,
+and the other in the opposite direction, called *reverse*.
 
 The names of the links are synthesized from the names of the tables and
 names of the columns which form the constraint.  If the name of the
 referring column ends with the name of the referred column (e.g.
-``department.school_code`` and ``school.code``), we call the beginning
-of the referring column a *prefix* (in this case, ``school``).
+``department.school_code`` refers to ``school.code``), we call the
+beginning of the referring column a *prefix* (in this case, ``school``).
+The prefix is stripped from any underscore characters.
 
 The link names are generated according to the following rules.  The
-adopted name is the first one which doesn't conflict with other link
-names with the same origin class.
+adopted name is the first one which doesn't conflict with other arrows
+with the same origin class.
 
 1. When the link is direct and the prefix exists, use the prefix.
-2. Use the name of the target table.  In case there are more than one
+2. Use the name of the target table.  When there are more than one
    link to the same target, prefer the one for which the referring
    column is a primary key.
 3. If the link is reverse and the prefix exists, use the name of the
 4. If the link is reverse, use the name of the form
    ``<target>_via_<column>``.
 
-Link Constraints
-----------------
+Constraints
+-----------
 
 Column constraints are trivially translated to properties of the
-respective attribute links.
+respective attribute arrows.
 
-* A ``NOT NULL`` constraint on a column means, in HTSQL term, that the
+* A ``NOT NULL`` constraint on a column means, in HTSQL terms, that the
   respective attribute is total.
 * A ``UNIQUE`` constraint indicates that the attribute is unique.
 * A ``PRIMARY KEY`` constraint indicates that the attribute is both
   total and unique.  The columns that form a primary key are also used
-  for default ordering on the entity class.
+  for default ordering on the class.
 * A direct link induced by a ``FOREIGN KEY`` constraint is always
   singular.  The reverse link is plural in general, but could be
   singular when the key column is ``UNIQUE``.
     );
 
 In this schema, four tables ``ad.school``, ``ad.department``,
-``ad.program``, ``ad.course`` generate four entity classes:
+``ad.program``, ``ad.course`` generate four classes:
 
 .. htsql:: /school
    :cut: 3