What is {topic of} of {history of Wales}, that has {has cities} is {Caerphilly County Borough} ?
What subject of the history of Ridges has cities like Caerphilly District Borough as central areas?
What topic of the history of Wales has cities like Caerphilly County Borough as central areas?
SELECT ?a WHERE { ?a property:contains_administrative_territorial_entity resource:Caerphilly_County_Borough . resource:history_of_Wales property:facet_of ?a }
SELECT ?answer WHERE { ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1063608> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1269>. ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?answer . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?answer. ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P150> . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q748065> . }
SELECT ?answer WHERE { wd:Q1063608 wdt:P1269 ?answer . ?answer wdt:P150 wd:Q748065}