A cathedral is the official seat of the local the bishop and the Sagrada Familia isn't one.
A basilica on the other hand is an honorific title granted to some churches by the pope for historical/religious reasons.
An interesting note: Saint Peter in Rome, the most famous church in the christian world is not a cathedral itself as it is not where the pope has its seat, that's actually another basilica in Rome, Saint John Lateran, which makes it the most important church in the catholic hierarchy with the title of "Omnium Urbis et Orbis Ecclesiarum Mater et Caput", or "Mother and leader of all the churches in the world".
The Dedication of the Basilica of St John Lateran is one of the observances in the Catholic liturgical calendar with its own special mass readings that supplant the normally scheduled readings for the day (most of the liturgical calendar consists of dates relative to the start of Advent which happens on the fourth Sunday before Christmas). If I remember correctly, this is one of the feasts considered important enough to supplant the normal Sunday readings if it happens on a Sunday. (Also, worth noting that it’s one of the feasts celebrated in both the Latin and Eastern churches.)
The other interesting thing about that is the cathedral seat of the Pope is outside the Vatican City - so it is in his religious territory as Bishop of Rome but not in his secular state.
It belongs to the Holy See, but it's outside of Vatican City. It's kind of like how Guernsey is owned by the British Crown, but it's not part of Britain.
I'm not 100% of all legalese technicalities but I know for a fact vatican law applies there and it's managed and guarded by vatican's gendarmerie (my ex went to the university behind the basilica which is also part of the Holy See).
They are like foreign embassies, part of Italy but under ownership of Holy See. The Holy See is different than Vatican City. The Vatican City is independent country governed by the Holy See, the head of the Catholic Church.
It's been not in Rome only since Vatican City came into existence in 1929. It's been in Rome every single year before then.
Saint John Lateran is also not in Italy [1] due to an extraterritoriality treaty in 1929, part of the same treaty that established Vatican City. By the way, that church is exactly 1700 years old this year.
A basilica on the other hand is an honorific title granted to some churches by the pope for historical/religious reasons.
An interesting note: Saint Peter in Rome, the most famous church in the christian world is not a cathedral itself as it is not where the pope has its seat, that's actually another basilica in Rome, Saint John Lateran, which makes it the most important church in the catholic hierarchy with the title of "Omnium Urbis et Orbis Ecclesiarum Mater et Caput", or "Mother and leader of all the churches in the world".