|
|
@ -388,13 +388,26 @@ def artwork(): |
|
|
|
#####right middle |
|
|
|
# description + id to be changed |
|
|
|
sparql.setQuery(''' |
|
|
|
SELECT ?accessURLdescriptionPage ?authordescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPage ?sourcedescriptionPageLabel |
|
|
|
SELECT ?accessURLdescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPage |
|
|
|
WHERE |
|
|
|
{ |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
?work wdt:P65 ?descriptionPage. |
|
|
|
OPTIONAL { ?descriptionPage wdt:P4 ?accessURLdescriptionPage. } |
|
|
|
OPTIONAL { ?descriptionPage wdt:P9 ?authordescriptionPage. } |
|
|
|
{ |
|
|
|
SELECT DISTINCT ?descriptionPage (group_concat(?authorsdescriptionPageLabel; separator="; ") as ?authordescriptionPageLabel) |
|
|
|
WHERE |
|
|
|
{ |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
?work wdt:P65 ?descriptionPage. |
|
|
|
OPTIONAL { ?descriptionPage wdt:P9 ?authorsdescriptionPage. } |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". |
|
|
|
?authorsdescriptionPage rdfs:label ?authorsdescriptionPageLabel. |
|
|
|
?authordescriptionPage rdfs:label ?authordescriptionPageLabel. } |
|
|
|
} |
|
|
|
GROUP BY ?descriptionPage |
|
|
|
ORDER BY ?descriptionPage |
|
|
|
} |
|
|
|
OPTIONAL { ?descriptionPage wdt:P13 ?datedescriptionPage. } |
|
|
|
OPTIONAL { ?descriptionPage wdt:P50 ?sourcedescriptionPage. } |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
@ -403,6 +416,8 @@ def artwork(): |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
artworkdescriptiondata = sparql.query().convert() |
|
|
|
|
|
|
|
print(artworkdescriptiondata) |
|
|
|
|
|
|
|
|
|
|
|
for x in artworkdescriptiondata['results']['bindings']: |
|
|
|
if "accessURLdescriptionPage" in x: |
|
|
@ -426,17 +441,31 @@ def artwork(): |
|
|
|
text="<p>Information not available</p>" |
|
|
|
x["text"] = text |
|
|
|
|
|
|
|
# print(artworkdescriptiondata) |
|
|
|
|
|
|
|
|
|
|
|
# exhibitions + id to be changed |
|
|
|
sparql.setQuery(''' |
|
|
|
SELECT ?accessURLexhibitionHisPage ?authorexhibitionHisPageLabel ?dateexhibitionHisPage ?sourceexhibitionHisPage |
|
|
|
SELECT ?accessURLexhibitionHisPage ?authorexhibitionHisPageLabel ?dateexhibitionHisPage ?sourceexhibitionHisPage |
|
|
|
WHERE |
|
|
|
{ |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
?work wdt:P66 ?exhibitionHisPage. |
|
|
|
OPTIONAL { ?exhibitionHisPage wdt:P4 ?accessURLexhibitionHisPage. } |
|
|
|
OPTIONAL { ?exhibitionHisPage wdt:P9 ?authorexhibitionHisPage. } |
|
|
|
{ SELECT DISTINCT ?exhibitionHisPage (group_concat(?authorsexhibitionHisPageLabel; separator="; ") as ?authorexhibitionHisPageLabel) |
|
|
|
WHERE |
|
|
|
{ |
|
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
|
|
|
|
|
?work wdt:P66 ?exhibitionHisPage. |
|
|
|
OPTIONAL { ?exhibitionHisPage wdt:P9 ?authorsexhibitionHisPage. } |
|
|
|
|
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". |
|
|
|
?authorsexhibitionHisPage rdfs:label ?authorsexhibitionHisPageLabel. |
|
|
|
?authorexhibitionHisPage rdfs:label ?authorexhibitionHisPageLabel. } |
|
|
|
} |
|
|
|
GROUP BY ?exhibitionHisPage |
|
|
|
ORDER BY ?exhibitionHisPage |
|
|
|
} |
|
|
|
OPTIONAL { ?exhibitionHisPage wdt:P13 ?dateexhibitionHisPage. } |
|
|
|
OPTIONAL { ?exhibitionHisPage wdt:P50 ?sourceexhibitionHisPage. } |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
@ -1110,6 +1139,21 @@ def searchtools(): |
|
|
|
text=Markup(text) |
|
|
|
return render_template('searchtools.html', text=text) |
|
|
|
|
|
|
|
# #################### SUPPORT |
|
|
|
@app.route("/support") |
|
|
|
def support(): |
|
|
|
url="https://daap.bannerrepeater.org/w/index.php?title=Support&action=render" |
|
|
|
# Make a GET request to fetch the raw HTML content |
|
|
|
html_content = requests.get(url).text |
|
|
|
# Parse the html content |
|
|
|
soup = BeautifulSoup(html_content, "lxml") |
|
|
|
# print(soup.prettify()) # print the parsed data of html |
|
|
|
|
|
|
|
text=soup.find("html") |
|
|
|
|
|
|
|
text=Markup(text) |
|
|
|
return render_template('support.html', text=text) |
|
|
|
|
|
|
|
######################### TUTORIAL |
|
|
|
@app.route("/tutorials") |
|
|
|
def tutorials(): |
|
|
|