How many {mushroom ecological type} are to/by {parasitism} ?
What type of parasite is a mushroom ecological type?
What is the mushroom ecological type of a parasite?
SELECT ( COUNT ( ?i ) AS ?x ) { ?i property:mushroom_ecological_type resource:parasitism }
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/P788> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q186517 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P788 wd:Q186517 }
24