For query rewriting use kyrie

It's available there.
This shows how to use kyrie

I hope it works, but this is only an example to be removed when everything works properly. This is not a solution (it's really ugly) but an example.
merge with kyrie