How many {set in period} are to/by {Heian period} ?
The Heian period took place in what time period?
What time period was the Heian period set in?
SELECT ( COUNT ( ?f ) AS ?k ) { ?f property:set_in_period resource:Heian_period }
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/P2408> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q193292 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P2408 wd:Q193292 }
5