How many {source of energy} are to/by {natural gas} ?
There are how many natural gas energy sources?
How many sources of energy are natural gas?
SELECT ( COUNT ( ?j ) AS ?l ) { ?j property:source_of_energy resource:natural_gas }
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/P618> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q40858 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P618 wd:Q40858 }
35