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/wikiproject_focus.sparql
Wikiproject aspect: focus
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?type ?typeLabel ?count WITH {
SELECT DISTINCT ?type (COUNT(?item) AS ?count) WHERE {
?item wdt:P5008 wd:Q60687720;
(wdt:P31|wdt:P279) ?type.
}
GROUP BY ?type ?count
ORDER BY DESC (?count)
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,da,de,es,fr,it,sv,uk,zh". }
}
ORDER BY DESC (?count)
graph TD