Please see:

S. A. Fulling, R. C. King, B. G. Wybourne, and C. J. Cummins,
Normal forms for tensor polynomials. I,
Classical and Quantum Gravity 9 (1992), 11511198.

S. A. Fulling, C. J. Cummins, R. C. King, and B. G. Wybourne,
Grouptheoretical classification of polynomial
functions of the Riemann tensor,
in Classical and Quantum Systems  Foundations and Symmetries,
ed. by H. D. Doebner, W. Scherer, and F. Schroeck
[proceedings of the Second International Wigner Symposium,
Goslar, Germany, 1991],
World Scientific, Singapore, 1993, pp. 362365.