How many {shares border with} are for {City of Cape Town} ?
Cape Town has how many borders?
How many border shares with the City of Cape Town?
SELECT ( COUNT ( ?v ) AS ?d ) { resource:City_of_Cape_Town property:shares_border_with ?v }
SELECT (COUNT(?obj) AS ?objs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1185115> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P47> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
} 

SELECT (COUNT(?obj) AS ?value ) { wd:Q1185115 wdt:P47 ?obj }
8