How many {terminus} are to/by {Beijing} ?
Give me the terminus of Beijing.
What's the terminus of Beijing?
SELECT ( COUNT ( ?v ) AS ?l ) { ?v property:terminus resource:Beijing }
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/P559> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q956 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P559 wd:Q956 }
6