<metal:table define-macro="table">
  <tal:def 
    tal:define="data data | python:view.test_query().get('data', {})" >
  <table class="sparql-results"
    tal:condition="data">
    <thead>
      <tr>
        <th tal:repeat="name data/var_names"
            tal:content="name"/>
      </tr>
    </thead>
    <tbody>
      <tr tal:repeat="row python: data['rows'][:10]" tal:attributes="class string:row_${repeat/row/index}">
        <td tal:repeat="value row"
            tal:content="value/n3|string:&quot;${value}&quot;"/>
      </tr>
    </tbody>
  </table>
  <p tal:condition="not:data" style="color:red">
      No results were found.
  </p>
  </tal:def>
</metal:table>
