How many {basic form of government} are to/by {confederation} ?
Democracies formed how many confederations?
How many confederations are formed of democracies?
SELECT ( COUNT ( ?l ) AS ?n ) { ?l property:basic_form_of_government resource:confederation }
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/P122> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q170156 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P122 wd:Q170156 }
11