What is {position held} of {José Gervasio Artigas} that is {end time} is {1817-1-20} ?
Which position did Jose Gervasio Artigas quit on January 20th, 1917?
What was José Gervasio Artigas position that ended on January 20th, 1917?
SELECT ?n WHERE { resource:José_Gervasio_Artigas property:position_held ?j . ?j property:position_held ?n . ?j property:end_time ?w . FILTER ( CONTAINS ( YEAR ( ?w ) , '1817' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q252847> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1817-1-20>
} 

SELECT ?obj WHERE { wd:Q252847 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1817')) }