In what role did David the Second of Scotland, replace Robert the First of Scotland?
SELECT ?obj WHERE { wd:Q187312 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q239486 }
robert i of scotland: Q187312 david ii of scotland: Q239486