What is {head of government} of {Tbilisi} that is {end time} is {2004-4-19} ?
When did Tbilisi end his government?
did Tbilisi ended his government in 2004-4-19?
SELECT ?o WHERE { ?n property:head_of_government ?o . resource:Tbilisi property:head_of_government ?n . FILTER ( CONTAINS ( YEAR ( ?s ) , '2004' ) ) . ?n property:end_time ?s }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q994> .
?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> <2004-4-19>
} 

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