Place the ricotta in the centre of a piece of muslin or a new J-cloth and bring up the edges to form a bag. Twist hard to extract as much of the moisture as possible from the ricotta.
Place the ricotta in a bowl with the parmesan, egg yolks, basil, nutmeg and flour. Season with black pepper and mix until well combined.
Cover a baking tray with a good layer of semolina. Take a spoonful of the ricotta mixture in your hands, shape it into a ball and then roll it in the semolina until it’s well coated. Repeat until you have finished the mixture, and have around 20 balls. Chill for an hour in the fridge.
Meanwhile, make the tomato sauce. Heat the olive oil in a large pan and fry the onion over a gentle heat for 8-10 minutes until soft, but not coloured, adding the garlic for the last 2 minutes. Add the tomatoes and a pinch of sugar and simmer gently for another 15 minutes until the tomatoes have reduced. Season and keep warm until the gnudi are ready.
To cook the gnudi, bring a large pan of salted water to the boil and poach them for 5 minutes, or until they rise to the top of the surface. You may have to do this in batches, depending on the size of the pan. Remove with a slotted spoon.
Serve with the tomato sauce spooned over the top and garnished with a few shavings of Italian style hard cheese.