ARQ supports custom aggregate functions as allowed by the SPARQL 1.1 specification.
See example code.