sparql-examples

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

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

003

rq turtle/ttl

List of publishers with the most retractions.

Use at

PREFIX wd: <http://wikidata.org/entity/>
PREFIX wdt: <http://wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT DISTINCT
  (COUNT(DISTINCT ?work) AS ?works)
  ?publisher ?publisherLabel
  (CONCAT("#publisher/", SUBSTR(STR(?publisher), 32)) AS ?publisherUrl)
  ?publisherDescription
WHERE {
  ?work wdt:P31 wd:Q45182324 ; 
        wdt:P1433 ?venue .
  SERVICE <https://query-main.wikidata.org/sparql> {
    {
      SELECT DISTINCT ?venue ?publisher ?publisherLabel  ?publisherDescription
      WHERE {
        ?venue wdt:P123 ?publisher .
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
      }
    }
  }
} GROUP BY ?publisher ?publisherLabel ?publisherUrl ?publisherDescription
  ORDER BY DESC(?works)
  LIMIT 200