In a large bowl combine flour, cocoa, powdered sugar and baking powder. Cut the butter into the mixture until it resembles crumbs. Add 1 egg yolk and sour cream. Fold the dough into a ball. Divide the dough into two halves. Flatten each half into 1-inch thick discs. Wrap each tightly in plastic wrap. Refrigerate for 1 hour.
In a medium bowl combine ricotta, sugar, remaining egg yolk and 1 tablespoon corn starch. In a small bowl combine cherries and remaking tablespoon of corn starch.
Preheat oven to 180°C. Line a square baking tin with parchment paper, letting the sides overhang.
Place one disc of the dough in a freezer for 15 minutes. Working on a floured surface roll out the other disc of the dough into 20cm in diameter. Place the dough into the prepared tin. Spoon the ricotta filling into the crust, topping with cherries. Take the remaining dough disc out from the freezer and grate it on top of the cake.
Bake for 45 minutes. Allow the pie to cool for 3 full hours at room temperature before cutting into bars. Enjoy!