How many {country} are to/by {Chile} ?
Name the countries that have boundaries with Chile.
How many countries are around Chile?
SELECT ( COUNT ( ?o ) AS ?h ) { ?o property:country resource:Chile }
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/Q298 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P17 wd:Q298 }
30443