Jq is xpath, this looks to be xquery. In fact it specifically works as an xquery embed.
def avg: add / length;
group_by(.url) | map({
"url": .[0].url,
"hits": length,
"avg": map(.response_time) | avg
})
so jq should be (at least roughly) as powerful as JSONiq.But we have a function: https://github.com/sirixdb/brackit