Counts-of-counts similarity for prediction and search in relational data