Question: What position did Gregory IX hold when he was replaced by Ottaviano di Paoli?
SPARQL (Wikidata): SELECT ?obj WHERE { wd:Q124831 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q1227365 }