What is {replaces} of {Kingdom of Great Britain} that is {applies to part} is {Wales} ?
Where is Wales in relation to Great Britain?
What is replaces  of  Kingdom of Great Britain that applies to part is Wales?
SELECT ?b WHERE { ?m property:applies_to_part resource:Wales . resource:Great_Britain property:replaces ?m . ?m property:replaces ?b }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q161885> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1365> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P518> <http://wikidata.dbpedia.org/resource/Q25>
} 

SELECT ?obj WHERE { wd:Q161885 p:P1365 ?s . ?s ps:P1365 ?obj . ?s pq:P518 wd:Q25 }