How many {candidate} are to/by {Bob Hawke} ?
What is the number of times that Bob Hawke has been a candidate?
How many times has Bob Hawke been a candidate
SELECT ( COUNT ( ?l ) AS ?e ) { ?l property:candidate resource:Bob_Hawke }
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/P726> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q269372 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P726 wd:Q269372 }
4