How many {affiliation} are to/by {PBS} ?
PBS has how many affiliations?
How many affiliations does PBS have?
SELECT ( COUNT ( ?r ) AS ?m ) { ?r property:affiliation resource:PBS }
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/P1416> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q215616 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P1416 wd:Q215616 }
45