what is the {end time} for {Stephen Báthory} has {position held} as {Kings of Poland} ?
In what year did Stephen Báthory stop being King of Poland?
When did Stephen Báthory end his reign as King of Poland?
SELECT ?d WHERE { ?j property:end_time ?d . resource:Stephen_Báthory property:position_held ?j . ?j property:position_held resource:king_of_Poland }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q54030> .
?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/Q3273712> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q54030 p:P39 ?s . ?s ps:P39 wd:Q3273712 . ?s pq:P582 ?value}