Tree-to-Tree Queries
Process nested structures (JSON, Tensors) as input, produce nested structures as result.
An Expressive Data-Centric Query Language
Query nested data, produce nested data as result
A Rhyme query is compiled through an intermediate representation (IR) that makes data dependencies explicit, optimized, and finally translated to efficient JavaScript (or C).
// share of total population, per country
{
data.*A.country:
sum(data.*A.population) /
sum(data.*B.population)
}t0 ??= {}
t1 ??= {}
t2 ??= 0
for (let xB in data) {
t2 += data[xB].population
}
for (let xA in data) {
t1[data[xA].country] ??= 0
t1[data[xA].country] += data[xA].population
t0[data[xA].country] = t1[data[xA].country] / t2
}
return t0