How many {color} are for {tennis ball} ?
Which is the number of colors that there are for tennis ball?
How many colors of tennis ball are there?
SELECT ( COUNT ( ?m ) AS ?b ) { resource:tennis_ball property:color ?m }
SELECT (COUNT(?obj) AS ?objs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q246514> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P462> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
} 

SELECT (COUNT(?obj) AS ?value ) { wd:Q246514 wdt:P462 ?obj }
5