How many {discoverer or inventor} are to/by {Joseph-Louis Lagrange} ?
Joseph-Louis Lagrange made how many discoveries?
How many discoveries are by Joseph-Louis Lagrange?
SELECT ( COUNT ( ?f ) AS ?c ) { ?f property:discoverer_or_inventor resource:Joseph-Louis_Lagrange }
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/P61> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q80222 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P61 wd:Q80222 }
4