How many {contributed to published work} are to/by {ABC} ?
ABC has how many contributions to published work?
How many contributions to published work by ABC?
SELECT ( COUNT ( ?h ) AS ?g ) { ?h property:contributed_to_creative_work resource:ABC }
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/P3919> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q287076 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P3919 wd:Q287076 }
24