diff --git a/daapinterface.py b/daapinterface.py index bf8fd84..5c2a398 100644 --- a/daapinterface.py +++ b/daapinterface.py @@ -127,7 +127,6 @@ def artistsindex(): ''') sparql.setReturnFormat(JSON) results = sparql.query().convert() - print(results) return render_template('artistsindex.html', results=results) ######################### PUBLISHERS INDEX @@ -220,23 +219,8 @@ def artwork(): # Image(s) # query for later - # sparql.setQuery(''' - # SELECT ?image ?depictsLabel ?licenseLabel - # WHERE - # { - # VALUES ?work {wd:'''+artwork_id+'''} - # ?work wdt:P30 ?image. - # OPTIONAL { ?work p:P30 ?statement2. - # ?statement2 ps:P30 ?image; - # pq:P54 ?depicts; - # pq:P56 ?license.} - # SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} - # } - # ''') -# temp fix query - sparql.setQuery(''' - SELECT ?image ?depictsLabel ?licenseLabel + SELECT ?image ?depictsLabel ?licenseLabel WHERE { VALUES ?work {wd:'''+artwork_id+'''} @@ -245,12 +229,28 @@ def artwork(): ?statement2 ps:P30 ?image; pq:P54 ?depicts; pq:P56 ?license.} - FILTER(?depicts != wd:Q1897) SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} - }''') + } + ''') +# temp fix query + + # sparql.setQuery(''' + # SELECT ?image ?depictsLabel ?licenseLabel + # WHERE + # { + # VALUES ?work {wd:'''+artwork_id+'''} + # ?work wdt:P30 ?image. + # OPTIONAL { ?work p:P30 ?statement2. + # ?statement2 ps:P30 ?image; + # pq:P54 ?depicts; + # pq:P56 ?license.} + # FILTER(?depicts != wd:Q1897) + # SERVICE wikibase:label { bd:serviceParam wikibase:language "en".} + # }''') sparql.setReturnFormat(JSON) artworkimages = sparql.query().convert() + print(artworkimages) # Links and downloads sparql.setQuery(''' @@ -412,6 +412,7 @@ def artwork(): text="

Information not available

" x["text"] = text + print(artworkdescriptiondata) # exhibitions + id to be changed sparql.setQuery(''' diff --git a/templates/artwork.html b/templates/artwork.html index 67e8f14..6e60464 100644 --- a/templates/artwork.html +++ b/templates/artwork.html @@ -27,10 +27,10 @@
-
ABOUT THIS WORK
+
ABOUT THIS WORK
-
DETAILED RECORD
+
DETAILED RECORD
@@ -159,11 +159,11 @@ -
---> - + + +

CONTRIBUTORS

@@ -206,11 +206,11 @@ {% endif %} {% endfor %} {% endif %} - +
- +

PUBLISHERS

{% if artworkpublisher['results']['bindings']==[] %} @@ -232,14 +232,14 @@ {% endif %} -
+
- +
- +
@@ -248,31 +248,30 @@ {% else %} {% for x in artworkdescriptiondata['results']['bindings'] %} -
+

DESCRIPTION

-
+
{{ x["text"] | safe }}
-
- {% if "authordescriptionPageLabel" in x %} +

AUTHOR

+ {% if "authordescriptionPageLabel" in x %}

{{ x['authordescriptionPageLabel']['value'] }}

{% endif %} - {% if "sourcedescriptionPage" in x %}

SOURCE

+ {% if "sourcedescriptionPage" in x %}

{{ x["sourcedescriptionPage"]["value"]}}

{% endif %} - - {% if "datedescriptionPage" in x %}

DATE

+ {% if "datedescriptionPage" in x %}

{{ x["datedescriptionPage"]["value"] | replace("T00:00:00Z", "") }}

{% endif %} @@ -290,22 +289,29 @@ {% else %} {% for x in artworkexhibitiondata['results']['bindings'] %} -
+

EXHIBITION AND DISTRIBUTION HISTORY

-
+
{{ x['text'] | safe }}
-
+

AUTHOR

{% if "authorexhibitionHisPageLabel" in x %}

{{ x["authorexhibitionHisPageLabel"]["value"]}}

{% endif %} + {% if "authorexhibitionHisPageLabel" not in x %} +

information not available

+ {% endif %} +

SOURCE

+ {% if "sourceexhibitionHisPage" not in x %} +

information not available

+ {% endif %} {% if "sourceexhibitionHisPage" in x%}

{{ x["sourceexhibitionHisPage"]["value"]}}

{% endif %} @@ -322,8 +328,8 @@ {% endif %} - - + +