Riemman metric tensor plays a significant role in deducing basic formulas and equations arising in differential geometry and (pseudo-)Riemannian manifolds. It is a fundamental problem to develop general computational theories for polynomials involving Riemman metric tensor and its differential forms. This paper solves the problem by extending Gr\"obner basis theory and the previous work on the computational theory for indexed differentials.
An L-expansion of an elementary indexed Riemann metric tensor monomial is defined. Then
a decomposed form of the Gr\"obner basis of defining syzygies of the polynomial ring is presented, based on a partition of elementary indexed monomials. Meanwhile, the upper bound of
the dummy index numbers of sim-monomials of the elements in each disjoint elementary indexed monomial subset is found. Finally, a DST-fundamental restricted ring is constructed,
and the canonical form of a polynomial is confirmed to be
the normal form with respect to the Gr\"obner basis in the DST-fundamental restricted ring.