Question: What is the historical Chinese state whose capital was Nanjing?
SPARQL (Wikidata):  select distinct ?obj where { wd:Q16666 wdt:P1376 ?obj . ?obj wdt:P31 wd:Q50068795 } 
Answer: Eastern Wu, Eastern Jin dynasty, Liang dynasty, Southern Song Dynasty, Southern Ming Dynasty, Wu guo, Southern Tang, Ming dynasty, Liu Song dynasty, Chen dynasty, Southern Qi