A set of SPARQL examples that are used in different TGX resources
License: https://www.gnu.org/licenses/gpl-3.0
Uses method in: https://github.com/WDscholia/scholia/tree/master/scholia/app/templates/organization_awards.sparql
Organization aspect: awards
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#defaultView:Table
PREFIX target: <http://www.wikidata.org/entity/Q104785223>
SELECT
?count
?award ?awardLabel
?recipients ?recipientsUrl
WITH {
SELECT
(COUNT(?researcher) AS ?count)
?award
(GROUP_CONCAT(?researcher_label; separator=", ") AS ?recipients)
(CONCAT("../authors/", GROUP_CONCAT(DISTINCT SUBSTR(STR(?researcher), 32); separator=",")) AS ?recipientsUrl)
WHERE {
hint:Query hint:optimizer "None" .
{
SELECT DISTINCT ?researcher WHERE {
?researcher ( wdt:P108 | wdt:P463 | wdt:P1416 ) / wdt:P361* target: .
}
}
?researcher wdt:P166 ?award .
?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = 'en')
}
GROUP BY ?award
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
}
ORDER BY DESC(?count)
graph TD