query-642809da322a3000224ff33a5645f722

rq turtle/ttl

TODO

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

SELECT
  # Number of works with the author
  ?count

  # Author score - 3 points for authoring a work, 1 for being cited
  ?score

  # Author as a string
  ?author

  # Build URL to the Author disambiguator tool
  (URI(CONCAT(
      'https://author-disambiguator.toolforge.org/names_oauth.php?precise=0n&doit=Look+for+author&limit=50&filter=wdt%3AP31+wd%3AQ212971&name=',
      ENCODE_FOR_URI(?author))) AS ?resolver_url)

# Generate a score for each author

WHERE {
   {
  SELECT
    (COUNT(?work) AS ?count)
    ?author
  WHERE {
     {
  SELECT DISTINCT ?work WHERE {
    ?work wdt:P31 target: .
  }
  LIMIT 10000
}    ?work wdt:P2093 ?author .
  }
  GROUP BY ?author
}   {
  SELECT (SUM(?score_) AS ?score) ?author
  WHERE {
    {
      # Assign them 3 points if they are an author of a work on the subject
      SELECT (3 AS ?score_) ?author ?work WHERE {
        ?work wdt:P2093 ?author .
        ?work wdt:P31 target: .
      }
    }
    UNION
    {
      # Assign them 1 point if they are the author of a work that is cited by a work on the subject
      SELECT (1 AS ?score_) ?author ?work WHERE {
        ?work wdt:P2093 ?author .
        ?citing_work wdt:P2860 ?work .
        ?citing_work wdt:P31 target: .
      }
    }
  }
  GROUP BY ?author
}
  # Label the result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY DESC(?count) DESC(?score)
LIMIT 6000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?author"):::projected v6("?citing_work") v5("?count"):::projected v7("?resolver_url") v7("?score"):::projected v7("?score_") v3("?work") c6(["bd:serviceParam"]):::iri c2([http://www.wikidata.org/entity/Q212971]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P31"--> c2 v3 --"wdt:P2093"--> v4 bind1[/"count(?work)"/] v3 --o bind1 bind1 --as--o v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P2093"--> v4 v6 --"wdt:P2860"--> v3 v6 --"wdt:P31"--> c2 bind2[/"'1^^xsd:integer'"/] bind2 --as--o v7 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P2093"--> v4 v3 --"wdt:P31"--> c2 bind3[/"'3^^xsd:integer'"/] bind3 --as--o v7 end union0r <== or ==> union0l end bind5[/"sum(?score_)"/] v7 --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('https://author-disambiguator.toolforge.org/names_oauth.php?precise=0n&doit=Look+for+author&limit=50&filter=wdt%3AP31+wd%3AQ212971&name=',encode-for-uri(?author))"/] v4 --o bind6 bind6 --as--o v7