What is {position held} of {Robert Peel} that is {end time} is {1841-8-30} ?
What was Robert Peel's job on August 30, 1841?
What position did Robert Peel hold on 1841-08-30?
SELECT ?z WHERE { ?i property:end_time ?s . ?i property:position_held ?z . resource:Robert_Peel property:position_held ?i . FILTER ( CONTAINS ( YEAR ( ?s ) , '1841' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q181875> .
?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> <1841-8-30>
} 

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