Skip to content
Snippets Groups Projects
Commit b8c11152 authored by moogdo49's avatar moogdo49
Browse files

geändert: Sparql.py

	geändert:               api.py
	geändert:               static/stylesheet.css
	geändert:               templates/index.html
parent 342f9635
No related branches found
No related tags found
No related merge requests found
......@@ -32,16 +32,7 @@ def sendSparqlQuery(name):
def send(name):
print("Bearbeite")
print("""
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dbo: <http://dbpedia.org/ontology/>#
......
......@@ -239,5 +239,21 @@ def filterDatum(datum):
return render_template('index.html', objects = merke, searchBool = True, text = text)
@app.route('/detail/<path:bild>', methods=['GET'])
def detail(bild):
text = bild
urlQuery = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/resource/resourceLink/text()) return $x").execute()
actorQuery = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/name/text()) return $x").execute()
birth = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/geburtsjahr/text()) return $x").execute()
death = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/actor/todesjahr/text()) return $x").execute()
place = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/eventWrap/eventPlace/text()) return $x").execute()
mase = session.query("declare namespace lido=\"http://www.lido-schema.org\"; for $x in (/root/object[descriptiveMetadata/objectIdentification/titleSet/title[contains(text(),'" + bild + "')]]/descriptiveMetadata/objectIdentification/displayObjectMeasurements/text()) return $x").execute()
kunstler = sendSparqlQuery(actorQuery)
kunstlerDict = {"name" : kunstler[0],"geschlecht" : kunstler[1], "geburtsdatum" : kunstler[2],"todesdatum" : kunstler[3],"beschreibung" : kunstler[4]}
merke = {"url" : urlQuery, "actor" : actorQuery, "birth" : birth, "death" : death, "title" : bild, "place" : place, "maße" : mase}
return render_template('detail.html', object = merke, kunstler = kunstlerDict)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000, debug=True)
\ No newline at end of file
......@@ -452,3 +452,33 @@ span.ellipse.clickable {
width: 100%;
}
}
/* Detailseite */
.flex-container {
display: -webkit-flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
text-align: justify;
hyphens: auto;
position: absolute;
}
.flex-container > * {
padding: 5em;
-webkit-flex: 1 100%;
flex: 1 100%;
margin: 30px;
float: right;
}
.article {
text-align: left;
}
.img {background: #eee;}
@media all and (min-width: 768px) {
.img {text-align:left;-webkit-flex: 1 auto;flex:1 auto;-webkit-order:1;order:1;}
.article {-webkit-flex:5 0px;flex:5 0px;-webkit-order:2;order:2;}
}
\ No newline at end of file
......@@ -34,7 +34,8 @@
<div class="column">
<figure class="{{ loop.index }}">
{{ loop.index }}
<img src="{{ object.url }}" onclick="openModal();currentSlide({{ loop.index }})" class="hover-shadow" style="width: 350px; height: 260px; padding: 10px;">
<img src="{{ object.url }}" class="hover-shadow" style="width: 350px; height: 260px; padding: 10px;">
<a href="{{ url_for('.detail',bild=object.title) }}">Details</a>
<!-- Hovereffekt muss überarbeitet werden, IST: Beschriftung ü+berlagert sich zur Zeit -->
<figcaption>Künstler: {{ object.actor }} <br> Titel: {{ object.title }} </figcaption>
</figure>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment