what is the {replaced by} for {Jan Karol Chodkiewicz} has {position held} as {Great Hetman of Lithuania} ?
Which was the person who replaced Jan Karol Chodkiewicz as the Great Hetman of Lithuania?
Who replaced Jan Karol Chodkiewicz as the Great Hetman of Lithuania?
SELECT ?g WHERE { ?j property:replaced_by ?g . resource:Jan_Karol_Chodkiewicz property:position_held ?j . ?j property:position_held resource:Great_Hetman_of_Lithuania }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q540840> .
?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/Q4479783> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q540840 p:P39 ?s . ?s ps:P39 wd:Q4479783 . ?s pq:P1366 ?value}