How many {shares border with} are to/by {Wiesbaden} ?
What makes up the borders of Wiesbaden?
How many share borders are with the {Wiesbaden} ?
SELECT ( COUNT ( ?r ) AS ?z ) { ?r property:shares_border_with resource:Wiesbaden }
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/Q1721 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P47 wd:Q1721 }
5