query-dd099436ed987a94cb12adeb820ef679

rq turtle/ttl

Related 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/Q3362362>

SELECT DISTINCT
  ?overlap
  ?publisher ?publisherLabel
  (CONCAT("#publisher/", SUBSTR(STR(?publisher), 32)) AS ?publisherUrl)
  ?publisherDescription
WHERE {
   {
  SELECT
    (COUNT(DISTINCT ?author) + COUNT(DISTINCT ?topic) AS ?overlap)
    ?publisher 
  WHERE {
    {
      ?author ^wdt:P50 / wdt:P123 target: .
      ?author ^wdt:P50 / wdt:P123 ?publisher .
    }
    UNION
    {
      ?topic ^wdt:P921 / wdt:P123 target: .
      ?topic ^wdt:P921 / wdt:P123 ?publisher .
    }
    FILTER (target: != ?publisher)
  }
  GROUP BY ?publisher
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
ORDER BY DESC(?overlap)
LIMIT 200

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?_anon_42b5416610844a34809f33a099ae9de180159") v6("?_anon_42b5416610844a34809f33a099ae9de180160") v3("?author") v7("?overlap"):::projected v2("?publisher"):::projected v7("?publisherUrl") v4("?topic") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c1([http://www.wikidata.org/entity/Q3362362]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["http://www.wikidata.org/entity/Q3362362 != ?publisher"]] f0 --> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a3 --"wdt:P921"--> v4 a3 --"wdt:P123"--> c1 a4 --"wdt:P921"--> v4 a4 --"wdt:P123"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P50"--> v3 a1 --"wdt:P123"--> c1 a2 --"wdt:P50"--> v3 a2 --"wdt:P123"--> v2 end union0r <== or ==> union0l end bind3[/"count(?author)"/] v3 --o bind3 bind3 --as--o v5 bind4[/"count(?topic)"/] v4 --o bind4 bind4 --as--o v6 bind5[/" + "/] null --o bind5 null --o bind5 bind5 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind6[/"concat('#publisher/',substring(str(?publisher),'32^^xsd:integer'))"/] v2 --o bind6 bind6 --as--o v7