Use sort in index
Render queries as Jinja templates and conditionally enable SPARQL services
Move queries into templates and use regular render_template