- Test the [DSpace 5.8 module upgrades from Atmire](https://tracker.atmire.com/tickets-cgiar-ilri/view-ticket?id=560) ([#378](https://github.com/ilri/DSpace/pull/378))
- There seems to be a problem with the CUA and L&R versions in `pom.xml` because they are using SNAPSHOT and it doesn't build
- I added the new CCAFS Phase II Project Tag `PII-FP1_PACCA2` and merged it into the `5_x-prod` branch ([#379](https://github.com/ilri/DSpace/pull/379))
- I proofed and tested the ILRI author corrections that Peter sent back to me this week:
- I think a sane proofing workflow in OpenRefine is to apply the custom text facets for check/delete/remove and illegal characters that I developed in [March, 2018]({{< relref "2018-03.md" >}})
- Gabriela from CIP got back to me about the author names we were correcting on CGSpace
- I did a quick sanity check on them and then did a test import with my [`fix-metadata-value.py`](https://gist.github.com/alanorth/df92cbfb54d762ba21b28f7cd83b6897) script:
- I spent some time removing the Atmire Metadata Quality Module (MQM) from the proposed DSpace 5.8 changes
- After removing all code mentioning MQM, mqm, metadata-quality, batchedit, duplicatechecker, etc, I think I got most of it removed, but there is a Spring error during Tomcat startup:
```
INFO [org.dspace.servicemanager.DSpaceServiceManager] Shutdown DSpace core service manager
Failed to startup the DSpace Service Manager: failure starting up spring service manager: Error creating bean with name 'org.dspace.servicemanager.spring.DSpaceBeanPostProcessor#0' defined in class path resource [spring/spring-dspace-applicationContext.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.dspace.servicemanager.config.DSpaceConfigurationService]: : Cannot find class [com.atmire.dspace.discovery.ItemCollectionPlugin] for bean with name 'itemCollectionPlugin' defined in file [/home/aorth/dspace/config/spring/api/discovery.xml];
```
- I can fix this by commenting out the `ItemCollectionPlugin` line of `discovery.xml`, but from looking at the git log I'm not actually sure if that is related to MQM or not
- I continued to look at Sisay's IITA records from last week
- I normalized all DOIs to use HTTPS and "doi.org" instead of "dx.doi.org"
- I cleaned up white space in `cg.subject.iita` and `dc.subject`
- Even a bunch of IITA and AGROVOC subjects are missing accents, ie "FERTILIT DU SOL"
- More organization names in `dc.description.sponsorship` are incorrect (ie, missing accents) or inconsistent (ie, CGIAR centers should be spelled in English or multiple spellings of the same one, like "Rockefeller Foundation" and "Rockefeller foundation")
- A few dozen items have abstracts with character encoding errors, ie:
- 33.7øC
- MgSO4ú7H2O
- ha??1&/sup;
- En gen6ral
- dÕpassÕ
- Also the abstracts have missing accents, ie "recherche sur le d veloppement"
- I will have to tell IITA people to redo these entirely I think...
- Sisay sent a new version of the last IITA records that he created from the original CSV from IITA
- The 200 records are in the [IITA_Junel_11 (10568/95870)](https://dspacetest.cgiar.org/handle/10568/95870) collection
- Many errors:
- Authorship types: "CGIAR ans advanced research institute", "CGAIR and advanced research institute", "CGIAR and advanced research institutes", "CGAIR single center"
- Lots of inconsistencies and mispellings in author affiliations:
- "Institut des Recherches Agricoles du Bénin" and "Institut National des Recherche Agricoles du Benin" and "National Agricultural Research Institute, Benin"
- International Insitute of Tropical Agriculture
- Centro Internacional de Agricultura Tropical
- "Rivers State University of Science and Technology" and "Rivers State University"
- "Institut de la Recherche Agronomique, Cameroon" and "Institut de Recherche Agronomique, Cameroon"
- Inconsistency in countries: "COTE D’IVOIRE" and "COTE D'IVOIRE"
- A few DOIs with spaces or invalid characters
- Inconsistency in IITA subjects, for example "PRODUCTION VEGETALE" and "PRODUCTION VÉGÉTALE" and several others
- I ran `value.unescape('javascript')` on the abstract and citation fields because it looks like this data came from a SQL database and some stuff was escaped
- It turns out that Abenet actually did a lot of small corrections on this data so when Sisay uses Bosede's original file it doesn't have all those corrections
- So I told Sisay to re-create the collection using Abenet's XLS from last week (`Mercy1805_AY.xls`)
- I was curious to see if I could create a GREL for use with a custom text facet in Open Refine to find cells with two or more consecutive spaces
- I always use the built-in trim and collapse transformations anyways, but this seems to work to find the offending cells: `isNotNull(value.match(/.*?\s{2,}.*?/))`
- I wonder if I should start checking for "smart" quotes like ’ (hex 2019)
- Regarding Udana's Book Chapters and Reports on DSpace Test last week, Abenet told him to fix some character encoding and CRP issues, then I told him I'd check them after that
- The latest batch of IITA's 200 records (based on Abenet's version `Mercy1805_AY.xls`) are now in the [IITA_Jan_9_II_Ab](https://dspacetest.cgiar.org/handle/10568/96071) collection
- So here are some corrections:
- use of Unicode smart quote (hex 2019) in countries and affiliations, for example "COTE D’IVOIRE" and "Institut d’Economic Rurale, Mali"
- inconsistencies in `cg.contributor.affiliation`:
- "Centro Internacional de Agricultura Tropical" and "Centro International de Agricultura Tropical" should use the English name of CIAT (International Center for Tropical Agriculture)
- "Institut International d'Agriculture Tropicale" should use the English name of IITA (International Institute of Tropical Agriculture)
- "East and Southern Africa Regional Center" and "Eastern and Southern Africa Regional Centre"
- "Institut de la Recherche Agronomique, Cameroon" and "Institut de Recherche Agronomique, Cameroon"
- "Institut des Recherches Agricoles du Bénin" and "Institut National des Recherche Agricoles du Benin" and "National Agricultural Research Institute, Benin"
- "Institute of Agronomic Research, Cameroon" and "Institute of Agronomy Research, Cameroon"
- "Rivers State University" and "Rivers State University of Science and Technology"
- "Universität Hannover" and "University of Hannover"
- inconsistencies in `cg.subject.iita`:
- "AMELIORATION DES PLANTES" and "AMÉLIORATION DES PLANTES"
- "PRODUCTION VEGETALE" and "PRODUCTION VÉGÉTALE"
- "CONTRÔLE DE MALADIES" and "CONTROLE DES MALADIES"
- "HANDLING, TRANSPORT, STORAGE AND PROTECTION OF AGRICULTURAL PRODUCT" and "HANDLING, TRANSPORT, STORAGE AND PROTECTION OF AGRICULTURAL PRODUCTS"
- "RAVAGEURS DE PLANTES" and "RAVAGEURS DES PLANTES"
- "SANTE DES PLANTES" and "SANTÉ DES PLANTES"
- "SOCIOECONOMIE" and "SOCIOECONOMY"
- inconsistencies in `dc.description.sponsorship`:
- "Belgian Corporation" and "Belgium Corporation"
- inconsistencies in `dc.subject`:
- "AFRICAN CASSAVA MOSAIC" and "AFRICAN CASSAVA MOSAIC DISEASE"
- "ASPERGILLU FLAVUS" and "ASPERGILLUS FLAVUS"
- "BIOTECHNOLOGIES" and "BIOTECHNOLOGY"
- "CASSAVA MOSAIC DISEASE" and "CASSAVA MOSAIC DISEASES" and "CASSAVA MOSAIC VIRUS"
- "CASSAVA PROCESSING" and "CASSAVA PROCESSING TECHNOLOGY"
- "CROPPING SYSTEM" and "CROPPING SYSTEMS"
- "DRY SEASON" and "DRY-SEASON"
- "FERTILIZER" and "FERTILIZERS"
- "LEGUME" and "LEGUMES"
- "LEGUMINOSAE" and "LEGUMINOUS"
- "LEGUMINOUS COVER CROP" and "LEGUMINOUS COVER CROPS"
- "MATÉRIEL DE PLANTATION" and "MATÉRIELS DE PLANTATION"
- I noticed that some records do have encoding errors in the `dc.description.abstract` field, but only four of them so probably not from Abenet's handling of the XLS file
- Based on manually eyeballing the text I used a custom text facet with this GREL to identify the records:
```
or(
value.contains('€'),
value.contains('6g'),
value.contains('6m'),
value.contains('6d'),
value.contains('6e')
)
```
- So IITA should double check the abstracts for these:
- Elizabeth from CIAT contacted me to ask if I could add ORCID identifiers to all of Robin Buruchara's items
- I used my [add-orcid-identifiers-csv.py](https://gist.githubusercontent.com/alanorth/a49d85cd9c5dea89cddbe809813a7050/raw/f67b6e45a9a940732882ae4bb26897a9b245ef31/add-orcid-identifiers-csv.py) script:
- I was restoring a PostgreSQL dump on my test machine and found a way to restore the CGSpace dump as the `postgres` user, but have the owner of the schema be the `dspacetest` user:
- The `-O` option to `pg_restore` makes the import process ignore ownership specified in the dump itself, and instead makes the schema owned by the user doing the restore
- I always prefer to use the `postgres` user locally because it's just easier than remembering the `dspacetest` user's password, but then I couldn't figure out why the resulting schema was owned by `postgres`
- So with this you connect as the `postgres` superuser and then switch roles to `dspacetest` (also, make sure this user has `superuser` privileges before the restore)
- Last week Linode emailed me to say that our Linode 8192 instance used for DSpace Test qualified for an upgrade
- Apparently they announced some [upgrades to most of their plans in 2018-05](https://blog.linode.com/2018/05/17/updated-linode-plans-new-larger-linodes/)
- After the upgrade I see we have more disk space available in the instance's dashboard, so I shut the instance down and resized it from 98GB to 160GB
- The resize was very quick (less than one minute) and after booting the instance back up I now have 160GB for the root filesystem!
- I will move the DSpace installation directory back to the root file system and delete the extra 300GB block storage, as it was actually kinda slow when we put Solr there and now we don't actually need it anymore because running the production Solr on this instance didn't work well with 8GB of RAM
- Also, the larger instance we're using for CGSpace will go from 24GB of RAM to 32, and will also get a storage increase from 320GB to 640GB... that means we don't need to consider using block storage right now!
- The smaller instances get increased storage and network speed but I doubt many are actually using much of their current allocations so we probably don't need to bother with upgrading them
- Last week Abenet asked if we could add `dc.language.iso` to the advanced search filters
- There is already a search filter for this field defined in `discovery.xml` but we aren't using it, so I quickly enabled and tested it, then merged it to the `5_x-prod` branch ([#380](https://github.com/ilri/DSpace/pull/380))
- Back to testing the DSpace 5.8 changes from Atmire, I had another issue with SQL migrations:
```
Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Found differences between applied migrations and available migrations: Detected applied migration missing on the classpath: 5.8.2015.12.03.3
```
- It took me a while to figure out that this migration is for MQM, which I removed after Atmire's original advice about the migrations so we actually need to delete this migration instead up updating it
- So I need to make sure to run the following during the DSpace 5.8 upgrade:
```
-- Delete existing CUA 4 migration if it exists
delete from schema_version where version = '5.6.2015.12.03.2';
-- Update version of CUA 4 migration
update schema_version set version = '5.6.2015.12.03.2' where version = '5.5.2015.12.03.2';
-- Delete MQM migration since we're no longer using it
delete from schema_version where version = '5.5.2015.12.03.3';
```
- After that you can run the migrations manually and then DSpace should work fine:
```
$ ~/dspace/bin/dspace database migrate ignored
...
Done.
```
- Elizabeth from CIAT contacted me to ask if I could add ORCID identifiers to all of Andy Jarvis' items on CGSpace
- I used my [add-orcid-identifiers-csv.py](https://gist.githubusercontent.com/alanorth/a49d85cd9c5dea89cddbe809813a7050/raw/f67b6e45a9a940732882ae4bb26897a9b245ef31/add-orcid-identifiers-csv.py) script:
- Atmire got back to me to say that we can remove the `itemCollectionPlugin` and`HasBitstreamsSSIPlugin` beans from DSpace's `discovery.xml` file, as they are used by the Metadata Quality Module (MQM) that we are not using anymore
- I removed both those beans and did some simple tests to check item submission, media-filter of PDFs, REST API, but got an error "No matches for the query" when listing records in OAI
- This warning appears in the DSpace log:
```
2018-06-26 16:58:12,052 WARN org.dspace.xoai.services.impl.xoai.DSpaceRepositoryConfiguration @ { OAI 2.0 :: DSpace } Not able to retrieve the dspace.oai.url property from oai.cfg. Falling back to request address
```
- It's actually only a warning and it also appears in the logs on DSpace Test (which is currently running DSpace 5.5), so I need to keep troubleshooting
- Ah, I think I just need to run `dspace oai import`
$ while read line; do sed -i "\#$line#d" 10568-92904.csv; done <cifor-handle-to-delete.txt
$ wc -l 10568-92904.csv
2399 10568-92904.csv
```
- This iterates over the handles for deletion and uses `sed` with an alternative pattern delimiter of '#' (which must be escaped), because the pattern itself contains a '/'
- The mapped ones will be difficult because we need their internal IDs in order to map them, and there are 50 of them:
- I can either get them from the databse, or programatically export the metadata using `dspace metadata-export -i 10568/xxxxx`...
- Oooh, I can export the items one by one, concatenate them together, remove the headers, and extract the `id` and `collection` columns using [csvkit](https://csvkit.readthedocs.io/):
```
$ while read line; do filename=${line/\//-}.csv; dspace metadata-export -i $line -f $filename; done < /tmp/cifor-handle-to-map.txt
$ sed '/^id/d' 10568-*.csv | csvcut -c 1,2 > map-to-cifor-archive.csv
```
- Then I can use Open Refine to add the "CIFOR Archive" collection to the mappings
- Importing the 2398 items via `dspace metadata-import` ends up with a Java garbage collection error, so I think I need to do it in batches of 1,000
- After deleting the 62 duplicates, mapping the 50 items from elsewhere in CGSpace, and uploading 2,398 unique items, there are a total of 2,448 items added in this batch
- I'll let Abenet take one last look and then move them to CGSpace
- There is nothing in the Tomcat or DSpace logs, but I see the following in `dmesg -T`:
```
[Thu Jun 28 00:00:30 2018] Out of memory: Kill process 14501 (java) score 701 or sacrifice child
[Thu Jun 28 00:00:30 2018] Killed process 14501 (java) total-vm:14926704kB, anon-rss:5693608kB, file-rss:0kB, shmem-rss:0kB
[Thu Jun 28 00:00:30 2018] oom_reaper: reaped process 14501 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
```
- Look over IITA's [IITA_Jan_9_II_Ab](https://dspacetest.cgiar.org/handle/10568/96071) collection from earlier this month on DSpace Test
- Bosede fixed a few things (and seems to have removed many French IITA subjects like `AMÉLIORATION DES PLANTES` and `SANTÉ DES PLANTES`)
- I still see at least one issue with author affiliations, and I didn't bother to check the AGROVOC subjects because it's such a mess aanyways
- I suggested that IITA provide an updated list of subject to us so we can include their controlled vocabulary in CGSpace, which would also make it easier to do automated validation