Rinse the rice well in cool water.
Drain well and set aside.
Bring the stock to a gentle boil in a medium-size saucepan, then reduce to a simmer.
Heat the 2 tablespoons olive oil in a large, heavy pot over medium-high heat.
Add the onions and cook, stirring, until just soft, 1 to 2 minutes.
Add the rice and cook, stirring constantly, until the grains are opaque, about 4 minutes.
Add the stock and salt to taste.
Stir gently until the liquid comes to a boil. Cover tightly, reduce the heat to low, and cook until all the liquid is absorbed, about 20 minutes. Remove from heat and let stand for about 15 minutes before stirring.
Transfer the rice to a large bowl and gently stir to cool, breaking up any lumps with a wooden spoon.
Add the lemon juice and toss gently to mix. Cover with a clean towel and let cool.
When ready to serve, add the capers, tomatoes, parsley, basil, garlic and extra-virgin alive oil.
Toss gently to mix.
Season with the black pepper or crushed red pepper flakes.
Serve at room temperature.