Solutions of the Knizhnik-Zamolodchikov equation with rational isospins and the reduction to the minimal models