From 0ef6eced13d068db07332ceb42002ce8246b872b Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 26 Nov 2019 16:01:02 +0000 Subject: [PATCH] Show more than just paintings on property page --- app.py | 5 ++++- templates/query/property.sparql | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index c31f8bf..0da908b 100755 --- a/app.py +++ b/app.py @@ -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] diff --git a/templates/query/property.sparql b/templates/query/property.sparql index 3bb7254..e001c5f 100644 --- a/templates/query/property.sparql +++ b/templates/query/property.sparql @@ -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 {