what is the {end time} for {Leo XIII} has {position held} as {nuncio} ?
Leo XIII's final year as nuncio was when?
When was Leo XIII's final year as nuncio?
SELECT ?b WHERE { resource:Leo_XIII property:position_held ?g . ?g property:position_held resource:nuncio . ?g property:end_time ?b }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q43922> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q157037> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q43922 p:P39 ?s . ?s ps:P39 wd:Q157037 . ?s pq:P582 ?value}