WDscholia / scholia

Wikidata-based scholarly profiles
https://scholia.toolforge.org
Other
225 stars 81 forks source link

Collaborating institutions for author #21

Open fnielsen opened 7 years ago

fnielsen commented 7 years ago

Collaborating institutions for author suggested by Egon Willighagen https://twitter.com/egonwillighagen/status/807230510267244544

select (count(distinct ?work) as ?count) ?affiliation2 ?affiliation2_label where {
  ?work (p:P50|p:P2093) ?author_statement . 
  ?author_statement ps:P50 wd:Q20895241 .
  ?author_statement pq:P1416 ?affiliation .
  ?affiliation rdfs:label ?affiliation_label . filter (lang(?affiliation_label) = 'en')
  {
    ?work p:P2093 ?author2_statement . 
    ?author2_statement ps:P2093 ?author2 .
    ?author2_statement pq:P1416 ?affiliation2 .
  } UNION {
    ?work p:P50 ?author2_statement . 
    ?author2_statement ps:P50 ?author2 .
    ?author2_statement pq:P1416 ?affiliation2 .
  }
  ?affiliation2 rdfs:label ?affiliation2_label . filter (lang(?affiliation2_label) = 'en')
  FILTER (?affiliation2 != ?affiliation)
  FILTER (?author2 != wd:Q20895241)
} group by ?affiliation2 ?affiliation2_label
order by desc(?count) asc(?affiliation2_label)
egonw commented 7 years ago

This remains tricky... there still does not seem to be consensus on how to encode the affiliation information on a paper... having it as qualifier currently gives a constraint violation:

image

fnielsen commented 7 years ago

I think this should be fixed on the contraints in Wikidata.

fnielsen commented 7 years ago

Would it word after this: https://www.wikidata.org/w/index.php?title=Property:P50&diff=519285279&oldid=518600739