What is {position held} of {Julius Nyerere} that is {end time} is {1985-11-5} ?
Which position did Julius Nyerere held had ended in 1985?
Which position of Julius Nyerere was came to an end in the year 1985?
SELECT ?v WHERE { ?n property:position_held ?v . resource:Julius_Nyerere property:position_held ?n . FILTER ( CONTAINS ( YEAR ( ?x ) , '1985' ) ) . ?n property:end_time ?x }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q186525> .
?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> <1985-11-5>
} 

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