Question: What was Ancient Egypt;s former dynasty called?
Paraphrase: What was called Ancient Egypt;s ancient dynasty?
SPARQL (Wikidata):  select distinct ?sbj where { ?sbj wdt:P17 wd:Q11768 . ?sbj wdt:P31 wd:Q164950 } 
Answer: Ptolemaic dynasty, Ahmosiden