What is {country} of {Thessaloniki} that is {start time} is {27-0-0} ?
In the year 27, what country was Thessaliniki in?
Which is country of Thessaloniki that of start time is 27-0-0?
SELECT ?z WHERE { FILTER ( CONTAINS ( ?e , '27-0-0' ) ) . ?f property:country ?z . resource:Thessaloniki property:country ?f . ?f property:start_time ?e }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q17151> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P17> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P580> <27-0-0>
} 

SELECT ?obj WHERE { wd:Q17151 p:P17 ?s . ?s ps:P17 ?obj . ?s pq:P580 ?x filter(contains(?x , '27-0-0')) }