How many {afflicts} are to/by {lung} ?
There are how many lung afflictions?
How many lung afflictions exist?
SELECT ( COUNT ( ?n ) AS ?g ) { ?n property:afflicts resource:lung }
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/P689> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q7886 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P689 wd:Q7886 }
15