|
@ -136,8 +136,7 @@ def browsebycategory(): |
|
|
@app.route("/artistsindex") |
|
|
@app.route("/artistsindex") |
|
|
def artistsindex(): |
|
|
def artistsindex(): |
|
|
sparql.setQuery(''' |
|
|
sparql.setQuery(''' |
|
|
SELECT ?creators ?creatorsLabel ?creatorsAltLabel ?creatorsDescription |
|
|
SELECT ?creators ?creatorsLabel ?creatorsAltLabel ?creatorsDescription WHERE { |
|
|
WHERE { |
|
|
|
|
|
{ |
|
|
{ |
|
|
SELECT ?creators (COUNT(DISTINCT ?a) AS ?count) WHERE { |
|
|
SELECT ?creators (COUNT(DISTINCT ?a) AS ?count) WHERE { |
|
|
?a ?prop ?creators . |
|
|
?a ?prop ?creators . |
|
@ -151,10 +150,11 @@ def artistsindex(): |
|
|
} |
|
|
} |
|
|
FILTER (?creators !=wd:Q82) |
|
|
FILTER (?creators !=wd:Q82) |
|
|
} |
|
|
} |
|
|
ORDER BY DESC(?count) ?creatorsLabel |
|
|
ORDER BY ?creatorsLabel |
|
|
''') |
|
|
''') |
|
|
sparql.setReturnFormat(JSON) |
|
|
sparql.setReturnFormat(JSON) |
|
|
results = sparql.query().convert() |
|
|
results = sparql.query().convert() |
|
|
|
|
|
print(results) |
|
|
return render_template('artistsindex.html', results=results) |
|
|
return render_template('artistsindex.html', results=results) |
|
|
|
|
|
|
|
|
######################### PUBLISHERS INDEX |
|
|
######################### PUBLISHERS INDEX |
|
@ -166,8 +166,10 @@ def publishersindex(): |
|
|
SELECT ?publishers (COUNT(DISTINCT ?a) AS ?count) WHERE { |
|
|
SELECT ?publishers (COUNT(DISTINCT ?a) AS ?count) WHERE { |
|
|
?a ?prop ?publishers . |
|
|
?a ?prop ?publishers . |
|
|
?a wdt:P1 ?work . |
|
|
?a wdt:P1 ?work . |
|
|
|
|
|
?publishers wdt:P1 ?typeofpublisher. |
|
|
BIND (wdt:P10 AS ?prop) . |
|
|
BIND (wdt:P10 AS ?prop) . |
|
|
BIND (wd:Q1 AS ?work) . |
|
|
BIND (wd:Q1 AS ?work) |
|
|
|
|
|
BIND (wd:Q12 AS ?typeofpublisher). |
|
|
} GROUP BY ?publishers |
|
|
} GROUP BY ?publishers |
|
|
} . |
|
|
} . |
|
|
SERVICE wikibase:label { |
|
|
SERVICE wikibase:label { |
|
|