What is {country of citizenship} of {Joseph Fourier} that is {end time} is {1815-3-20} ?
What country does Josheph Fourier live until 1815-3-20?
SELECT ?obj WHERE { wd:Q8772 p:P27 ?s . ?s ps:P27 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1815')) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q8772> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P27> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1815-3-20>
} 

Name the Residence country of Josheph Fourier until 1815-3-20?.