How many {shares border with} are to/by {Duisburg} ?
Duisburg borders what country?
What country shares a border with Duisburg?
SELECT ( COUNT ( ?y ) AS ?a ) { ?y property:shares_border_with resource:Duisburg }
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/P47> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q2100 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P47 wd:Q2100 }
9