pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
414 stars 129 forks source link

AffiliationSearch: parent affiliation id is always "0" #325

Closed AlexFridman closed 7 months ago

AlexFridman commented 7 months ago

pybliometrics version: '3.5.2', '3.6'

Code to reproduce the bug:

search = AffiliationSearch('AF-ID(60001176)')
search.affiliations[0].parent
# '0'

Expected behavior: parent id have to be = 60011568

Michael-E-Rose commented 7 months ago

This is, unfortunately, not a bug. pybliometrics parses exactly the information as provided by the various Scopus APIs.

You can inspect what the API returns:

>>> search._json
[{'@_fa': 'true', 'link': [{'@_fa': 'true', '@ref': 'self', '@href': 'https://api.elsevier.com/content/affiliation/affiliation_id/60001176'}, {'@_fa': 'true', '@ref': 'search', '@href': 'https://api.elsevier.com/content/search/scopus?query=af-id%2860001176%29'}, {'@_fa': 'true', '@ref': 'scopus-affiliation', '@href': 'https://www.scopus.com/affil/profile.uri?afid=60001176&partnerID=HzOxMe3b&origin=inward'}], 'prism:url': 'https://api.elsevier.com/content/affiliation/affiliation_id/60001176', 'dc:identifier': 'AFFILIATION_ID:60001176', 'eid': '10-s2.0-60001176', 'affiliation-name': 'Faculty of Medicine', 'name-variant': [{'@_fa': 'true', '$': 'Faculty Of Medicine'}], 'document-count': '3677', 'city': 'Tanta', 'country': 'Egypt', 'parent-affiliation-id': '0'}]

It used to be different. I already inquired with the Scopus folks about this, but the API team has become unresponsive. Maybe it helps when more people complain: https://service.elsevier.com/app/contact/supporthub/dataasaservice/