|
|
@ -217,7 +217,6 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkintro = sparql.query().convert() |
|
|
|
# print(artworkintro) |
|
|
|
|
|
|
|
# Image(s) |
|
|
|
# query for later |
|
|
@ -252,7 +251,6 @@ def artwork(): |
|
|
|
|
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkimages = sparql.query().convert() |
|
|
|
# print(artworkimages) |
|
|
|
|
|
|
|
# Links and downloads |
|
|
|
sparql.setQuery(''' |
|
|
@ -267,7 +265,6 @@ def artwork(): |
|
|
|
}''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworklinksanddownloads = sparql.query().convert() |
|
|
|
print(artworklinksanddownloads) |
|
|
|
|
|
|
|
# Other digital artefacts |
|
|
|
sparql.setQuery(''' |
|
|
@ -276,19 +273,21 @@ def artwork(): |
|
|
|
{ |
|
|
|
{ |
|
|
|
SELECT ?ImageFile WHERE { |
|
|
|
VALUES ?work {wd:Q57} |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
OPTIONAL {?work p:P35 ?statement. |
|
|
|
?statement ps:P35 ?ImageFile; |
|
|
|
pq:P16 wd:Q85.} |
|
|
|
}} |
|
|
|
{ |
|
|
|
SELECT ?AudioFile WHERE { |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
OPTIONAL {?work p:P35 ?statement. |
|
|
|
?statement ps:P35 ?AudioFile; |
|
|
|
pq:P16 wd:Q28.} |
|
|
|
}} |
|
|
|
{ |
|
|
|
SELECT ?VideoFile WHERE { |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
OPTIONAL {?work p:P35 ?statement. |
|
|
|
?statement ps:P35 ?VideoFile; |
|
|
|
pq:P16 wd:Q27.} |
|
|
@ -298,7 +297,7 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkartefacts = sparql.query().convert() |
|
|
|
# print(artworkartefacts) |
|
|
|
print(artworkartefacts) |
|
|
|
|
|
|
|
|
|
|
|
# Distributor Links |
|
|
@ -335,7 +334,6 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkcontributors = sparql.query().convert() |
|
|
|
# print(artworkcontributors) |
|
|
|
|
|
|
|
# date |
|
|
|
sparql.setQuery(''' |
|
|
@ -352,7 +350,6 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkdate = sparql.query().convert() |
|
|
|
# print(artworkdate) |
|
|
|
|
|
|
|
# publishers |
|
|
|
sparql.setQuery(''' |
|
|
@ -373,8 +370,6 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkpublisher = sparql.query().convert() |
|
|
|
# print(artworkpublisher) |
|
|
|
|
|
|
|
|
|
|
|
#####right middle |
|
|
|
# description + id to be changed |
|
|
@ -395,16 +390,10 @@ def artwork(): |
|
|
|
artworkdescriptiondata = sparql.query().convert() |
|
|
|
|
|
|
|
|
|
|
|
# get the description text or say there isn't any |
|
|
|
# artworkdescriptiontext = [] |
|
|
|
|
|
|
|
for x in artworkdescriptiondata['results']['bindings']: |
|
|
|
if "accessURLdescriptionPage" in x: |
|
|
|
# print("url for description present") |
|
|
|
# print(x["accessURLdescriptionPage"]["value"]) |
|
|
|
accessURLdescriptionUrl = x["accessURLdescriptionPage"]["value"] |
|
|
|
desc_url = re.search(r':Q(.*)', accessURLdescriptionUrl, re.DOTALL) |
|
|
|
# print(desc_url.group(1)) |
|
|
|
desc_id=desc_url.group(1) |
|
|
|
# # get the description content from wiki |
|
|
|
artworkdescriptioncontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Description:Q"+desc_id+"&action=render" |
|
|
@ -444,8 +433,6 @@ def artwork(): |
|
|
|
# get the text from the url |
|
|
|
for x in artworkexhibitiondata['results']['bindings']: |
|
|
|
if "accessURLexhibitionHisPage" in x: |
|
|
|
# print("url for description present") |
|
|
|
# print(x["accessURLexhibitionHisPage"]["value"]) |
|
|
|
accessURLexhibitionHisPage = x["accessURLexhibitionHisPage"]["value"] |
|
|
|
desc_url = re.search(r':Q(.*)', accessURLexhibitionHisPage, re.DOTALL) |
|
|
|
# print(desc_url.group(1)) |
|
|
@ -467,7 +454,6 @@ def artwork(): |
|
|
|
# artworkexhibitiontext=Markup(text) |
|
|
|
x['text']=text |
|
|
|
|
|
|
|
# print(artworkexhibitiondata) |
|
|
|
|
|
|
|
|
|
|
|
############## bottom |
|
|
@ -519,7 +505,6 @@ def artwork(): |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworklists = sparql.query().convert() |
|
|
|
# print(artworklists) |
|
|
|
|
|
|
|
return render_template('artwork.html', artwork_id=artwork_id, artworkintro=artworkintro, artworkimages=artworkimages, artworklinksanddownloads=artworklinksanddownloads, artworkartefacts=artworkartefacts, artworkdistributorlinks=artworkdistributorlinks, artworkcontributors=artworkcontributors, artworkdate=artworkdate, artworkpublisher=artworkpublisher, artworkdescriptiondata=artworkdescriptiondata, artworkexhibitiondata=artworkexhibitiondata, artworklists=artworklists, copiesincollection=copiesincollection, relatedworks=relatedworks) |
|
|
|
|
|
|
|