How many {studied by} are to/by {logic} ?
The study of logic is for what area of learning?
What's the study of logic?
SELECT ( COUNT ( ?i ) AS ?w ) { ?i property:studied_by resource:logic }
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/P2579> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q8078 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P2579 wd:Q8078 }
23