Human: Why is it called the Hagia Sophia? Assistant: 
The Hagia Sophia is the Greek name for the Church of the Holy Wisdom. The church was originally built in 360 AD as a church dedicated to the Virgin Mary, but it was later converted into a mosque by the Byzantine Emperor, Justinian I. In 537 AD, the church was converted back into a Christian church and renamed as the Church of the Holy Wisdom.