SAN FRANCISCO — A federal judge has ruled that a merger of two social-­commerce companies is likely to stifle competition in the field of online ratings and reviews.

U.S. District Judge William Orrick III on Jan. 9 sided with the government that Bazaarvoice Inc.’s purchase in 2012 of its main rival PowerReviews LLC is likely to inhibit competition in the field of online ratings and reviews.