Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
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

Open
Daniel-Mietchen opened this issue Nov 20, 2019 · 3 comments · May be fixed by #980

Comments

@Daniel-Mietchen
Copy link
Collaborator

@Daniel-Mietchen Daniel-Mietchen commented Nov 20, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@Daniel-Mietchen Daniel-Mietchen commented Nov 20, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@Daniel-Mietchen Daniel-Mietchen commented Dec 7, 2019

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

This comment has been minimized.

Copy link
Collaborator Author

@Daniel-Mietchen Daniel-Mietchen commented Dec 7, 2019

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".
  }
}
@Daniel-Mietchen Daniel-Mietchen linked a pull request that will close this issue Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Authors
  
To do
Venues
  
To do
1 participant
You can’t perform that action at this time.