Sor’s sonata now known as op. 22 must have been composed by Sor in some form in Spain in or before 1808, because it bears the heading in its Paris edition of 1825: “Grand[e] Sonate de Sor, qui fut dédiée au prince de la Paix”, and the “Prince de la Paix” was Manuel Godoy, Prime Minister of Spain and virtual ruler of that country in the last years before the Napoleonic invasion, who fell from power in 1808. But as yet we have no early source for the sonata, and the Paris 1825 edition remains at present our earliest known source.
This edition comes from the new 2020 second edition of Sor’s New Complete Works for Guitar edited by Brian Jeffery. The Introduction and Index to the entire series can be seen here on this site.