|
|
@ -131,6 +131,66 @@ def browsebycategory(): |
|
|
|
# CATEGORIES TO BE BROWSED |
|
|
|
######################### |
|
|
|
|
|
|
|
######################### OLDEST INDEX |
|
|
|
@app.route("/datesindex_asc") |
|
|
|
def datesindex_asc(): |
|
|
|
sparql.setQuery(''' |
|
|
|
SELECT ?work ?workLabel ?image ?date WHERE { |
|
|
|
{ |
|
|
|
SELECT ?work ?workLabel (SAMPLE(?date) AS ?date) |
|
|
|
WHERE |
|
|
|
{ ?work wdt:P1 wd:Q1; |
|
|
|
wdt:P13 ?date. |
|
|
|
FILTER(?work != wd:Q57) |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
|
} |
|
|
|
GROUP BY ?work ?workLabel |
|
|
|
ORDER BY ?workLabel |
|
|
|
} |
|
|
|
?work wdt:P1 wd:Q1. |
|
|
|
|
|
|
|
OPTIONAL {?work p:P90 ?statement. |
|
|
|
?statement ps:P90 ?image; |
|
|
|
pq:P54 wd:Q90.} |
|
|
|
FILTER(?work != wd:Q57) |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
|
} |
|
|
|
ORDER BY ASC(?date) |
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
results = sparql.query().convert() |
|
|
|
return render_template('oldestindex.html', results=results) |
|
|
|
|
|
|
|
######################### NEWEST INDEX |
|
|
|
@app.route("/datesindex_desc") |
|
|
|
def datesindex_desc(): |
|
|
|
sparql.setQuery(''' |
|
|
|
SELECT ?work ?workLabel ?image ?date WHERE { |
|
|
|
{ |
|
|
|
SELECT ?work ?workLabel (SAMPLE(?date) AS ?date) |
|
|
|
WHERE |
|
|
|
{ ?work wdt:P1 wd:Q1; |
|
|
|
wdt:P13 ?date. |
|
|
|
FILTER(?work != wd:Q57) |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
|
} |
|
|
|
GROUP BY ?work ?workLabel |
|
|
|
ORDER BY ?workLabel |
|
|
|
} |
|
|
|
?work wdt:P1 wd:Q1. |
|
|
|
|
|
|
|
OPTIONAL {?work p:P90 ?statement. |
|
|
|
?statement ps:P90 ?image; |
|
|
|
pq:P54 wd:Q90.} |
|
|
|
FILTER(?work != wd:Q57) |
|
|
|
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } |
|
|
|
} |
|
|
|
ORDER BY DESC(?date) |
|
|
|
|
|
|
|
''') |
|
|
|
sparql.setReturnFormat(JSON) |
|
|
|
results = sparql.query().convert() |
|
|
|
return render_template('newestindex.html', results=results) |
|
|
|
|
|
|
|
######################### ARTIST INDEX |
|
|
|
@app.route("/artistsindex") |
|
|
|