What is {head of government} of {Romania} that is {start time} is {1865-1-26} ?
Who was the head of the Romanian Government on January 26th, 1865?
Who became the head of government of Romania on 26th of January 1865
SELECT ?m WHERE { resource:Romania property:head_of_government ?w . ?w property:head_of_government ?m . ?w property:start_time ?g . FILTER ( CONTAINS ( YEAR ( ?g ) , '1865' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q218> .
?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/P580> <1865-1-26>
} 

SELECT ?obj WHERE { wd:Q218 p:P6 ?s . ?s ps:P6 ?obj . ?s pq:P580 ?x filter(contains(YEAR(?x),'1865')) }