How many {allegiance} are to/by {West Germany} ?
Give me the number of allegiances west germany has
how many allegiances does west germany have?
SELECT ( COUNT ( ?y ) AS ?j ) { ?y property:allegiance resource:West_Germany }
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/P945> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q713750 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P945 wd:Q713750 }
21