what is the {end time} for {Cardinal Mazarin} has {position held} as {Bishop of Metz} ?
What was the duration Cardinal Mazarin served as Bishop of Metz?
For how long has Cardinal Mazarin been the Bishop of Metz
SELECT ?v WHERE { ?m property:position_held resource:Bishop_of_Metz . ?m property:end_time ?v . resource:Cardinal_Mazarin property:position_held ?m }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q166056> .
?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/Q15729481> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q166056 p:P39 ?s . ?s ps:P39 wd:Q15729481 . ?s pq:P582 ?value}