The electronic structure of rare-earth oxides in the creation of the core hole