How many {director of photography} are to/by {Man Ray} ?
How many directors of photography are there by Man Ray?
How many director of photography by Man Ray?
SELECT ( COUNT ( ?h ) AS ?p ) { ?h property:director_of_photography resource:Man_Ray }
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/P344> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q46139 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P344 wd:Q46139 }
5