what is the {replaced by} for {Abbas I of Persia} has {position held} as {Shah} ?
Who did Abbas I of Persia replace as Shah?
Who did Abbas I of Persia replace who held the position of Shah?
SELECT ?i WHERE { ?p property:replaced_by ?i . resource:Abbas_the_Great property:position_held ?p . ?p property:position_held resource:Shah }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q171349> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q184299> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q171349 p:P39 ?s . ?s ps:P39 wd:Q184299 . ?s pq:P1366 ?value}