|
@ -388,13 +388,26 @@ def artwork(): |
|
|
#####right middle |
|
|
#####right middle |
|
|
# description + id to be changed |
|
|
# description + id to be changed |
|
|
sparql.setQuery(''' |
|
|
sparql.setQuery(''' |
|
|
SELECT ?accessURLdescriptionPage ?authordescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPage ?sourcedescriptionPageLabel |
|
|
SELECT ?accessURLdescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPage |
|
|
WHERE |
|
|
WHERE |
|
|
{ |
|
|
{ |
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
?work wdt:P65 ?descriptionPage. |
|
|
?work wdt:P65 ?descriptionPage. |
|
|
OPTIONAL { ?descriptionPage wdt:P4 ?accessURLdescriptionPage. } |
|
|
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:P13 ?datedescriptionPage. } |
|
|
OPTIONAL { ?descriptionPage wdt:P50 ?sourcedescriptionPage. } |
|
|
OPTIONAL { ?descriptionPage wdt:P50 ?sourcedescriptionPage. } |
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
@ -403,6 +416,8 @@ def artwork(): |
|
|
sparql.setReturnFormat(JSON) |
|
|
sparql.setReturnFormat(JSON) |
|
|
artworkdescriptiondata = sparql.query().convert() |
|
|
artworkdescriptiondata = sparql.query().convert() |
|
|
|
|
|
|
|
|
|
|
|
print(artworkdescriptiondata) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for x in artworkdescriptiondata['results']['bindings']: |
|
|
for x in artworkdescriptiondata['results']['bindings']: |
|
|
if "accessURLdescriptionPage" in x: |
|
|
if "accessURLdescriptionPage" in x: |
|
@ -426,7 +441,7 @@ def artwork(): |
|
|
text="<p>Information not available</p>" |
|
|
text="<p>Information not available</p>" |
|
|
x["text"] = text |
|
|
x["text"] = text |
|
|
|
|
|
|
|
|
# print(artworkdescriptiondata) |
|
|
|
|
|
|
|
|
|
|
|
# exhibitions + id to be changed |
|
|
# exhibitions + id to be changed |
|
|
sparql.setQuery(''' |
|
|
sparql.setQuery(''' |
|
@ -436,7 +451,21 @@ def artwork(): |
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
VALUES ?work {wd:'''+artwork_id+'''} |
|
|
?work wdt:P66 ?exhibitionHisPage. |
|
|
?work wdt:P66 ?exhibitionHisPage. |
|
|
OPTIONAL { ?exhibitionHisPage wdt:P4 ?accessURLexhibitionHisPage. } |
|
|
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:P13 ?dateexhibitionHisPage. } |
|
|
OPTIONAL { ?exhibitionHisPage wdt:P50 ?sourceexhibitionHisPage. } |
|
|
OPTIONAL { ?exhibitionHisPage wdt:P50 ?sourceexhibitionHisPage. } |
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
@ -1110,6 +1139,21 @@ def searchtools(): |
|
|
text=Markup(text) |
|
|
text=Markup(text) |
|
|
return render_template('searchtools.html', text=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 |
|
|
######################### TUTORIAL |
|
|
@app.route("/tutorials") |
|
|
@app.route("/tutorials") |
|
|
def tutorials(): |
|
|
def tutorials(): |
|
|