diff --git a/Sparql.py b/Sparql.py index f562f3d91c2ec9f95ab7dc4ee883ddc88db4ff54..3bcda4ea5613abeb4eacfb830f76ba85a6091351 100644 --- a/Sparql.py +++ b/Sparql.py @@ -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/># diff --git a/api.py b/api.py index b6d15d56f8f54ad8dd4e34e297ce19bfacf08439..e73a3f951d33b0ff85968e56ab2d0adbb9bd5a90 100644 --- a/api.py +++ b/api.py @@ -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 diff --git a/static/stylesheet.css b/static/stylesheet.css index 8ac46415194def98e698399056e09aa251cd61eb..0da6b7584a377975b19d0071430ae3a39d11c1ce 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -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 diff --git a/templates/index.html b/templates/index.html index 5b7591a22e90f1d0e0f0837f8d21b1a7904a2d59..42065c12cdf5f685ab0477bef8484a6c31624a9c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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>