Question: In which country the city of Madrid is located ?
Paraphrase: In which nation the city of Madrid is found ?
SPARQL (Wikidata):  select distinct ?obj where { wd:Q2807 wdt:P17 ?obj . ?obj wdt:P31 wd:Q3624078 } 
Answer: Spain