query-5918f61d6e1d3c5635343baaa0d16b6f

rq turtle/ttl

Related authors at 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 target1: <http://www.wikidata.org/entity/Q20980928>
PREFIX target2: <http://www.wikidata.org/entity/Q49108>

SELECT
  ?score

  ?author ?authorLabel
  (CONCAT("#author/", SUBSTR(STR(?author), 32)) AS ?authorUrl)
  ?authorDescription

  ?roles

WHERE {
   {
  SELECT
    (SUM(?score_) AS ?score)
    ?author
    (GROUP_CONCAT(DISTINCT ?role; separator=", ") AS ?roles)
  WHERE {
    {
      ?author wdt:P108 target2: .
      [] wdt:P50 target1:, ?author .
      BIND(5 AS ?score_)
      BIND("co-author" AS ?role)
    }
    UNION
    {
      ?author wdt:P108 target2: .
      [] wdt:P50 target1: ;
         wdt:P2860 / wdt:P50 ?author .
      BIND(2 AS ?score_)
      BIND("cited" AS ?role)
    }
    UNION
    {
      ?author wdt:P108 target2: .
      [] wdt:P50 ?author ;
         wdt:P2860 / wdt:P50 target1: .
      BIND(3 AS ?score_)
      BIND("citing" AS ?role)
    }
  }
  GROUP BY ?author
}  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("?author"):::projected v6("?authorUrl") v5("?role") v5("?roles"):::projected v5("?score"):::projected v5("?score_") a1((" ")) a2((" ")) a4((" ")) a3((" ")) a5((" ")) c7(["bd:serviceParam"]):::iri c4([http://www.wikidata.org/entity/Q20980928]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2([http://www.wikidata.org/entity/Q49108]):::iri 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; v2 --"wdt:P108"--> c2 a4 --"wdt:P50"--> v2 a4 --"wdt:P2860"--> a5 a5 --"wdt:P50"--> c4 bind0[/"'3^^xsd:integer'"/] bind0 --as--o v5 bind1[/"'citing'"/] bind1 --as--o v5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P108"--> c2 a2 --"wdt:P50"--> c4 a2 --"wdt:P2860"--> a3 a3 --"wdt:P50"--> v2 bind2[/"'2^^xsd:integer'"/] bind2 --as--o v5 bind3[/"'cited'"/] bind3 --as--o v5 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P108"--> c2 a1 --"wdt:P50"--> c4 a1 --"wdt:P50"--> v2 bind4[/"'5^^xsd:integer'"/] bind4 --as--o v5 bind5[/"'co-author'"/] bind5 --as--o v5 end union0r <== or ==> union0l end bind8[/"sum(?score_)"/] v5 --o bind8 bind8 --as--o v5 bind9[/"?role"/] v5 --o bind9 bind9 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind10[/"concat('#author/',substring(str(?author),'32^^xsd:integer'))"/] v2 --o bind10 bind10 --as--o v6