The Caliphate of Cordoba dates from 929 until 1031, during which time it extended over most of the Iberian Peninsula. The caliphs all came from the Umayyad dynasty. The flourishing Caliphate economy was largely based on trade and craftsmanship, while on a cultural level there was a great openness to the study of philosophy, mathematics and astronomy. During the Caliphate, the Great Mosque, now the Cathedral of the Immaculate Conception of the Blessed Virgin Mary, was built in Cordoba.