  Levelness and nearly Gorensteinness are well-studied properties of graded
rings as a generalized notion of Gorensteinness. In this paper, we compare the
strength of these properties. For any Cohen-Macaulay homogeneous affine
semigroup ring R, we give a necessary condition for R to be non-Gorenstein and
nearly Gorenstein in terms of the h-vector of R and we show that if R is nearly
Gorenstein with Cohen-Macaulay type 2, then it is level. We also show that if
Cohen-Macaulay type is more than 2, there are 2-dimensional counterexamples.
Moreover, we characterize nearly Gorensteinness of Stanley-Reisner rings of
low-dimensional simplicial complexes.
