I don’t see the problem here. I would map both to a single edge @dgraph(pred:"rating")
Then you could do something in DQL like
{
n(func: has(rating), orderdesc: rating, first: 10) @filter(type(Restaurants)) {
uid
rating
# other fields
}
}
Umm… I don’t think you understand the complexity here. You are talking about indexing two things that might be distributed across different servers, for starters.