resource.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. {% if t[1] not in blacklist %}
  42. <tr>
  43. <!--
  44. <td>
  45. <a href="{{ t[0] }}">
  46. {{ t[0].n3(namespace_manager=nsm) }}
  47. </a>
  48. </td>
  49. -->
  50. <td>
  51. <a href="{{ t[1] }}">
  52. {{ t[1].n3(namespace_manager=nsm) }}
  53. </a>
  54. </td>
  55. <td>
  56. {% if 'Literal' in t[2].__class__.__name__ %}
  57. "{{ t[2] }}"
  58. {% if t[2].datatype %}
  59. <span class="label label-primary">{{ t[2].datatype.n3(namespace_manager=nsm) }}</span>
  60. {% endif %}
  61. {% else %}
  62. <a href="{{ t[2] }}">
  63. {{ t[2].n3(namespace_manager=nsm) }}
  64. </a>
  65. {% endif %}
  66. </td>
  67. </tr>
  68. {% endif %}
  69. {% endfor %}
  70. </tbody>
  71. </table>
  72. {% endblock %}