cern-sis / issues-scoap3

0 stars 0 forks source link

Write a script which updates IOP affiliations #99

Open ErnestaP opened 1 year ago

ErnestaP commented 1 year ago

Authors with one or more affiliations in the final JSON record have just the first one. The final record should have all affiliations. Is it important, because it is used for the data of the country share. Examples: https://repo.scoap3.org/records/71662 , https://repo.scoap3.org/records/73618 It mainly happens from 2022 articles. Older articles (2020) look correct: https://repo.scoap3.org/records/58378

Solution: write a script, which extracts the authors' information fully. Run this script in QA, and later in Prod.

Figure it out, why is it happening? Did the code change? Did the files' structure change?

ErnestaP commented 9 months ago

Run a script on one of the articles on QA: https://repo.qa.scoap3.org/records/61453

Image

Image


@pamfilos Code: https://github.com/SCOAP3/scoap3-next/pull/448

agentilb commented 9 months ago

To me this looks correct for this article 👍

ErnestaP commented 9 months ago

Records bycontrol number and DOI:

Two articles were not updated because the affiliation is duplicated (QA):

59516: 10.1088/1674-1137/abcfab [{'country': 'China', 'value': 'Xinyang Normal University, Xinyang 464000, China'}, {'country': 'China', 'value': 'Xinyang Normal University, Xinyang 464000, China'}] has non-unique elements

65034: 10.1088/1674-1137/ac5c2e ValidationError: [{'country': 'Italy', 'institution': '(A)University of Turin, I-10125, Turin, Italy; (B)University of Eastern Piedmont, I-15121, Alessandria, Italy; (C)INFN, I-10125, Italy'}, {'country': 'Italy', 'institution': '(A)University of Turin, I-10125, Turin, Italy; (B)University of Eastern Piedmont, I-15121, Alessandria, Italy; (C)INFN, I-10125, Italy'}] has non-unique elements

Updated records (QA):

{'59264': '10.1088/1674-1137/abc1d5', '59268': '10.1088/1674-1137/abc241', '59269': '10.1088/1674-1137/abc242', '59270': '10.1088/1674-1137/abc244', '59271': '10.1088/1674-1137/abc538', '59272': '10.1088/1674-1137/abc539', '59273': '10.1088/1674-1137/abc682', '59274': '10.1088/1674-1137/abc683', '59275': '10.1088/1674-1137/abc0cc', '59276': '10.1088/1674-1137/abc169', '59277': '10.1088/1674-1137/abc245', '59458': '10.1088/1674-1137/abcfaa', '59543': '10.1088/1674-1137/abd92a', '59566': '10.1088/1674-1137/abcc5b', '59588': '10.1088/1674-1137/abcd90', '61257': '10.1088/1674-1137/ac061c', '61260': '10.1088/1674-1137/abce4f', '61262': '10.1088/1674-1137/abd088', '61266': '10.1088/1674-1137/abce10', '61268': '10.1088/1674-1137/abcf22', '61270': '10.1088/1674-1137/abcfac', '61271': '10.1088/1674-1137/abd01a', '61272': '10.1088/1674-1137/abce50', '61275': '10.1088/1674-1137/abd084', '61279': '10.1088/1674-1137/abe03c', '61280': '10.1088/1674-1137/abe19a', '61282': '10.1088/1674-1137/abe197', '61287': '10.1088/1674-1137/abe110', '61289': '10.1088/1674-1137/abdfbe', '61290': '10.1088/1674-1137/abe199', '61291': '10.1088/1674-1137/abdf43', '61294': '10.1088/1674-1137/abde2e', '61295': '10.1088/1674-1137/abe19b', '61297': '10.1088/1674-1137/abe195', '61300': '10.1088/1674-1137/abfb5f', '61302': '10.1088/1674-1137/abfb50', '61303': '10.1088/1674-1137/abf828', '61307': '10.1088/1674-1137/abfc38', '61308': '10.1088/1674-1137/abfe51', '61309': '10.1088/1674-1137/ac1668', '61311': '10.1088/1674-1137/abf9ff', '61313': '10.1088/1674-1137/abe8cf', '61314': '10.1088/1674-1137/abfd28', '61319': '10.1088/1674-1137/abe9a2', '61320': '10.1088/1674-1137/abeb07', '61324': '10.1088/1674-1137/abe36d', '61325': '10.1088/1674-1137/abf4f6', '61326': '10.1088/1674-1137/abefca', '61332': '10.1088/1674-1137/abf13a', '61337': '10.1088/1674-1137/ac0c6f', '61339': '10.1088/1674-1137/ac0ee2', '61341': '10.1088/1674-1137/ac0e88', '61342': '10.1088/1674-1137/ac0ee4', '61347': '10.1088/1674-1137/ac0e8a', '61350': '10.1088/1674-1137/ac0e8b', '61351': '10.1088/1674-1137/ac1bfd', '61352': '10.1088/1674-1137/ac1b9a', '61353': '10.1088/1674-1137/ac1ef9', '61354': '10.1088/1674-1137/ac21b8', '61355': '10.1088/1674-1137/ac1d9c', '61356': '10.1088/1674-1137/ac224b', '61357': '10.1088/1674-1137/ac1e09', '61358': '10.1088/1674-1137/ac1c66', '61453': '10.1088/1674-1137/ac2a25', '61454': '10.1088/1674-1137/ac2b12', '61461': '10.1088/1674-1137/ac2ed1', '61463': '10.1088/1674-1137/ac2f95', '61592': '10.1088/1674-1137/abccac', '61597': '10.1088/1674-1137/abd16d', '61644': '10.1088/1674-1137/ac1575', '61728': '10.1088/1674-1137/ac3fab', '61731': '10.1088/1674-1137/ac3faa', '61732': '10.1088/1674-1137/ac3fae', '61733': '10.1088/1674-1137/ac3d2b', '61735': '10.1088/1674-1137/ac3fac', '64998': '10.1088/1674-1137/ac5b0e', '65000': '10.1088/1674-1137/ac4704', '65002': '10.1088/1674-1137/ac4ee8', '65007': '10.1088/1674-1137/ac4f4c', '65015': '10.1088/1674-1137/ac5fa2', '65016': '10.1088/1674-1137/ac6490', '65017': '10.1088/1674-1137/ac4df1', '65019': '10.1088/1674-1137/ac68d7', '65020': '10.1088/1674-1137/ac66cc', '65022': '10.1088/1674-1137/ac6cd3', '65023': '10.1088/1674-1137/ac6cd5', '65025': '10.1088/1674-1137/ac6d4e', '65026': '10.1088/1674-1137/ac67d0', '65028': '10.1088/1674-1137/ac68da', '65029': '10.1088/1674-1137/ac6665', '65030': '10.1088/1674-1137/ac6cd8', '65031': '10.1088/1674-1137/ac6573', '65032': '10.1088/1674-1137/ac6d51', '65033': '10.1088/1674-1137/ac6cd6', '65036': '10.1088/1674-1137/ac6b92', '65679': '10.1088/1674-1137/ac87f1', '65680': '10.1088/1674-1137/ac8789', '65681': '10.1088/1674-1137/ac89d0', '65682': '10.1088/1674-1137/ac89d1', '65683': '10.1088/1674-1137/ac8cd5', '65684': '10.1088/1674-1137/ac930b', '65685': '10.1088/1674-1137/ac92da', '65686': '10.1088/1674-1137/ac88bb', '65687': '10.1088/1674-1137/ac92d8', '65689': '10.1088/1674-1137/ac957c', '65691': '10.1088/1674-1137/ac8651', '65692': '10.1088/1674-1137/ac90af', '65696': '10.1088/1674-1137/ac8bc9', '65697': '10.1088/1674-1137/ac878c', '65700': '10.1088/1674-1137/aca00d', '65701': '10.1088/1674-1137/ac9895', '65702': '10.1088/1674-1137/ac957b', '65703': '10.1088/1674-1137/ac9deb', '65706': '10.1088/1674-1137/aca38d', '65707': '10.1088/1674-1137/ac9de9', '65708': '10.1088/1674-1137/aca585', '65709': '10.1088/1674-1137/ac9897', '65711': '10.1088/1674-1137/aca1aa', '65715': '10.1088/1674-1137/aca959', '65718': '10.1088/1674-1137/ac9d28', '65720': '10.1088/1674-1137/aca888', '65724': '10.1088/1674-1137/ac80b4', '65728': '10.1088/1674-1137/acaa22', '65729': '10.1088/1674-1137/aca8f6', '65732': '10.1088/1674-1137/acaf26', '65734': '10.1088/1674-1137/ac9896', '65736': '10.1088/1674-1137/acc1cf', '65741': '10.1088/1674-1137/acac6d', '65744': '10.1088/1674-1137/acbbc0', '65746': '10.1088/1674-1137/acac69', '65748': '10.1088/1674-1137/acc641', '65750': '10.1088/1674-1137/acc92d', '65756': '10.1088/1674-1137/acc4ab', '65759': '10.1088/1674-1137/acc3f4'}

ErnestaP commented 9 months ago

@agentilb please verify, can I make the same change on Production

agentilb commented 9 months ago

I did not check all the records, but it seems to work!

But strange that the 2 records you mentioned did not work, it seems ok on the production site. Or maybe we did a manual cleaning?

ErnestaP commented 9 months ago

No, production is not been manually cleaned yet. All the articles I mentioned here are fixed in QA, not PROD. We will have the same problem in production with 2 mentioned articles

agentilb commented 9 months ago

I guess you can put the changes in production, and we'll clean manually the 2 articles. Is it ok like this?

ErnestaP commented 9 months ago

Sure, I done it by slightly changing the code: I removed duplicated affiliations before updating the record.

Also, @agentilb , I noticed that the parsing error also affected older OUP ( from 2020). For example https://repo.scoap3.org/records/59896

The change of the code is submitted and waiting for review. Then we can deploy it to QA, and test it.

Records updated in PROD: ['10.1088/1674-1137/abc539', '10.1088/1674-1137/abc538', '10.1088/1674-1137/abc683', '10.1088/1674-1137/abdfbd', '10.1088/1674-1137/abc245', '10.1088/1674-1137/abc16d', '10.1088/1674-1137/abc240', '10.1088/1674-1137/abe110', '10.1088/1674-1137/abc23f', '10.1088/1674-1137/abc241', '10.1088/1674-1137/acc4ab', '10.1088/1674-1137/acc44c', '10.1088/1674-1137/acc642', '10.1088/1674-1137/acc8bf', '10.1088/1674-1137/acc641', '10.1088/1674-1137/acc92d', '10.1088/1674-1137/acc9a2', '10.1088/1674-1137/ac9895', '10.1088/1674-1137/acac69', '10.1088/1674-1137/aca4c2', '10.1088/1674-1137/ac957a', '10.1088/1674-1137/ac67fe', '10.1088/1674-1137/ac4bcc', '10.1088/1674-1137/ac2a1a', '10.1088/1674-1137/ac3faa', '10.1088/1674-1137/ac3d2b', '10.1088/1674-1137/aca466', '10.1088/1674-1137/ac9d28', '10.1088/1674-1137/acbaea', '10.1088/1674-1137/acaf26', '10.1088/1674-1137/aca1aa', '10.1088/1674-1137/ac4975', '10.1088/1674-1137/ac5fa2', '10.1088/1674-1137/ac9896', '10.1088/1674-1137/ac2ed3', '10.1088/1674-1137/ac2f93', '10.1088/1674-1137/ac8653', '10.1088/1674-1137/ac2ed0', '10.1088/1674-1137/ac8652', '10.1088/1674-1137/ac2ed1', '10.1088/1674-1137/ac827b', '10.1088/1674-1137/ac7f21', '10.1088/1674-1137/ac5b0e', '10.1088/1674-1137/ac68da', '10.1088/1674-1137/ac6666', '10.1088/1674-1137/ac8c21', '10.1088/1674-1137/ac71a6', '10.1088/1674-1137/ac6b92', '10.1088/1674-1137/ac7317', '10.1088/1674-1137/ac7eb2', '10.1088/1674-1137/ac92d8', '10.1088/1674-1137/ac6dc6', '10.1088/1674-1137/ac79aa', '10.1088/1674-1137/ac6cd6', '10.1088/1674-1137/ac6daa', '10.1088/1674-1137/ac9d29', '10.1088/1674-1137/ac3fa9', '10.1088/1674-1137/ac7b75', '10.1088/1674-1137/ac567e', '10.1088/1674-1137/ac8651', '10.1088/1674-1137/ac5c2d', '10.1088/1674-1137/aca00d', '10.1088/1674-1137/ac3fae', '10.1088/1674-1137/ac8cd5', '10.1088/1674-1137/acb7ce', '10.1088/1674-1137/ac88bb', '10.1088/1674-1137/acbc0e', '10.1088/1674-1137/ac2359', '10.1088/1674-1137/ac3df2', '10.1088/1674-1137/ac600b', '10.1088/1674-1137/ac945a', '10.1088/1674-1137/aca465', '10.1088/1674-1137/aca38d', '10.1088/1674-1137/ac5f9c', '10.1088/1674-1137/ac957b', '10.1088/1674-1137/ac936b', '10.1088/1674-1137/ac930b', '10.1088/1674-1137/ac9e4c', '10.1088/1674-1137/acb994', '10.1088/1674-1137/acaa22', '10.1088/1674-1137/aca95a', '10.1088/1674-1137/ac84cc', '10.1088/1674-1137/ac57b6', '10.1088/1674-1137/ac7200', '10.1088/1674-1137/ac6e35', '10.1088/1674-1137/ac6ed2', '10.1088/1674-1137/ac5a3a', '10.1088/1674-1137/ac538c', '10.1088/1674-1137/ac581b', '10.1088/1674-1137/ac7547', '10.1088/1674-1137/ac7041', '10.1088/1674-1137/ac69ba', '10.1088/1674-1137/ac6490', '10.1088/1674-1137/acb8a4', '10.1088/1674-1137/ac4ee8', '10.1088/1674-1137/acb7d1', '10.1088/1674-1137/ac9aab', '10.1088/1674-1137/ac9897', '10.1088/1674-1137/ac5f9d', '10.1088/1674-1137/ac4df1', '10.1088/1674-1137/aca95c', '10.1088/1674-1137/ac988a', '10.1088/1674-1137/ac9889', '10.1088/1674-1137/ac9dea', '10.1088/1674-1137/aca888', '10.1088/1674-1137/ac4f4c', '10.1088/1674-1137/ac957c', '10.1088/1674-1137/ac3fab', '10.1088/1674-1137/acac6d', '10.1088/1674-1137/ac3d8c', '10.1088/1674-1137/ac500e', '10.1088/1674-1137/ac3fa8', '10.1088/1674-1137/ac6d4e', '10.1088/1674-1137/ac87f1', '10.1088/1674-1137/ac3124', '10.1088/1674-1137/ac3fa6', '10.1088/1674-1137/ac2a1d', '10.1088/1674-1137/ac2a1e', '10.1088/1674-1137/ac6cd8', '10.1088/1674-1137/ac92da', '10.1088/1674-1137/aca200', '10.1088/1674-1137/ac80ef', '10.1088/1674-1137/ac82e1', '10.1088/1674-1137/ac84ca', '10.1088/1674-1137/ac945c', '10.1088/1674-1137/ac80b4', '10.1088/1674-1137/ac3071', '10.1088/1674-1137/ac90af', '10.1088/1674-1137/ac745a', '10.1088/1674-1137/ac4c9f', '10.1088/1674-1137/ac6d51', '10.1088/1674-1137/ac5010', '10.1088/1674-1137/ac7cd8', '10.1088/1674-1137/ac763c', '10.1088/1674-1137/ac7299', '10.1088/1674-1137/ac5318', '10.1088/1674-1137/ac4694', '10.1088/1674-1137/ac89d1', '10.1088/1674-1137/ac6a4f', '10.1088/1674-1137/acb6de', '10.1088/1674-1137/acb993', '10.1088/1674-1137/acb997', '10.1088/1674-1137/ac3122', '10.1088/1674-1137/ac9deb', '10.1088/1674-1137/acb3b3', '10.1088/1674-1137/aca38f', '10.1088/1674-1137/ac3fac', '10.1088/1674-1137/aca8f6', '10.1088/1674-1137/acb48c', '10.1088/1674-1137/ac8bc9', '10.1088/1674-1137/ac338e', '10.1088/1674-1137/ac9de9', '10.1088/1674-1137/acbbc0', '10.1088/1674-1137/ac62ca', '10.1088/1674-1137/acb6eb', '10.1088/1674-1137/ac6a4e', '10.1088/1674-1137/ac4cb5', '10.1088/1674-1137/ac93ed', '10.1088/1674-1137/aca959', '10.1088/1674-1137/aca585', '10.1088/1674-1137/ac6e37', '10.1088/1674-1137/ac878c', '10.1088/1674-1137/ac39fd', '10.1088/1674-1137/ac8539', '10.1088/1674-1137/ac531a', '10.1088/1674-1137/ac2ffa', '10.1088/1674-1137/ac2f95', '10.1088/1674-1137/ac5c2e', '10.1088/1674-1137/ac425a', '10.1088/1674-1137/ac600c', '10.1088/1674-1137/ac5db9', '10.1088/1674-1137/ac7c63', '10.1088/1674-1137/ac78d1', '10.1088/1674-1137/ac6573', '10.1088/1674-1137/ac68d7', '10.1088/1674-1137/ac424c', '10.1088/1674-1137/ac6665', '10.1088/1674-1137/ac4704', '10.1088/1674-1137/ac7a1c', '10.1088/1674-1137/ac8789', '10.1088/1674-1137/accc1e', '10.1088/1674-1137/acc648', '10.1088/1674-1137/abe36b', '10.1088/1674-1137/abfd28', '10.1088/1674-1137/accc1c', '10.1088/1674-1137/accb87', '10.1088/1674-1137/accc1d', '10.1088/1674-1137/accf6d', '10.1088/1674-1137/acbf2a', '10.1088/1674-1137/acbf2c', '10.1088/1674-1137/acc1ca', '10.1088/1674-1137/acc3f4', '10.1088/1674-1137/acc1cf', '10.1088/1674-1137/acc1cb', '10.1088/1674-1137/abd92a', '10.1088/1674-1137/abcd8c', '10.1088/1674-1137/abd088', '10.1088/1674-1137/abce10', '10.1088/1674-1137/abcd2c', '10.1088/1674-1137/abd01a', '10.1088/1674-1137/abccac', '10.1088/1674-1137/abd16d', '10.1088/1674-1137/ac06ba', '10.1088/1674-1137/abca2c', '10.1088/1674-1137/abf4f4', '10.1088/1674-1137/abc16b', '10.1088/1674-1137/abc16a', '10.1088/1674-1137/abc242', '10.1088/1674-1137/abcf22', '10.1088/1674-1137/abf8a2', '10.1088/1674-1137/abf9ff', '10.1088/1674-1137/abfb5f', '10.1088/1674-1137/abf829', '10.1088/1674-1137/abfe51', '10.1088/1674-1137/abc1d3', '10.1088/1674-1137/abc1d5', '10.1088/1674-1137/ac1c66', '10.1088/1674-1137/ac224b', '10.1088/1674-1137/ac1d9c', '10.1088/1674-1137/abfc38', '10.1088/1674-1137/ac1b9a', '10.1088/1674-1137/ac1bfd', '10.1088/1674-1137/ac21b8', '10.1088/1674-1137/ac1ef9', '10.1088/1674-1137/ac1e09', '10.1088/1674-1137/abc682', '10.1088/1674-1137/abc0cc', '10.1088/1674-1137/abc169', '10.1088/1674-1137/abcc5b', '10.1088/1674-1137/abccad', '10.1088/1674-1137/abe19a', '10.1088/1674-1137/ac1577', '10.1088/1674-1137/abe03c', '10.1088/1674-1137/abe0be', '10.1088/1674-1137/abca2b', '10.1088/1674-1137/abcfac', '10.1088/1674-1137/abdea9', '10.1088/1674-1137/abce50', '10.1088/1674-1137/abe197', '10.1088/1674-1137/abdeab', '10.1088/1674-1137/abd084', '10.1088/1674-1137/abe198', '10.1088/1674-1137/abf828', '10.1088/1674-1137/abfb50', '10.1088/1674-1137/abe0bc', '10.1088/1674-1137/abf827', '10.1088/1674-1137/abc244', '10.1088/1674-1137/abce4f', '10.1088/1674-1137/abf72e', '10.1088/1674-1137/abde2e', '10.1088/1674-1137/abe0c0', '10.1088/1674-1137/abe03b', '10.1088/1674-1137/abde2d', '10.1088/1674-1137/abe19b', '10.1088/1674-1137/abe195', '10.1088/1674-1137/abe199', '10.1088/1674-1137/abe9a2', '10.1088/1674-1137/abdf43', '10.1088/1674-1137/abe1c7', '10.1088/1674-1137/abdea7', '10.1088/1674-1137/abe3ec', '10.1088/1674-1137/abdfbe', '10.1088/1674-1137/ac0e88', '10.1088/1674-1137/ac0ba4', '10.1088/1674-1137/ac0c0e', '10.1088/1674-1137/ac0e8b', '10.1088/1674-1137/ac0b38', '10.1088/1674-1137/abe8cf', '10.1088/1674-1137/abe36d', '10.1088/1674-1137/abe84d', '10.1088/1674-1137/abeb06', '10.1088/1674-1137/abeb07', '10.1088/1674-1137/abcfaa', '10.1088/1674-1137/abcf1f', '10.1088/1674-1137/abf4f6', '10.1088/1674-1137/abe8ce', '10.1088/1674-1137/abcfab', '10.1088/1674-1137/abcd2f', '10.1088/1674-1137/ac1b97', '10.1088/1674-1137/ac0ee5', '10.1088/1674-1137/ac1668', '10.1088/1674-1137/ac1934', '10.1088/1674-1137/abfa83', '10.1088/1674-1137/abdf40', '10.1088/1674-1137/abeda6', '10.1088/1674-1137/ac0e8a', '10.1088/1674-1137/ac0b3c', '10.1088/1674-1137/abc0ce', '10.1088/1674-1137/abf489', '10.1088/1674-1137/ac0c6f', '10.1088/1674-1137/ac0ee2', '10.1088/1674-1137/ac0b3b', '10.1088/1674-1137/ac0ee4', '10.1088/1674-1137/ac0c70', '10.1088/1674-1137/ac0c0d', '10.1088/1674-1137/ac1ac4', '10.1088/1674-1137/abcd90', '10.1088/1674-1137/abcd8f', '10.1088/1674-1137/abeda8', '10.1088/1674-1137/ac06ac', '10.1088/1674-1137/abf13a', '10.1088/1674-1137/abefca', '10.1088/1674-1137/abec68', '10.1088/1674-1137/ac061c', '10.1088/1674-1137/abf139', '10.1088/1674-1137/abf13b', '10.1088/1674-1137/abf1de', '10.1088/1674-1137/ac1575', '10.1088/1674-1137/acac6c', '10.1088/1674-1137/acd365', '10.1088/1674-1137/acd23e', '10.1088/1674-1137/acd367', '10.1088/1674-1137/acc792', '10.1088/1674-1137/acd3da', '10.1088/1674-1137/ace9c8', '10.1088/1674-1137/ace17e', '10.1088/1674-1137/ace312', '10.1088/1674-1137/acd364', '10.1088/1674-1137/acdd60', '10.1088/1674-1137/acd9bf', '10.1088/1674-1137/ace521', '10.1088/1674-1137/ace9c2', '10.1088/1674-1137/ace9c7', '10.1088/1674-1137/ace17f', '10.1088/1674-1137/ac88bd', '10.1088/1674-1137/aceae9', '10.1088/1674-1137/ace354', '10.1088/1674-1137/ace708', '10.1088/1674-1137/ace81d', '10.1088/1674-1137/ace821', '10.1088/1674-1137/ace424', '10.1088/1674-1137/ace820', '10.1088/1674-1137/ace5a6', '10.1088/1674-1137/aceee1', '10.1088/1674-1137/ace8f4', '10.1088/1674-1137/ace5a7', '10.1088/1674-1137/ace81f', '10.1088/1674-1137/acf036', '10.1088/1674-1137/ac67d0', '10.1088/1674-1137/ac89d0', '10.1088/1674-1137/ac2a25', '10.1088/1674-1137/ac2b12', '10.1088/1674-1137/ac66cc', '10.1088/1674-1137/ac6cd3', '10.1088/1674-1137/ac6cd5'

ErnestaP commented 9 months ago

Hi @agentilb , the change of code is deployed on QA. The newly harvested files, just a few examples:

https://repo.qa.scoap3.org/records/68823 https://repo.qa.scoap3.org/records/68824 https://repo.qa.scoap3.org/records/65704 https://repo.qa.scoap3.org/records/61636 https://repo.qa.scoap3.org/records/68822 https://repo.qa.scoap3.org/records/68821