How many {continent} are to/by {Africa} ?
What is the number of continents that border Africa?
How many continents are bordering Africa?
SELECT ( COUNT ( ?c ) AS ?k ) { ?c property:continent resource:Africa }
SELECT (COUNT(?sub) AS ?subs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?sub .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P30> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q15 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P30 wd:Q15 }
1262