On the rationality of period integrals and special value formulas in the compact case