query-a392ba043f3c72a8e0f9315ad6f689e2

rq turtle/ttl

Most related organization

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/Q20980928>

SELECT
  ?score
  (CONCAT("#author/", SUBSTR(STR(target:), 32), "/organization/", SUBSTR(STR(?organization), 32)) AS ?scoreUrl)

  ?organization ?organizationLabel
  (CONCAT("#organization/", SUBSTR(STR(?organization), 32)) AS ?organizationUrl)
  ?organizationDescription

  ?roles

WHERE {
   {
  SELECT
    (SUM(?score_) AS ?score)
    ?organization
    (GROUP_CONCAT(DISTINCT ?role; separator=", ") AS ?roles)
  WHERE {
    {
      target: wdt:P108 ?organization .
      BIND(50 AS ?score_)
      BIND("employer" AS ?role)
    }
    UNION
    {
      [] wdt:P50 target: ;
         wdt:P50 / wdt:P108 ?organization .
      BIND(5 AS ?score_)
      BIND("co-author organization" AS ?role)
    }
    UNION
    {
      [] wdt:P50 target: ;
         wdt:P2860 / wdt:P50 / wdt:P108 ?organization .
      BIND(2 AS ?score_)
      BIND("cited organization" AS ?role)
    }
    UNION
    {
      [] wdt:P50 / wdt:P108 ?organization ;
         wdt:P2860 / wdt:P50 target: .
      BIND(3 AS ?score_)
      BIND("citing organization" AS ?role)
    }
  }
  GROUP BY ?organization
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?score)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?organization"):::projected v7("?organizationUrl") v5("?role") v5("?roles"):::projected v5("?score"):::projected v6("?scoreUrl") v5("?score_") a1((" ")) a3((" ")) a6((" ")) a2((" ")) a4((" ")) a5((" ")) a7((" ")) a8((" ")) c6(["bd:serviceParam"]):::iri c1([http://www.wikidata.org/entity/Q20980928]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; a6 --"wdt:P50"--> a7 a7 --"wdt:P108"--> v2 a6 --"wdt:P2860"--> a8 a8 --"wdt:P50"--> c1 bind0[/"'3^^xsd:integer'"/] bind0 --as--o v5 bind1[/"'citing organization'"/] bind1 --as--o v5 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; a3 --"wdt:P50"--> c1 a3 --"wdt:P2860"--> a4 a4 --"wdt:P50"--> a5 a5 --"wdt:P108"--> v2 bind2[/"'2^^xsd:integer'"/] bind2 --as--o v5 bind3[/"'cited organization'"/] bind3 --as--o v5 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P50"--> c1 a1 --"wdt:P50"--> a2 a2 --"wdt:P108"--> v2 bind4[/"'5^^xsd:integer'"/] bind4 --as--o v5 bind5[/"'co-author organization'"/] bind5 --as--o v5 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P108"--> v2 bind6[/"'50^^xsd:integer'"/] bind6 --as--o v5 bind7[/"'employer'"/] bind7 --as--o v5 end union0r <== or ==> union0l end bind10[/"sum(?score_)"/] v5 --o bind10 bind10 --as--o v5 bind11[/"?role"/] v5 --o bind11 bind11 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind12[/"concat('#author/',substring(str(http://www.wikidata.org/entity/Q20980928),'32^^xsd:integer'),'/organization/',substring(str(?organization),'32^^xsd:integer'))"/] v2 --o bind12 bind12 --as--o v6 bind13[/"concat('#organization/',substring(str(?organization),'32^^xsd:integer'))"/] v2 --o bind13 bind13 --as--o v7