{%for h in base.header %} PREFIX {{h.prefix}}: <{{h.ns}}> {%endfor%} SELECT DISTINCT ?resource WHERE { {%if base.args.arg0 %}GRAPH <{{base.args.arg0}}>{ {%endif%} [] a ?resource . {%if base.args.arg0 %} } {%endif%} }