mockups person and org
This commit is contained in:
parent
f37ca1e2ca
commit
72ba26819e
112
daapinterface.py
112
daapinterface.py
@ -226,12 +226,13 @@ def artwork():
|
||||
artworkimages = sparql.query().convert()
|
||||
# print(artworkimages)
|
||||
|
||||
######### Right top
|
||||
# contributors
|
||||
sparql.setQuery('''
|
||||
SELECT DISTINCT ?creators ?creatorsLabel (group_concat(?creatorRolesLabel; separator="; ") as ?role)
|
||||
WHERE
|
||||
{
|
||||
VALUES ?work {wd:Q118}
|
||||
VALUES ?work {wd:'''+artwork_id+'''}
|
||||
?work wdt:P9 ?creators.
|
||||
OPTIONAL { ?work p:P9 ?statement1.
|
||||
?statement1 ps:P9 ?creators;
|
||||
@ -286,6 +287,95 @@ def artwork():
|
||||
print(artworkpublisher)
|
||||
|
||||
|
||||
#####right middle
|
||||
# description + id to be changed
|
||||
sparql.setQuery('''
|
||||
SELECT ?accessURLdescriptionPage ?authordescriptionPage ?authordescriptionPageLabel ?datedescriptionPage ?sourcedescriptionPage ?sourcedescriptionPageLabel
|
||||
WHERE
|
||||
{
|
||||
VALUES ?work {wd:'''+artwork_id+'''}
|
||||
?work wdt:P65 ?descriptionPage.
|
||||
OPTIONAL { ?descriptionPage wdt:P4 ?accessURLdescriptionPage. }
|
||||
OPTIONAL { ?descriptionPage wdt:P9 ?authordescriptionPage. }
|
||||
OPTIONAL { ?descriptionPage wdt:P13 ?datedescriptionPage. }
|
||||
OPTIONAL { ?descriptionPage wdt:P50 ?sourcedescriptionPage. }
|
||||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
|
||||
}
|
||||
''')
|
||||
sparql.setReturnFormat(JSON)
|
||||
artworkdescriptiondata = sparql.query().convert()
|
||||
# print("hello")
|
||||
# print(artworkdescriptiondata)
|
||||
# print("bye")
|
||||
|
||||
dictionary = artworkdescriptiondata
|
||||
# print(type(dictionary))
|
||||
|
||||
# get the description text or say there isn't any
|
||||
# artworkdescriptiontext = None
|
||||
|
||||
# for x in dictionary['results']['bindings']:
|
||||
# if "accessURLdescriptionPage" in x:
|
||||
# print("url for description present")
|
||||
# # get the description content from wiki
|
||||
# artworkdescriptioncontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Description:"+artwork_id+"&action=render"
|
||||
# # Make a GET request to fetch the raw HTML content
|
||||
# html_content = requests.get(artworkdescriptioncontenturl).text
|
||||
# # Parse the html content
|
||||
# soup = BeautifulSoup(html_content, "lxml")
|
||||
# # print(soup.prettify()) # print the parsed data of html
|
||||
# # text=soup.find("div" , {"class" : "mw-parser-output"})
|
||||
# text=soup.find_all("p")
|
||||
# artworkdescriptiontext=Markup(text)
|
||||
# else:
|
||||
# print("url for description absent")
|
||||
# text="<p>Information not available</p>"
|
||||
# artworkdescriptiontext=Markup(text)
|
||||
|
||||
artworkdescriptioncontenturl = "https://daap.bannerrepeater.org/w/index.php?title=Description:Q427&action=render"
|
||||
# Make a GET request to fetch the raw HTML content
|
||||
html_content = requests.get(artworkdescriptioncontenturl).text
|
||||
# Parse the html content
|
||||
soup = BeautifulSoup(html_content, "lxml")
|
||||
# print(soup.prettify()) # print the parsed data of html
|
||||
# text=soup.find("div" , {"class" : "mw-parser-output"})
|
||||
text=soup.find_all("p")
|
||||
artworkdescriptiontext=Markup(text)
|
||||
|
||||
print(artworkdescriptiontext)
|
||||
|
||||
############ right bottom LATER
|
||||
# exhibitions + id to be changed
|
||||
sparql.setQuery('''
|
||||
SELECT ?accessURLexhibitionHisPage ?authorexhibitionHisPageLabel ?dateexhibitionHisPage ?sourceexhibitionHisPage
|
||||
WHERE
|
||||
{
|
||||
VALUES ?work {wd:Q57}
|
||||
?work wdt:P66 ?exhibitionHisPage.
|
||||
OPTIONAL { ?exhibitionHisPage wdt:P4 ?accessURLexhibitionHisPage. }
|
||||
OPTIONAL { ?exhibitionHisPage wdt:P9 ?authorexhibitionHisPage. }
|
||||
OPTIONAL { ?exhibitionHisPage wdt:P13 ?dateexhibitionHisPage. }
|
||||
OPTIONAL { ?exhibitionHisPage wdt:P50 ?sourceexhibitionHisPage. }
|
||||
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
|
||||
}
|
||||
''')
|
||||
sparql.setReturnFormat(JSON)
|
||||
artworkexhibitiondata = sparql.query().convert()
|
||||
|
||||
# description content from wiki
|
||||
artworkexhibitioncontenturl = "https://daap.bannerrepeater.org/w/index.php?title=History:"+artwork_id+"&action=render"
|
||||
# Make a GET request to fetch the raw HTML content
|
||||
html_content = requests.get(artworkexhibitioncontenturl).text
|
||||
# Parse the html content
|
||||
soup = BeautifulSoup(html_content, "lxml")
|
||||
# print(soup.prettify()) # print the parsed data of html
|
||||
|
||||
# text=soup.find("div" , {"class" : "mw-parser-output"})
|
||||
text=soup.find_all("p")
|
||||
artworkexhibitiontext=Markup(text)
|
||||
# print(artworkexhibitiontext)
|
||||
|
||||
############## bottom
|
||||
# copies in collection
|
||||
sparql.setQuery('''
|
||||
SELECT ?copiesCollections ?copiesCollectionsLabel ?collection ?collectionLabel ?image
|
||||
@ -323,7 +413,10 @@ def artwork():
|
||||
# print(relatedworks)
|
||||
|
||||
|
||||
return render_template('artwork.html', artworkintro=artworkintro, artworkimages=artworkimages, artworkcontributors=artworkcontributors, artworkdate=artworkdate, artworkpublisher=artworkpublisher, copiesincollection=copiesincollection, relatedworks=relatedworks)
|
||||
return render_template('artwork.html', artworkintro=artworkintro, artworkimages=artworkimages, artworkcontributors=artworkcontributors, artworkdate=artworkdate, artworkpublisher=artworkpublisher, artworkdescriptiondata=artworkdescriptiondata, artworkdescriptiontext=artworkdescriptiontext, copiesincollection=copiesincollection, relatedworks=relatedworks)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -385,6 +478,12 @@ def person():
|
||||
return render_template("person.html", person_id=person_id, person_creatorof=person_creatorof, person_publisherof=person_publisherof, person_details=person_details)
|
||||
|
||||
|
||||
######################### ORGANISATION
|
||||
@app.route("/organisation", methods=['GET'])
|
||||
def organisation():
|
||||
org_id = request.args.get('id')
|
||||
return render_template("organisation.html")
|
||||
|
||||
|
||||
#########################
|
||||
# PAGES FROM WIKI
|
||||
@ -425,6 +524,15 @@ def about():
|
||||
######################### TUTORIAL
|
||||
@app.route("/tutorials")
|
||||
def tutorials():
|
||||
url="https://daap.bannerrepeater.org/w/index.php?title=Tutorials&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('tutorials.html')
|
||||
|
||||
|
||||
|
18
templates/organisation.html
Normal file
18
templates/organisation.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
|
||||
<div id="container-backend-data-button">
|
||||
|
||||
<a target="_blank" href="https://daap.bannerrepeater.org/wiki/Item:{{ org_id }}">
|
||||
<div id="backend-data-button">
|
||||
<span>Go to backend to see live data</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<img src="{{ url_for('static', filename='/imgs/Pages/mockup_page_org.png') }}">
|
||||
|
||||
{% endblock content %}
|
@ -13,6 +13,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<img src="{{ url_for('static', filename='/imgs/Pages/Artwork page_mock up.png') }}">
|
||||
<img src="{{ url_for('static', filename='/imgs/Pages/mockup_page_person.png') }}">
|
||||
|
||||
{% endblock content %}
|
Loading…
Reference in New Issue
Block a user