resource.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends 'base.html' %}
  2. {% block title %}{{ rsrc.identifier }}{% endblock %}
  3. {% block content %}
  4. <h2>Namespaces</h2>
  5. <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#nslist" aria-expanded="false" aria-controls="nsList">
  6. Expand/Collapse
  7. </button>
  8. <div class="collapse" id="nslist">
  9. <div class="card card-body">
  10. <table class="table table-striped">
  11. <thead>
  12. <tr>
  13. <td>Prefix</td>
  14. <td>URI</td>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. {% for ns in nsm.namespaces() | sort %}
  19. <tr>
  20. <td>{{ ns[0] }}</td>
  21. <td>{{ ns[1] }}</td>
  22. </tr>
  23. {% endfor %}
  24. </tbody>
  25. </table>
  26. </div>
  27. </div>
  28. <h2>Resource</h2>
  29. <table class="table table-striped">
  30. <thead>
  31. <tr>
  32. <!--
  33. <td>Subject</td>
  34. -->
  35. <td>Predicate</td>
  36. <td>Object</td>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. {% for t in rsrc.graph | sort %}
  41. <tr>
  42. <!--
  43. <td>
  44. <a href="{{ t[0] }}">
  45. {{ t[0].n3(namespace_manager=nsm) }}
  46. </a>
  47. </td>
  48. -->
  49. <td>
  50. <a href="{{ t[1] }}">
  51. {{ t[1].n3(namespace_manager=nsm) }}
  52. </a>
  53. </td>
  54. <td>
  55. {% if 'Literal' in t[2].__class__.__name__ %}
  56. "{{ t[2] }}"
  57. {% if t[2].datatype %}
  58. <span class="label label-primary">{{ t[2].datatype.n3(namespace_manager=nsm) }}</span>
  59. {% endif %}
  60. {% else %}
  61. <a href="{{ t[2] }}">
  62. {{ t[2].n3(namespace_manager=nsm) }}
  63. </a>
  64. {% endif %}
  65. </td>
  66. </tr>
  67. {% endfor %}
  68. </tbody>
  69. </table>
  70. {% endblock %}