We give a representation of the fractional integral for symmetric Markovian semigroups as the projection of martingale transforms and prove the Hardy-Littlewood-Sobolev(HLS) inequality based on this representation. The proof rests on a new inequality for a fractional Littlewood–Paley $g$-function.