China's consumer price index (CPI), a main gauge of inflation, edged up 0.3 percent year on year in May, official data showed.