In food processor combine onion, garlic, sweet potato and walnuts. Process until finely chopped and uniform consistency. Add cooked rice and lentils and process once more, scraping down the sides as needed. Transfer mixture to a large bowl and add ketchup or tomato paste, mustard, flax meal, salt, cayenne (or black pepper), and stir well.