Original: It was built upon the mosque, which in turn had been raised in place of the former Visigothic cathedral.
Simplified: The mosque had been built where the former Visigothic cathedral had stood.