How many {spouse} are to/by {Abu Bakr} ?
Provide the number of spouses that Abu Bakr has or has had.
Abu Bakr has how many spouses?
SELECT ( COUNT ( ?o ) AS ?h ) { ?o property:spouse resource:Abu_Bakr }
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/Q334923 .
} 

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