Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In venue aspect, add a co-author graph #922

Closed
Daniel-Mietchen opened this issue Nov 20, 2019 · 3 comments · Fixed by #980
Closed

In venue aspect, add a co-author graph #922

Daniel-Mietchen opened this issue Nov 20, 2019 · 3 comments · Fixed by #980
Labels
enhancement some suggestions to improve Scholia graphs visualization option in Wikidata Query Service P50-author Wikidata property P1433-published-in Wikidata property performance the way Scholia treats the machines using it

Comments

@Daniel-Mietchen
Copy link
Member

Similar to the one we have for organizations (example).

Problem, as usual: performance, e.g. as per this example for PLOS Neglected Tropical Diseases, so we should perhaps filter in some way, e.g. for the most prolific authors, as we do in topic profiles (example).

@Daniel-Mietchen Daniel-Mietchen added enhancement some suggestions to improve Scholia P50-author Wikidata property performance the way Scholia treats the machines using it graphs visualization option in Wikidata Query Service P1433-published-in Wikidata property labels Nov 20, 2019
@Daniel-Mietchen Daniel-Mietchen added this to To do in Authors via automation Nov 20, 2019
@Daniel-Mietchen Daniel-Mietchen added this to To do in Venues via automation Nov 20, 2019
@Daniel-Mietchen
Copy link
Member Author

Here is a version with the same kind of filtering that we do for the topic profile:

#defaultView:Graph
SELECT ?author1 ?author1Label ?rgb ?author2 ?author2Label
WITH {
  # Find works published in the given venue
  SELECT ?work WHERE {
    ?work wdt:P1433 wd:Q3359737 .
  }
} AS %works
WITH {
  # Limit the number of authors
  SELECT (COUNT(?work) AS ?count) ?author1 WHERE {
    INCLUDE %works
    ?work wdt:P50 ?author1 .
  }
  GROUP BY ?author1
  ORDER BY DESC(?count)
  LIMIT 25
} AS %authors
WHERE {
  INCLUDE %works
  INCLUDE %authors
  ?work wdt:P50 ?author1 , ?author2 .
  FILTER (?author1 != ?author2) 
  OPTIONAL { ?author1 wdt:P21 ?gender1 . }
  BIND( IF(?gender1 = wd:Q6581097, "3182BD", "E6550D") AS ?rgb)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,fr,de,ru,es,zh,jp".
  }
}

@Daniel-Mietchen
Copy link
Member Author

Taking into account the recent streamlining of the co-author query for topics, here is an adaptation for venues:

#defaultView:Graph
SELECT ?author1 ?author1Label ?rgb ?author2 ?author2Label
WITH {
  # Find works published in the given venue
  SELECT ?work WHERE {
    ?work wdt:P1433 wd:Q3359737 .
  }
} AS %works
WITH {
  # Limit the number of authors
  SELECT (COUNT(?work) AS ?count1) ?author1 WHERE {
    INCLUDE %works
    ?work wdt:P50 ?author1 .
  }
  GROUP BY ?author1
  ORDER BY DESC(?count1)
  LIMIT 25
} AS %authors1
WITH {
  # Limit the number of coauthors
  SELECT DISTINCT ?author2 ?author1  (COUNT(?work) AS ?count2)  WHERE {
    INCLUDE %works
    INCLUDE %authors1
    ?work wdt:P50 ?author1 , ?author2 .
    FILTER (?author1 != ?author2) 
  }
  GROUP BY ?author2 ?author1 
  ORDER BY DESC(?count2)
  LIMIT 250
} AS %authors2
WHERE {
#  INCLUDE %authors1
  INCLUDE %authors2
  OPTIONAL { ?author1 wdt:P21 ?gender1 . }
  BIND( IF(?gender1 = wd:Q6581097, "3182BD", "E6550D") AS ?rgb)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,fr,de,ru,es,zh,jp".
  }
}

@Daniel-Mietchen
Copy link
Member Author

The above times out for PLOS ONE (Q564954), but reducing the LIMITs to 15 and 150 works:

#defaultView:Graph
SELECT ?author1 ?author1Label ?rgb ?author2 ?author2Label
WITH {
  # Find works published in the given venue
  SELECT ?work WHERE {
    ?work wdt:P1433 wd:Q564954 .
  }
} AS %works
WITH {
  # Limit the number of authors
  SELECT (COUNT(?work) AS ?count1) ?author1 WHERE {
    INCLUDE %works
    ?work wdt:P50 ?author1 .
  }
  GROUP BY ?author1
  ORDER BY DESC(?count1)
  LIMIT 15
} AS %authors1
WITH {
  # Limit the number of coauthors
  SELECT DISTINCT ?author2 ?author1  (COUNT(?work) AS ?count2)  WHERE {
    INCLUDE %works
    INCLUDE %authors1
    ?work wdt:P50 ?author1 , ?author2 .
    FILTER (?author1 != ?author2) 
  }
  GROUP BY ?author2 ?author1 
  ORDER BY DESC(?count2)
  LIMIT 150
} AS %authors2
WHERE {
#  INCLUDE %authors1
  INCLUDE %authors2
  OPTIONAL { ?author1 wdt:P21 ?gender1 . }
  BIND( IF(?gender1 = wd:Q6581097, "3182BD", "E6550D") AS ?rgb)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,fr,de,ru,es,zh,jp".
  }
}

Authors automation moved this from To do to Done Dec 8, 2019
Venues automation moved this from To do to Done Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement some suggestions to improve Scholia graphs visualization option in Wikidata Query Service P50-author Wikidata property P1433-published-in Wikidata property performance the way Scholia treats the machines using it
Projects
Authors
  
Done
Venues
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant