How many {country} are to/by {Luxembourg} ?
Luxembourg is surrounded by how many countries?
How many countries are next to Luxembourg?
SELECT ( COUNT ( ?x ) AS ?g ) { ?x property:country resource:Luxembourg }
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/P17> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q32 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P17 wd:Q32 }
4970