{% extends "templates/base.tpl" %} {% block title %}Library{% endblock %} {% set data = query(""" PREFIX library: PREFIX license: CONSTRUCT { ?item library:title ?title; library:author ?author ; library:license ?license . ?license license:id ?license_id ; license:name ?license_name . } WHERE { ?item library:title ?title ; library:author ?author ; library:license ?license . OPTIONAL { ?license license:id ?license_id_optional ; license:name ?license_name_optional . } BIND(COALESCE(?license_id_optional, SUBSTR(STR(?license), 14)) AS ?license_id) BIND(COALESCE(?license_name_optional, SUBSTR(STR(?license), 14)) AS ?license_name) } ORDER BY UCASE(?title) """, { '@context': { 'library': 'dokk:library:', 'license': 'dokk:license:', 'library:author': { '@container': '@set' }, 'library:license': { '@container': '@set' } }, 'library:title': {} }) %} {% block body %}
The library is also available via OPDS. Add this link to your OPDS client: https://dokk.org/library/opds.xml


{% for item in data["@graph"]|sort(attribute="library:title") %}

{{ item['library:title'] }}
Authors: {% for author in item["library:author"]|sort() %} {{ author }} {% endfor%}
License: {% for license in item["library:license"]|sort(attribute="license:id") %} {{ license['license:id'] }} {% endfor%}



{% endfor %}
{% endblock %}