Final answer:
Emperor Justinian I was the ruler who codified Roman law, built Hagia Sophia, and reclaimed most of the territory of the Roman Empire.
Step-by-step explanation:
The Emperor who codified Roman law, built Hagia Sophia, and reclaimed most of the territory of the Roman Empire was Emperor Justinian I.
Learn more about Emperor Justinian I