query-33ed3a2e2eba7681ba3355cae2cb5b73

rq turtle/ttl

Publishers

Use at

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

SELECT
  ?works
  (CONCAT("#language/", SUBSTR(STR(target:), 32), "/publisher/", SUBSTR(STR(?publisher), 32)) AS ?worksUrl) 

  ?publisher ?publisherLabel
  (CONCAT("#publisher/", SUBSTR(STR(?publisher), 32)) AS ?publisherUrl) 
  ?publisherDescription
WHERE {
   {
  SELECT
    (COUNT(?work) AS ?works)
    ?publisher
  WHERE {
    ?work wdt:P123 ?publisher ;
          wdt:P407 target: .
  }
  GROUP BY ?publisher
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
ORDER BY DESC(?works)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?publisher"):::projected v5("?publisherUrl") v2("?work") v4("?works"):::projected v4("?worksUrl") c3([http://www.wikidata.org/entity/Q9035]):::iri c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"wdt:P123"--> v3 v2 --"wdt:P407"--> c3 bind1[/"count(?work)"/] v2 --o bind1 bind1 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind2[/"concat('#language/',substring(str(http://www.wikidata.org/entity/Q9035),'32^^xsd:integer'),'/publisher/',substring(str(?publisher),'32^^xsd:integer'))"/] v3 --o bind2 bind2 --as--o v4 bind3[/"concat('#publisher/',substring(str(?publisher),'32^^xsd:integer'))"/] v3 --o bind3 bind3 --as--o v5