What is {head of government} of {Niamey} that is {end time} is {1970-0-0} ?
Name the leader of Niamey until 1970
Who was he leader of Niamey until 1970?
SELECT ?q WHERE { ?w property:end_time ?u . ?w property:head_of_government ?q . resource:Niamey property:head_of_government ?w . FILTER ( CONTAINS ( YEAR ( ?u ) , '1970' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q3674> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P6> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1970-0-0>
} 

SELECT ?obj WHERE { wd:Q3674 p:P6 ?s . ?s ps:P6 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1970')) }