Transition metal ion directed supramolecular assembly of one- and two-dimensional polyrotaxanes incorporating cucurbituril.