diff --git a/daapinterface.py b/daapinterface.py index 3757399..cf5bc1f 100644 --- a/daapinterface.py +++ b/daapinterface.py @@ -41,8 +41,8 @@ def home(): SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1; wdt:P87 ?dateadded. - ?work p:P30 ?statement. - ?statement ps:P30 ?image; + ?work p:P90 ?statement. + ?statement ps:P90 ?image; pq:P54 wd:Q90. ?work wdt:P13 ?date. FILTER(?work != wd:Q57) @@ -73,8 +73,8 @@ def browsethearchive(): SELECT ?work ?workLabel ?image ?date WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1. - OPTIONAL { ?work p:P30 ?statement. - ?statement ps:P30 ?image; + OPTIONAL { ?work p:P90 ?statement. + ?statement ps:P90 ?image; pq:P54 wd:Q90.} OPTIONAL { ?work wdt:P13 ?date. } FILTER(?work != wd:Q57) @@ -163,8 +163,8 @@ def selfpublishedindex(): SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1; wdt:P10 wd:Q71. - OPTIONAL {?work p:P30 ?statement. - ?statement ps:P30 ?image; + OPTIONAL {?work p:P90 ?statement. + ?statement ps:P90 ?image; pq:P54 wd:Q90.} OPTIONAL { ?work wdt:P13 ?date. } FILTER(?work != wd:Q57) @@ -183,8 +183,8 @@ def zinesindex(): SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1; wdt:P10 wd:Q71. - OPTIONAL {?work p:P30 ?statement. - ?statement ps:P30 ?image; + OPTIONAL {?work p:P90 ?statement. + ?statement ps:P90 ?image; pq:P54 wd:Q90.} OPTIONAL { ?work wdt:P13 ?date. } FILTER(?work != wd:Q57) @@ -224,9 +224,9 @@ def artwork(): WHERE { VALUES ?work {wd:'''+artwork_id+'''} - ?work wdt:P30 ?image. - OPTIONAL { ?work p:P30 ?statement2. - ?statement2 ps:P30 ?image; + ?work wdt:P90 ?image. + OPTIONAL { ?work p:P90 ?statement2. + ?statement2 ps:P90 ?image; pq:P54 ?depicts; pq:P56 ?license.} SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} @@ -239,9 +239,9 @@ def artwork(): # WHERE # { # VALUES ?work {wd:'''+artwork_id+'''} - # ?work wdt:P30 ?image. - # OPTIONAL { ?work p:P30 ?statement2. - # ?statement2 ps:P30 ?image; + # ?work wdt:P90 ?image. + # OPTIONAL { ?work p:P90 ?statement2. + # ?statement2 ps:P90 ?image; # pq:P54 ?depicts; # pq:P56 ?license.} # FILTER(?depicts != wd:Q1897) @@ -466,7 +466,7 @@ def artwork(): VALUES ?work {wd:'''+artwork_id+'''} ?work wdt:P43 ?copiesCollections. ?copiesCollections wdt:P47 ?collection. - OPTIONAL { ?collection wdt:P30 ?image. } + OPTIONAL { ?collection wdt:P90 ?image. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ''') sparql.setReturnFormat(JSON) @@ -487,7 +487,7 @@ def artwork(): GROUP BY ?relatedWorks ?relatedWorksLabel ORDER BY ?relatedWorksLabel } - OPTIONAL {?relatedWorks wdt:P30 ?image.} + OPTIONAL {?relatedWorks wdt:P90 ?image.} } ''') sparql.setReturnFormat(JSON) relatedworks = sparql.query().convert() @@ -500,7 +500,7 @@ def artwork(): VALUES ?work {wd:'''+artwork_id+'''} ?work wdt:P45 ?list. OPTIONAL {?list wdt:P13 ?date.} - OPTIONAL {?list wdt:P30 ?image.} + OPTIONAL {?list wdt:P90 ?image.} SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} } ''') @@ -543,7 +543,7 @@ def person(): SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1. ?work wdt:P9 wd:'''+person_id+'''. - OPTIONAL { ?work wdt:P30 ?image. } + OPTIONAL { ?work wdt:P90 ?image. } OPTIONAL { ?work wdt:P13 ?date. } FILTER(?work != wd:Q57) } @@ -558,7 +558,7 @@ def person(): SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?work wdt:P1 wd:Q1. ?work wdt:P10 wd:'''+person_id+'''. - OPTIONAL { ?work wdt:P30 ?image. } + OPTIONAL { ?work wdt:P90 ?image. } OPTIONAL { ?work wdt:P13 ?date. } FILTER(?work != wd:Q57) } diff --git a/templates/artwork.html b/templates/artwork.html index 0a8fa4c..c7d319f 100644 --- a/templates/artwork.html +++ b/templates/artwork.html @@ -49,7 +49,7 @@ {% else %} - {% for x in artworkimages['results']['bindings'] |reverse %} + {% for x in artworkimages['results']['bindings'] %}
{% if "image" in x %} @@ -95,21 +95,21 @@ {% if 'DownloadDigitalFacsimile' in x %}
- Download digital facsimile + Download digital facsimile
{% endif %} {% if 'DigitalFacsimileExternalLink' in x %}
- External digital facsimile link + External digital facsimile link
{% endif %} {% if 'DigitalFacsimileExternalLink2' in x %}
- External digital facsimile link 2 + External digital facsimile link 2
{% endif %} @@ -134,21 +134,21 @@ {% if 'VideoFile' in x %}
- Video + Video
{% endif %} {% if 'AudioFile' in x %}
- Audio + Audio
{% endif %} {% if 'ImageFile' in x %}
- Image + Image
{% endif %} @@ -267,10 +267,13 @@ +

DESCRIPTION

+ {% if artworkdescriptiondata['results']['bindings']==[] %} +

information not available

{% else %} -

DESCRIPTION

+ {% for x in artworkdescriptiondata['results']['bindings'] %} @@ -309,11 +312,12 @@ +

EXHIBITION AND DISTRIBUTION HISTORY

{% if artworkexhibitiondata['results']['bindings']==[] %} +

information not available

{% else %} -

EXHIBITION AND DISTRIBUTION HISTORY

{% for x in artworkexhibitiondata['results']['bindings'] %}
@@ -362,37 +366,6 @@
- -
-
LISTS
- - {% if artworklists['results']['bindings']==[] %} -

The artwork isn't featured in any lists yet

- {% else %} -

This artwork is featured in the following lists:

- {% for x in artworklists['results']['bindings'] %} -
-
- {% if "image" in x %} - - {% else %} - - {% endif %} -
-
- {% if "listLabel" in x %} - {{ x['listLabel']['value'] }} - {% endif %} -
-
- placeholder for number of artworks in list -
- -
- {% endfor %} - {% endif %} -
- @@ -460,6 +433,36 @@
+ + +
+
LISTS
+ + {% if artworklists['results']['bindings']==[] %} + {% else %} + + {% for x in artworklists['results']['bindings'] %} +
+
+ {% if "image" in x %} + + {% else %} + + {% endif %} +
+
+ {% if "listLabel" in x %} + {{ x['listLabel']['value'] }} + {% endif %} +
+ +
+ {% endfor %} + {% endif %} +
+ + + diff --git a/templates/home.html b/templates/home.html index a0ef0ce..567d79a 100644 --- a/templates/home.html +++ b/templates/home.html @@ -34,7 +34,7 @@ - Explore Data Visualization + Explore Data Visualization