SocialRatingManager.GetRatings can give you all Ratings for an Url or for a User.
See MSDN article How to: Create and Retrieve a Social Rating for more info for more info on how to work with ratings programatically
To get all ratings for a single library you can use code like this:
using System;
using Microsoft.Office.Server.SocialData;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
namespace SharePointConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var url = "http://sp2010/TestDocs";
using (var site = new SPSite(url))
{
var sc = SPServiceContext.GetContext(site);
var sm = new SocialRatingManager(sc);
using (var web = site.OpenWeb())
{
var list = web.GetList(url);
foreach (SPListItem item in list.Items)
{
foreach (var rating in sm.GetRatings(new Uri(SPUrlUtility.CombineUrl(site.MakeFullUrl(web.ServerRelativeUrl), item.Url))))
{
Console.WriteLine("{0} rated {1} to {2}", rating.Owner.DisplayName, rating.Url, rating.Rating);
}
}
}
}
}
}
}