Shifting something in the x direction is done with the xshift
option. However, by default, points referencing nodes are not shifted. For that one needs transform canvas
:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,arrows}
\begin{document}
\begin{tikzpicture}
[node distance=0mm, text height=1.5ex, text depth=.25ex,
attribute/.style={rectangle,minimum size=8mm,very thin,draw=black!50,font=\ttfamily},
link/.style={thin, to path={-- ++(0,8mm) -| (\tikztotarget)}, >= triangle 45, shorten >= 0pt}]
\node (n1) [attribute] {\small NODE1};
\node (n2) [attribute, right=of n1] {\small NODE2};
\path (n1) edge [->, link,transform canvas={xshift=-3mm}](n2);
\path (n1) edge [->, link,transform canvas={xshift=3mm}] (n2);
\end{tikzpicture}
\end{document}

Adding a description to an edge is usually done with just a node {...}
after edge
. However, your link
style changes the to path
and so TikZ doesn't know anymore where to put nodes. Thus one has to change the to path
to include \tikztonodes
at the right place (see section 14.14 “The To Path Operation” in the (v2.10) manual). To get correct placement it is also necessary to slightly change the way the path is drawn:
to path={-- ++(0,8mm) -- ($(\tikztotarget)+(0,8mm)$) \tikztonodes -- (\tikztotarget)}
Now, one can just add nodes as usual. To avoid overlapping, it might be necessary to add additional shifts:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,arrows,calc}
\begin{document}
\begin{tikzpicture}
[node distance=0mm, text height=1.5ex, text depth=.25ex,
attribute/.style={rectangle,minimum size=8mm,very thin,draw=black!50,font=\ttfamily},
link/.style={thin, to path={-- ++(0,8mm) -- ($(\tikztotarget)+(0,8mm)$) \tikztonodes -- (\tikztotarget)}, >= triangle 45, shorten >= 0pt}]
\node (n1) [attribute] {\small NODE1};
\node (n2) [attribute, right=of n1] {\small NODE2};
\path (n1) edge [->, link,transform canvas={xshift=-3mm}] node[above,xshift=-1.5mm] {\small test} (n2);
\path (n1) edge [->, link,transform canvas={xshift=3mm}] node[above, xshift=1.5mm] {\small test 2} (n2);
\end{tikzpicture}
\end{document}

\documentclass
and the required packages etc., so that people can just copy&paste it to check if their solutions work properly and are able to provide example code and output. Especially TikZ code might require many libraries and it's not always clear which.