How many {work location} are to/by {Bangkok} ?
Which is the number of work locations that are in Bangkok?
How many work locations are by Bangkok?
SELECT ( COUNT ( ?t ) AS ?y ) { ?t property:work_location resource:Bangkok }
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/P937> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q1861 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P937 wd:Q1861 }
11