Question: Which country contains Sofia?
SPARQL (Wikidata):  select distinct ?sbj where { ?sbj wdt:P150 wd:Q472 . ?sbj wdt:P31 wd:Q6256 }