  We propose and analyze a generalized two dimensional $XY$ model, whose
interaction potential has $n$ weighted wells, describing corresponding
symmetries of the system. As the lattice spacing vanishes, we derive by
$\Gamma$-convergence the discrete-to-continuum limit of this model. In the
energy regime we deal with, the asymptotic ground states exhibit fractional
vortices, connected by string defects. The $\Gamma$-limit takes into account
both contributions, through a renormalized energy, depending on the
configuration of fractional vortices, and a surface energy, proportional to the
length of the strings.
  Our model describes in a simple way several topological singularities arising
in Physics and Materials Science. Among them, disclinations and string defects
in liquid crystals, fractional vortices and domain walls in micromagnetics,
partial dislocations and stacking faults in crystal plasticity.
