sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

231

rq turtle/ttl

Wikiproject aspect: focus

Use at

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