reteplayground
Aggregate

Mean age per diagnosis group

DiagnosisNMean Age
CONTROL13031.2615384615385
SCHZ5036.46
BIPOLAR4935.2857142857143
ADHD4333.093023255814
Run this query → no server · no download · no account
caviri.github.io/rete
Run this query in the playground → 4 rows · 7.0 ms · no server, no download — the query runs in your browser.

The query

PREFIX ncit: <http://ncitt.ncit.nih.gov/> SELECT ?diagnosis (COUNT(?s) AS ?n) (AVG(?age) AS ?meanAge) WHERE { ?s ncit:diagnosis ?diagnosis ; ncit:age ?age . } GROUP BY ?diagnosis ORDER BY DESC(?n)

rete playground · documentation · github.com/caviri/rete