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