How many {notable work} are to/by {The Simpsons} ?
Which notable works were done by The Simpsons?
How many notable works are done by the  {The Simpsons} ?
SELECT ( COUNT ( ?s ) AS ?w ) { ?s property:notable_work resource:The_Simpsons }
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/P800> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q886 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P800 wd:Q886 }
9