Browse Source

last version artwork and daap

master
jules 4 years ago
parent
commit
f305e9259a
  1. 37
      daapinterface.py
  2. 50
      templates/artwork.html

37
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,21 +219,6 @@ 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
WHERE
@ -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="<p>Information not available</p>"
x["text"] = text
print(artworkdescriptiondata)
# exhibitions + id to be changed
sparql.setQuery('''

50
templates/artwork.html

@ -27,10 +27,10 @@
<!-- NAVIGATION HERE? -->
<div class="artwork-nav">
<div class="artwork-nav-label artwork-nav-label-about active">ABOUT THIS WORK</div>
<div class="artwork-nav-label active">ABOUT THIS WORK</div>
<!-- <div class="artwork-nav-label">RELATIONSHIPS</div> -->
<!-- <div class="artwork-nav-label">LISTS</div> -->
<div class="artwork-nav-label artwork-nav-label-record"><a class="det-record" target="_blank" href="https://daap.bannerrepeater.org/wiki/Item:{{ artwork_id }}">DETAILED RECORD</a></div>
<div class="artwork-nav-label"><a class="det-record" target="_blank" href="https://daap.bannerrepeater.org/wiki/Item:{{ artwork_id }}">DETAILED RECORD</a></div>
</div>
</div>
@ -159,11 +159,11 @@
<!-- end of other stuff like downloads, absent for now -->
<!-- RIGHT COLUMN
<!-- RIGHT COLUMN -->
<div class="artwork-rightcolumn">
-->
<!-- RIGHT TOP
<div class="artwork-rightcolumn-top"> -->
<!-- RIGHT TOP -->
<div class="artwork-rightcolumn-top">
<!-- contributors -->
<div class="artwork-rightcolumn-top-contributors">
<p class="label-item">CONTRIBUTORS</p>
@ -206,11 +206,11 @@
{% endif %}
{% endfor %}
{% endif %}
<!-- </div> -->
</div>
<!-- end of date -->
<!-- publishers-->
<!-- <div class="artwork-rightcolumn-top-publishers"> -->
<div class="artwork-rightcolumn-top-publishers">
<p class="label-item">PUBLISHERS</p>
<!-- loop through publishers -->
{% if artworkpublisher['results']['bindings']==[] %}
@ -235,11 +235,11 @@
</div>
<!-- end of publishers-->
<!-- </div> artwork-rightcolumn-top -->
</div>
<!-- end of about right top -->
<!-- start of about right column bottom -->
<!-- <div class="artwork-rightcolumn-bottom"> -->
<div class="artwork-rightcolumn-bottom">
<!-- description -->
@ -248,31 +248,30 @@
{% else %}
<!-- For loop -->
{% for x in artworkdescriptiondata['results']['bindings'] %}
<div class="artwork-rightcolumn-description">
<div>
<p class="label-item">DESCRIPTION</p>
<!-- left part with the description text already coming in a div from wiki-->
<div class="text-description">
<div>
{{ x["text"] | safe }}
</div>
<!-- right ride with author etc LATER-->
<div class="text-date-author">
{% if "authordescriptionPageLabel" in x %}
<div>
<p class="label-item">AUTHOR</p>
{% if "authordescriptionPageLabel" in x %}
<p>{{ x['authordescriptionPageLabel']['value'] }}</p>
{% endif %}
<!-- if there is an author name then add here otherwise info non available -->
{% if "sourcedescriptionPage" in x %}
<p class="label-item">SOURCE</p>
{% if "sourcedescriptionPage" in x %}
<p>{{ x["sourcedescriptionPage"]["value"]}} </p>
<!-- if there is a source name then add here otherwise info non available -->
{% endif %}
{% if "datedescriptionPage" in x %}
<p class="label-item">DATE</p>
{% if "datedescriptionPage" in x %}
<p>{{ x["datedescriptionPage"]["value"] | replace("T00:00:00Z", "") }}</p>
{% endif %}
<!-- if there is a date add here otherwise info non available-->
@ -290,22 +289,29 @@
{% else %}
{% for x in artworkexhibitiondata['results']['bindings'] %}
<div class="artwork-rightcolumn-exhibition">
<div>
<p class="label-item">EXHIBITION AND DISTRIBUTION HISTORY</p>
<div class="text-exhibition">
<div>
{{ x['text'] | safe }}
</div>
<!-- right ride with author etc LATER-->
<div class="text-date-author">
<div>
<p class="label-item">AUTHOR</p>
<!-- if there is an author name then add here otherwise info non available -->
{% if "authorexhibitionHisPageLabel" in x %}
<p>{{ x["authorexhibitionHisPageLabel"]["value"]}} </p>
{% endif %}
{% if "authorexhibitionHisPageLabel" not in x %}
<p>information not available</p>
{% endif %}
<p class="label-item">SOURCE</p>
<!-- if there is a source name then add here otherwise info non available -->
{% if "sourceexhibitionHisPage" not in x %}
<p>information not available </p>
{% endif %}
{% if "sourceexhibitionHisPage" in x%}
<p>{{ x["sourceexhibitionHisPage"]["value"]}} </p>
{% endif %}
@ -322,8 +328,8 @@
{% endif %}
<!-- end exhibition loop -->
<!-- </div> end of right column -->
<!-- end of right column -->
</div>
<!-- end of about -->
</div>

Loading…
Cancel
Save