How many {spouse} are to/by {Chongzhen Emperor} ?
The Chongzhen Emperor is married to how many people?
How many wives does the Chongzhen Emperor have?
SELECT ( COUNT ( ?r ) AS ?q ) { ?r property:spouse resource:Chongzhen_Emperor }
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/P26> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q10069 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P26 wd:Q10069 }
4