github.com/unigraph-dev/dgraph@v1.1.1-0.20200923154953-8b52b426f765/systest/21million/queries/query-047 (about)

     1  {
     2  	var(func:allofterms(name@en, "steven spielberg")) {
     3  		films as director.film {
     4  			p as count(starring)
     5  			q as count(genre)
     6  			r as count(country)
     7  			score as math(p + q + r)
     8  		}
     9  	}
    10  
    11  	TopMovies(func: uid(films), orderdesc: val(score), first: 5){
    12  		name@en
    13  		val(score)
    14  	}
    15  }
    16  ---
    17  {
    18    "TopMovies": [
    19      {
    20        "name@en": "Lincoln",
    21        "val(score)": 179
    22      },
    23      {
    24        "name@en": "Minority Report",
    25        "val(score)": 156
    26      },
    27      {
    28        "name@en": "Schindler's List",
    29        "val(score)": 145
    30      },
    31      {
    32        "name@en": "The Terminal",
    33        "val(score)": 118
    34      },
    35      {
    36        "name@en": "Saving Private Ryan",
    37        "val(score)": 99
    38      }
    39    ]
    40  }