CGSpace Notes

Documenting day-to-day work on the CGSpace repository.

February, 2023

2023-02-01

  • Export CGSpace to cross check the DOI metadata with Crossref
    • I want to try to expand my use of their data to journals, publishers, volumes, issues, etc…
  • First, extract a list of DOIs for use with crossref-doi-lookup.py:
$ csvcut -c 'cg.identifier.doi[en_US]' ~/Downloads/2023-02-01-cgspace.csv \
  | csvgrep -c 1 -m 'doi.org' \
  | csvgrep -c 1 -m ' ' -i \
  | csvgrep -c 1 -r '.*cifor.*' -i \
  | sed 1d > /tmp/2023-02-01-dois.txt
$ ./ilri/crossref-doi-lookup.py -e a.orth@cgiar.org -i /tmp/2023-02-01-dois.txt -o ~/Downloads/2023-01-31-crossref-results.csv -d
  • Then extract the ID, DOI, journal, volume, issue, publisher, etc from the CGSpace dump and rename the cg.identifier.doi[en_US] to doi so we can join on it with the Crossref results file:
$ csvcut -c 'id,cg.identifier.doi[en_US],cg.journal[en_US],cg.volume[en_US],cg.issue[en_US],dcterms.publisher[en_US],cg.number[en_US],dcterms.license[en_US]' ~/Downloads/2023-02-01-cgspace.csv \
  | csvgrep -c 'cg.identifier.doi[en_US]' -r '.*cifor.*' -i \
  | sed -e '1s/cg.identifier.doi\[en_US\]/doi/' \
    -e 's_https://doi.org/__g' \
    -e 's_https://dx.doi.org/__g' \
  > /tmp/2023-02-01-cgspace-doi-metadata.csv
$ csvjoin -c doi /tmp/2023-02-01-cgspace-doi-metadata.csv ~/Downloads/2023-02-01-crossref-results.csv > /tmp/2023-02-01-cgspace-crossref-check.csv
  • And import into OpenRefine for analysis and cleaning
  • I just noticed that Crossref also has types, so we could use that in the future too!
  • I got a few corrections after examining manually, but I didn’t manage to identify any patterns that I could use to do any automatic matching or cleaning

2023-02-05

  • Normalize text lang attributes in PostgreSQL, run a quick Discovery index, and then export CGSpace to check Initiative mappings and countries/regions
  • Run all system updates on CGSpace (linode18) and reboot it

2023-02-06

2023-02-07

  • IFPRI’s web developer Tony managed to get his Drupal harvester to have a useful user agent:
54.x.x.x - - [06/Feb/2023:10:10:32 +0100] "POST /rest/items/find-by-metadata-field?limit=%22100&offset=0 HTTP/1.1" 200 58855 "-" "IFPRI drupal POST harvester"
  • He also noticed that there is no pagination on POST requests to /rest/items/find-by-metadata-field, and that he needs to increase his timeout for requests that return 100+ results, ie:
curl -f -H "Content-Type: application/json" -X POST "https://dspacetest.cgiar.org/rest/items/find-by-metadata-field" -d '{"key":"cg.subject.actionArea", "value":"Systems Transformation", "language": "en_US"}'
  • I need to ask on the DSpace Slack about this POST pagination
  • Abenet and Udana noticed that the Handle server was not running
    • Looking in the error.log file I see that the service is complaining about a lock file being present
    • This is because Linode had to do emergency maintenance on the VM host this morning and the Handle server didn’t shut down properly
  • I’m having an issue with poetry update so I spent some time debugging and filed an issue
  • Proof and import nine items for the Digital Innovation Inititive for IFPRI
    • There were only some minor issues in the metadata
    • I also did a duplicate check with check-duplicates.py just in case
  • I did some minor updates on csv-metadata-quality
    • First, to reduce warnings on non-SPDX licenses like “Copyrighted; all rights reserved” and “Other” since they are very common for us and I’m sick of seeing the warnings
    • Second, to skip whitespace and newline fixes on the abstract field since so many times they are intended

2023-02-08

  • Make some edits to IFPRI records requested by Jawoo and Leigh
  • Help Alessandra upload a last minute report for SAPLING
  • Proof and upload twenty-seven IFPRI records to CGSpace
    • It’s a good thing I did a duplicate check because I found three duplicates!
  • Export CGSpace to update Initiative mappings and country/region mappings
    • Then start a harvest on AReS