Show more than just paintings on property page

This commit is contained in:
Edward Betts 2019-11-26 16:01:02 +00:00
parent c649179caf
commit 0ef6eced13
2 changed files with 7 additions and 2 deletions

5
app.py
View file

@ -163,7 +163,10 @@ def property_query_page(property_id):
sort = request.args.get('sort')
sort_by_name = sort and sort.lower().strip() == 'name'
q = render_template('query/property.sparql', pid=pid)
q = render_template('query/property.sparql',
pid=pid,
isa_list=isa_list)
rows = wdqs.run_query_with_cache(q, name=pid)
no_label_qid = [row['object']['value'].rpartition('/')[2]

View file

@ -1,5 +1,7 @@
select ?object ?objectLabel ?objectDescription (count(*) as ?count) {
?item wdt:P31 wd:Q3305213 .
values ?isa { {% for isa in isa_list %} wd:{{ isa }} {% endfor %} }
?item wdt:P31 ?isa .
?item wdt:P18 ?image .
?item wdt:{{ pid }} ?object .
optional {