what is the {start time} for {Lithuania} has {flag image} as {Flag of Lithuania 1918-1940.png} ?
What year did Lithuania have this flag?
In which year Lithuania  has the following flag ?
SELECT ?r WHERE { resource:Lithuania property:flag_image ?v . ?v property:start_time ?r . ?v property:flag_image ?h . FILTER ( CONTAINS ( ?h , 'Flag of Lithuania 1918-1940.png' ) ) }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q37> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P41> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <Flag of Lithuania 1918-1940.png> .
?statement <http://www.wikidata.org/entity/P580> ?value. 
} 

SELECT ?value WHERE { wd:Q37 p:P41 ?s . ?s ps:P41 ?x filter(contains(?x , 'Flag of Lithuania 1918-1940.png')) . ?s pq:P580 ?value}