How many {basin country} are to/by {Azerbaijan} ?
Azerbaijan has how many basin countries?
How many basin countries are there in Azerbaijan?
SELECT ( COUNT ( ?g ) AS ?y ) { ?g property:basin_country resource:Azerbaijan }
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/P205> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q227 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P205 wd:Q227 }
52