- Meeting with Peter and Abenet about CGSpace goals and progress
- Test submission to DSpace via REST API to see if Abenet can fix / reject it (submit workflow?)
- Get Peter a list of users who have submitted or approved on DSpace everrrrrrr, so he can remove some
- Ask MEL for a dump of their types to reconcile with ours and CG Core
- Need to tag ILRI collection with license!! For pre-2010 use "Other" unless a license is already there; 2010-2020 do the ilri content in batches (2010-2015: CC-BY-NC-SA; 2016-onwards: CC-BY);
- ONLY if ILRI / International Livestock Research Institute is the publisher, no journal articles, no book chapters...
- I tried to export the ILRI community from CGSpace but I got an error:
Exporting community 'International Livestock Research Institute (ILRI)' (10568/1)
Exception: null
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:212)
at com.google.common.collect.Iterators.concat(Iterators.java:464)
at org.dspace.app.bulkedit.MetadataExport.addItemsToResult(MetadataExport.java:136)
at org.dspace.app.bulkedit.MetadataExport.buildFromCommunity(MetadataExport.java:125)
at org.dspace.app.bulkedit.MetadataExport.<init>(MetadataExport.java:77)
at org.dspace.app.bulkedit.MetadataExport.main(MetadataExport.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
```
- I imported the production database to my local development environment and I get the same error... WTF is this?
- I was able to export another smaller community
- I filed [an issue](https://tracker.atmire.com/tickets-cgiar-ilri/view-ticket?id=919) with Atmire to see if it is likely something of theirs, or if I need to ask on the dspace-tech mailing list
- CodeObia sent a [pull request](https://github.com/ilri/OpenRXV/pull/71) with fixes for several issues we highlighted in OpenRXV
- I deployed the fixes on production, as they only affect minor parts of the frontend, and two of the four are working
- I sent feedback to CodeObia
## 2021-02-02
- Communicate more with CodeObia about some fixes for OpenRXV
- Maria Garruccio sent me some new ORCID iDs for Bioversity authors, as well as a correction for Stefan Burkart's iD
- I saved the new ones to a text file, combined them with the others, extracted the ORCID iDs themselves, and updated the names using `resolve-orcids.py`:
- Then for the rest, I saved them to a text file, combined them with the others, extracted the ORCID iDs themselves, and updated the names using `resolve-orcids.py`:
- I also looked up which of these new authors might have existing items that are missing ORCID iDs
- I had to port my `add-orcid-identifiers-csv.py` to DSpace 6 UUIDs and I think it's working but I want to do a few more tests because it uses a sequence for the metadata_value_id
## 2021-02-03
- Tag forty-three items from Bioversity's new authors with ORCID iDs using `add-orcid-identifiers-csv.py`:
- I'm working on the CGSpace accession for Karl Rich's [Viet Nam Pig Model 2018](https://github.com/ilri/vietnam-pig-model-2018) and I noticed his ORCID iD is missing from CGSpace
- I added it and tagged 141 items of his with the iD
- I [uploaded a metadata-only accession](https://hdl.handle.net/10568/111126) for the impact of ILRI book by John McIntire and Delia Grace to CGSpace
- The source code itself is here: https://github.com/ilri/impact-book
- A little bit more work on CG Core v2
## 2021-02-04
- Re-sync CGSpace database and Solr to DSpace Test to start a public test of CG Core v2
- Afterwards I updated Discovery and OAI:
```console
$ time chrt -b 0 dspace index-discovery -b
$ dspace oai import -c
```
- Attend Accenture meeting for repository managers
- Not clear what the SMO wants to get out of us
- Enrico asked for some notes about our work on AReS in 2020 for CRP Livestock reporting
- Abenet and I came up with the following:
> In 2020 we funded the third phase of development on the OpenRXV platform that powers AReS. This phase focused mainly on improving the search filtering, graphical visualizations, and reporting capabilities. It is now possible to create custom reports in Excel, Word, and PDF formats using a templating system. We also concentrated on making the vanilla OpenRXV platform easier to deploy and administer in hopes that other organizations would begin using it. Lastly, we identified and fixed a handful of bugs in the system. All development takes place publicly on GitHub: https://github.com/ilri/OpenRXV.
> In the last quarter of 2020, ILRI conducted a briefing for nearly 100 scientists and communications staff on how to use ARes as a visualization tool for repository outputs and as a reporting tool (https://hdl.handle.net/10568/110527). Staff will begin using AReS to generate lists of their outputs to upload in the performance evaluation system to assist in their performance evaluation. The list of publications they will upload from AReS to Performax will indicate the open access status of each publication to help start discussion why some outputs are not open access given the open access policies of the CGIAR.
- Call Moayad to discuss OpenRXV development
- We talked about the "reporting period" (date-based statistics) and some of the issues Abdullah is working on on GitHub
- I suggested that we offer the date-range statistics in a modal dialog with other sorting and grouping options during report generation
- Peter sent me the cleaned up series that I had originally sent him in 2020-10
- Institutionalization of quality assurance mechanism and dissemination of top quality commercial products to increase crop yields and improve food security of smallholder farmers in sub-Saharan Africa – COMPRO-II
- Manuel pour les Banques de Gènes;1
- Sistematización de experiencias Proyecto ACORDAR
- Talk to Abdullah from CodeObia about a few of the issues we filed on OpenRXV
- Verify a fix he made for the issue with spaces in template file names
- He says that the [Angular expressions support should be enabled](https://github.com/ilri/OpenRXV/issues/49), but I tried it and couldn't get a few simple examples working
- Atmire responded to a few issues today:
- First, the one about a crash while exporting a community CSV, which appears to be a [vanilla DSpace issue with a patch in DSpace 6.4](https://jira.lyrasis.org/browse/DS-4211)
- Second, the MQM batch consumer issue, which appears to be harmless log spam in *most* cases and they have sent a patch that adjusts the logging as such
- Third, a version bump for CUA to fix the `java.lang.UnsupportedOperationException: Multiple update components target the same field:solr_update_time_stamp` error
- I cherry-picked the patches for DS-4111 and was able to export the ILRI community finally, but the results are almost twice as many items as in the community!
- Investigating with csvcut I see there are some ids that appear up to five, six, or seven times!
```console
$ csvcut -c id /tmp/2021-02-10-ILRI.csv | sed '1d' | wc -l
30354
$ csvcut -c id /tmp/2021-02-10-ILRI.csv | sed '1d' | sort -u | wc -l
18555
$ csvcut -c id /tmp/2021-02-10-ILRI.csv | sed '1d' | sort | uniq -c | sort -h | tail
5 c21a79e5-e24e-4861-aa07-e06703d1deb7
5 c2460aa1-ae28-4003-9a99-2d7c5cd7fd38
5 d73fb3ae-9fac-4f7e-990f-e394f344246c
5 dc0e24fa-b7f5-437e-ac09-e15c0704be00
5 dc50bcca-0abf-473f-8770-69d5ab95cc33
5 e714bdf9-cc0f-4d9a-a808-d572e25c9238
6 7dfd1c61-9e8c-4677-8d41-e1c4b11d867d
6 fb76888c-03ae-4d53-b27d-87d7ca91371a
6 ff42d1e6-c489-492c-a40a-803cabd901ed
7 094e9e1d-09ff-40ca-a6b9-eca580936147
```
- I added a comment to that bug to ask if this is a side effect of the patch
- I started working on tagging pre-2010 ILRI items with license information, like we talked about with Peter and Abenet last week
- Due to the export bug I had to sort and remove duplicates first, then use csvgrep to filter out books and journal articles:
- Run system updates, deploy latest `6_x-prod` branch, and reboot CGSpace (linode18)
- Normalize `text_lang` of DSpace item metadata on CGSpace:
```
dspace=# SELECT DISTINCT text_lang, count(text_lang) FROM metadatavalue WHERE dspace_object_id IN (SELECT uuid FROM item) GROUP BY text_lang ORDER BY count DESC;
text_lang | count
-----------+---------
en_US | 2567413
| 8050
en | 7601
| 0
(4 rows)
dspace=# UPDATE metadatavalue SET text_lang='en_US' WHERE dspace_object_id IN (SELECT uuid FROM item);
- Ah, actually 45.146.165.203 is making requests like this:
```console
"http://cgspace.cgiar.org:80/bitstream/handle/10568/238/Res_report_no3.pdf;jsessionid=7311DD88B30EEF9A8F526FF89378C2C5%' AND 4313=CONCAT(CHAR(113)+CHAR(98)+CHAR(106)+CHAR(112)+CHAR(113),(SELECT (CASE WHEN (4313=4313) THEN CHAR(49) ELSE CHAR(48) END)),CHAR(113)+CHAR(106)+CHAR(98)+CHAR(112)+CHAR(113)) AND 'XzQO%'='XzQO"
```
- I purged the hits from these two using my `check-spider-ip-hits.sh`:
```console
$ ./ilri/check-spider-ip-hits.sh -f /tmp/ips -p
Purging 4005 hits from 45.146.165.203 in statistics
Purging 3493 hits from 130.255.161.231 in statistics
Total number of bot hits purged: 7498
```
- Ugh, I looked in Solr for the top IPs in 2021-01 and found a few more of these Russian IPs so I purged them too:
```console
$ ./ilri/check-spider-ip-hits.sh -f /tmp/ips -p
Purging 27163 hits from 45.146.164.176 in statistics
Purging 19556 hits from 45.146.165.105 in statistics
Purging 15927 hits from 45.146.165.83 in statistics
Purging 8085 hits from 45.146.165.104 in statistics
- My god, and 64.39.99.15 is from Qualys, the domain scanning security people, who are making queries trying to see if we are vulnerable or something (wtf?)
- But I don't know if he wants the entire ILRI community, in which case he needs to get the collections recursively and iterate over them, or if his software can manage the iteration over the pages of item results using limit and offset
- Help proof and upload 1095 CIFOR items to DSpace Test for Abenet
- There were a few dozen issues with author affiliations, but the metadata was otherwise very good quality
- I ran the data through the csv-metadata-quality tool nevertheless to fix some minor formatting issues
- I uploaded it to DSpace Test to check for duplicates
- I added colorized output to the csv-metadata-quality tool and tagged [version 0.4.4 on GitHub](https://github.com/ilri/csv-metadata-quality/releases/tag/v0.4.4)
- Start looking at splitting the series name and number in `dcterms.isPartOf` now that we have migrated to CG Core v2
- The numbers will go to `cg.number`
- I notice there are about 100 series without a number, but they still have a semicolon, for example `Esporo 72;`
- I think I will replace those like this:
```console
localhost/dspace63= > UPDATE metadatavalue SET text_value = REGEXP_REPLACE(text_value, '^(.+?);$','\1', 'g') WHERE metadata_field_id=166 AND dspace_object_id IN (SELECT uuid FROM item) AND text_value ~ ';$';
UPDATE 104
```
- As for splitting the other values, I think I can export the `dspace_object_id` and `text_value` and then upload it as a CSV rather than writing a Python script to create the new metadata values
## 2021-02-22
- Check the results of the AReS harvesting from last night:
- CodeObia sent a [pull request for clickable countries on AReS](https://github.com/ilri/OpenRXV/pull/75)
- I deployed it and it seems to work, so I asked Abenet and Peter to test it so we can get feedback
- Remove semicolons from series names without numbers:
```console
dspace=# BEGIN;
dspace=# UPDATE metadatavalue SET text_value = REGEXP_REPLACE(text_value, '^(.+?);$','\1', 'g') WHERE metadata_field_id=166 AND dspace_object_id IN (SELECT uuid FROM item) AND text_value ~ ';$';
UPDATE 104
dspace=# COMMIT;
```
- Set all `text_lang` values on CGSpace to `en_US` to make the series replacements easier (this didn't work, read below):
```console
dspace=# BEGIN;
dspace=# UPDATE metadatavalue SET text_lang='en_US' WHERE text_lang !='en_US' AND dspace_object_id IN (SELECT uuid FROM item);
UPDATE 911
cgspace=# COMMIT;
```
- Then export all series with their IDs to CSV:
```console
dspace=# \COPY (SELECT dspace_object_id, text_value as "dcterms.isPartOf[en_US]" FROM metadatavalue WHERE metadata_field_id=166 AND dspace_object_id IN (SELECT uuid FROM item)) TO /tmp/2021-02-23-series.csv WITH CSV HEADER;
```
- In OpenRefine I trimmed and consolidated whitespace, then made some quick cleanups to normalize the fields based on a sanity check
- For example many Spore items are like "Spore, Spore 23"
- Also, "Agritrade, August 2002"
- Then I copied the column to a new one called `cg.number[en_US]` and split the values for each on the semicolon using `value.split(';')[0]` and `value.split(';')[1]`
- I tried to upload some of the series data to DSpace Test but I'm having an issue where some fields change that shouldn't
- It seems not all fields get updated when I set the text_lang globally, but if I updated it manually like this it works:
```console
dspace=# UPDATE metadatavalue SET text_lang='en_US' WHERE metadata_value_id=5355845;
UPDATE 1
```
- This also seems to work, using the id for just that one item:
```console
dspace=# UPDATE metadatavalue SET text_lang='en_US' WHERE dspace_object_id='9840d19b-a6ae-4352-a087-6d74d2629322';
UPDATE 37
```
- This seems to work better for some reason:
```console
dspacetest=# UPDATE metadatavalue SET text_lang='en_US' WHERE metadata_field_id=166 AND dspace_object_id IN (SELECT uuid FROM item);
UPDATE 18659
```
- I split the CSV file in batches of 5,000 using xsv, then imported them one by one in CGSpace:
- Export a list of journals for Peter to look through:
```console
localhost/dspace63= > \COPY (SELECT DISTINCT text_value as "cg.journal", count(*) FROM metadatavalue WHERE dspace_object_id IN (SELECT uuid FROM item) AND metadata_field_id=251 GROUP BY text_value ORDER BY count DESC) to /tmp/2021-02-24-journals.csv WITH CSV HEADER;
COPY 3345
```
- Start a fresh harvesting on AReS because Udana mapped some items today and wants to include them in his report:
- The current items index has 101380 items... I wonder what happened
- I started a new indexing
## 2021-02-26
- Last night's indexing was more successful, there are now 101479 items in the index
- Yesterday Yousef sent a [pull request](https://github.com/ilri/OpenRXV/pull/77/) for the next/previous buttons on OpenRXV
- I tested it this morning and it seems to be working
## 2021-02-28
- Abenet asked me to import seventy-three records for CRP Forests, Trees and Agroforestry
- I checked them briefly and found that there were thirty+ journal articles, and none of them had `cg.journal`, `cg.volume`, `cg.issue`, or `dcterms.license` so I spent a little time adding them
- I used a GREL expression to extract the journal volume and issue from the citation into new columns:
- This `value.partition` was new to me... and it took me a bit of time to figure out whether I needed to escape the parentheses in the issue number or not (no) and how to reference a capture group with `value.replace`
- I tried to check the 1095 CIFOR records from last week for duplicates on DSpace Test, but the page says "Processing" and never loads
- I don't see any errors in the logs, but there are two jQuery errors in the browser console
- I filed [an issue](https://tracker.atmire.com/tickets-cgiar-ilri/view-ticket?id=934) with Atmire
- Upload twelve items to CGSpace for Peter
- Niroshini from IWMI is still having issues adding WLE subjects to items during the metadata review step in the workflow
- It seems the BatchEditConsumer log spam is gone since I applied [Atmire's patch](https://github.com/ilri/DSpace/pull/462)
```console
$ grep -c 'BatchEditConsumer should not have been given' dspace.log.2021-02-[12]*