What is {chairperson} of {Social Democratic Party of Germany} that is {end time} is {2004-3-21} ?
In 2004-3-21, who was the chairperson of the Social Democratic Party of Germany?
Who was the chairperson for the Social Democratic Party of Germany in 2004-3-21?
SELECT ?r WHERE { resource:Social_Democratic_Party_of_Germany property:chairperson ?r . ?r property:chairperson ?r . FILTER ( CONTAINS ( YEAR ( ?i ) , '2004' ) ) . ?r property:end_time ?i }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q49768> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P488> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <2004-3-21>
} 

SELECT ?obj WHERE { wd:Q49768 p:P488 ?s . ?s ps:P488 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'2004')) }