home » zplus/dokk.org.git
Author zPlus <zplus@peers.community> 2024-12-14 10:27:59
Committer zPlus <zplus@peers.community> 2024-12-14 10:27:59
Commit 6e7fef1 (patch)
Tree 5fc754f
Parent(s)

Update Mimi&Eunice vocabulary. Mimi&Eunice vocabulary in the database has changed. Update queries and HTML templates with new vocabulary.


commits diff: 13e68e2..6e7fef1
3 files changed, 29 insertions, 25 deletionsdownload


Diffstat
-rwxr-xr-x app.py 30
-rw-r--r-- pages/mimi_and_eunice.html 8
-rw-r--r-- pages/templates/mimi_and_eunice/strip.tpl 16

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+17/-13 M   app.py
index d8dc38a..71ade47
old size: 12K - new size: 12K
@@ -391,29 +391,33 @@ def mimi_and_eunice_strip(number):
391 391 """
392 392 """
393 393
394 - iri = '<dokk:mimi_and_eunice:' + number + '>'
394 + iri = '<dokk:mimi_and_eunice_' + number + '>'
395 395
396 396 data = query(Template(
397 397 '''
398 - PREFIX license: <dokk:license:>
399 - PREFIX mimi_eunice: <dokk:mimi_and_eunice:>
398 + prefix blob: <dokk:vocab:blob:>
399 + prefix license: <dokk:vocab:license:>
400 + prefix comics: <dokk:vocab:comicstrip:>
400 401
401 - DESCRIBE $iri ?license
402 + DESCRIBE $iri ?license ?blob
402 403 WHERE {
403 - $iri mimi_eunice:license ?license
404 + $iri comics:license ?license;
405 + blob:at ?blob
404 406 }
405 407 ''').substitute(iri=iri),
406 408 {
407 409 '@context': {
408 - 'license': 'dokk:license:',
409 - 'mimi_eunice': 'dokk:mimi_and_eunice:',
410 - 'mimi_eunice:tag': { '@container': '@set' },
411 - 'mimi_eunice:transcript': { '@container': '@set' }
410 + 'blob': 'dokk:vocab:blob:',
411 + 'license': 'dokk:vocab:license:',
412 + 'comics': 'dokk:vocab:comicstrip:',
413 + 'comics:tag': { '@container': '@set' },
414 + 'comics:transcript': { '@container': '@set' }
415 + },
416 + 'comics:license': {},
417 + 'comics:transcript': {
418 + 'comics:order': {}
412 419 },
413 - 'mimi_eunice:license': {},
414 - 'mimi_eunice:transcript': {
415 - 'mimi_eunice:order': {}
416 - }
420 + 'blob:at': {}
417 421 })
418 422
419 423 return template('templates/mimi_and_eunice/strip.tpl', data=data['@graph'][0])

+4/-4 M   pages/mimi_and_eunice.html
index d8c19b8..7d401ed
old size: 689B - new size: 661B
@@ -1,13 +1,13 @@
1 1 {% extends "templates/base.tpl" %}
2 2
3 3 {% set data = query("""
4 - PREFIX mimi_eunice: <dokk:mimi_and_eunice:>
5 - PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
4 + prefix comics: <dokk:vocab:comicstrip:>
6 5
7 6 SELECT ?number ?title
8 7 WHERE {
9 - ?id mimi_eunice:title ?title .
10 - BIND (SUBSTR(STR(?id), 22) as ?number)
8 + [] comics:series <dokk:mimi_and_eunice>;
9 + comics:number ?number;
10 + comics:title ?title
11 11 }
12 12 ORDER BY ?number
13 13 """)

+8/-8 M   pages/templates/mimi_and_eunice/strip.tpl
index ce8d9c9..02fd374
old size: 1014B - new size: 952B
@@ -1,34 +1,34 @@
1 1 {% extends "templates/base.tpl" %}
2 2
3 - {% block title %}Mimi&Eunice {{ data['@id'][12:] }}: {{ data['mimi_eunice:title'] }}{% endblock %}
3 + {% block title %}Mimi&Eunice {{ data['comics:number'] }}: {{ data['comics:title'] }}{% endblock %}
4 4
5 5 {% block body %}
6 6
7 7 <div class="mimi_and_eunice_strip">
8 - <h1>{{ data['mimi_eunice:title'] }}</h1>
8 + <h1>{{ data['comics:title'] }}</h1>
9 9
10 10 <p>
11 - Published: {{ data['mimi_eunice:published'] }}
11 + Published: {{ data['comics:published'] }}
12 12 </p>
13 13 <p>
14 14 Liense:
15 - <a href="{{ url('license', id=data['mimi_eunice:license']['license:id']) }}">{{ data['mimi_eunice:license']['license:id'] }}</a>
15 + <a href="{{ url('license', id=data['comics:license']['license:id']) }}">{{ data['comics:license']['license:id'] }}</a>
16 16 </p>
17 17 <p>
18 18 Tags:
19 - {% for tag in data['mimi_eunice:tag']|sort %}
19 + {% for tag in data['comics:tag']|sort %}
20 20 {{ tag }}
21 21 {% endfor %}
22 22 </p>
23 23
24 - <img src="https://blob.dokk.org/images/mimi_and_eunice/{{ data['@id'][12:] }}.png" alt="" />
24 + <img src="https://blob.dokk.org/{{ data['blob:at']['@id'][8:] }}" alt="" />
25 25
26 26 <p>
27 27 Transcript
28 28
29 - {% for line in data['mimi_eunice:transcript']|sort(attribute='mimi_eunice:order.@value') %}
29 + {% for line in data['comics:transcript']|sort(attribute='comics:order.@value') %}
30 30 <div>
31 - <b>{{ line['mimi_eunice:character'] }}</b>: {{ line['mimi_eunice:text'] }}
31 + <b>{{ line['comics:character'] }}</b>: {{ line['comics:text'] }}
32 32 </div>
33 33 {% endfor %}
34 34 </p>