- Udana from IWMI asked me for a CSV export of their community on CGSpace
- I exported it, but a quick run through the `csv-metadata-quality` tool shows that there are some low-hanging fruits we can fix before I send him the data
- I will limit the scope to the titles, regions, subregions, and river basins for now to manually fix some non-breaking spaces (U+00A0) there that would otherwise be removed by the csv-metadata-quality script's "unneccesary Unicode" fix:
- Then I replace them in vim with `:% s/\%u00a0/ /g` because I can't figure out the correct sed syntax to do it directly from the pipe above
- I uploaded those to CGSpace and then re-exported the metadata
- Now that I think about it, I shouldn't be removing non-breaking spaces (U+00A0), I should be replacing them with normal spaces!
- I modified the script so it replaces the non-breaking spaces instead of removing them
- Then I ran the csv-metadata-quality script to do some general cleanups (though I temporarily commented out the whitespace fixes because it was too many thousands of rows):
- Release [version 0.3.1 of the csv-metadata-quality script](https://github.com/ilri/csv-metadata-quality/releases/tag/v0.3.1) with the non-breaking spaces change
- Create an account for Bioversity's ICT consultant Francesco on DSpace Test:
```
$ dspace user -a -m blah@mail.it -g Francesco -s Vernocchi -p 'fffff'
```
- Email Francesca and Carol to ask for follow up about the test upload I did on 2019-09-21
- I suggested that if they still want to do value addition of those records (like adding countries, regions, etc) that they could maybe do it after we migrate the records to CGSpace
- Carol responded to tell me where to map the items with type Brochure, Journal Item, and Thesis, so I applied them to the [collection on DSpace Test](https://dspacetest.cgiar.org/handle/10568/103688)
- Hector from CCAFS responded about my feedback of their CLARISA API
- He made some fixes to the metadata values they are using based on my feedback and said they are happy if we would use it
- Gabriela from CIP asked me if it was possible to generate an RSS feed of items that have the CIP subject "POTATO AGRI-FOOD SYSTEMS"
- I notice that there is a similar term "SWEETPOTATO AGRI-FOOD SYSTEMS" so I had to come up with a way to exclude that using the boolean "AND NOT" in the [OpenSearch query](https://cgspace.cgiar.org/open-search/discover?query=cipsubject:POTATO%20AGRI%E2%80%90FOOD%20SYSTEMS%20AND%20NOT%20cipsubject:SWEETPOTATO%20AGRI%E2%80%90FOOD%20SYSTEMS&scope=10568/51671&sort_by=3&order=DESC)
- Again, the `sort_by=3` parameter is the accession date, as configured in `dspace.cfg`
- Continue working on identifying duplicates in the Bioversity migration
- I have been recording the originals and duplicates in a spreadsheet so I can map them later
- For now I am just reconciling any incorrect or missing metadata in the original items on CGSpace, deleting the duplicate from DSpace Test, and mapping the original to the correct place on CGSpace
- So far I have deleted thirty duplicates and mapped fourteen
- Run all system updates on DSpace Test (linode19) and reboot the server
- After a few hours I think I finished all the duplicates that were identified by Atmire's Duplicate Checker module
- According to my spreadsheet there were fifty-two in total
- I was preparing to check the affiliations on the Bioversity records when I noticed that the last list of top affiliations I generated has some anomalies
- I made some corrections in a CSV:
```
from,to
CIAT,International Center for Tropical Agriculture
International Centre for Tropical Agriculture,International Center for Tropical Agriculture
International Maize and Wheat Improvement Center (CIMMYT),International Maize and Wheat Improvement Center
International Centre for Agricultural Research in the Dry Areas,International Center for Agricultural Research in the Dry Areas
International Maize and Wheat Improvement Centre,International Maize and Wheat Improvement Center
"Agricultural Information Resource Centre, Kenya.","Agricultural Information Resource Centre, Kenya"
"Centre for Livestock and Agricultural Development, Cambodia","Centre for Livestock and Agriculture Development, Cambodia"
```
- Then I applied it with my `fix-metadata-values.py` script on CGSpace:
```
$ ./fix-metadata-values.py -i /tmp/affiliations.csv -db dspace -u dspace -p 'fuuu' -f from -m 211 -t to
- I would still like to perhaps (re)move institutional authors from `dc.contributor.author` to `cg.contributor.affiliation`, but I will have to run that by Francesca, Carol, and Abenet
- I could use a custom text facet like this in OpenRefine to find authors that likely match the "Last, F." pattern: `isNotNull(value.match(/^.*, \p{Lu}\.?.*$/))`
- The `\p{Lu}` is a cool [regex character class](https://www.regular-expressions.info/unicode.html) to make sure this works for letters with accents
- As cool as that is, it's actually more effective to just search for authors that have "." in them!
- I've decided to add a `cg.contributor.affiliation` column to 1,025 items based on the logic above where the author name is not an actual person
- I talked to Peter about the Bioversity items and he said that we should add the institutional authors back to `dc.contributor.author`, because I had moved them to `cg.contributor.affiliation`
- Otherwise he said the data looks good
## 2019-10-15
- I did a test export / import of the Bioversity migration items on DSpace Test
$ sed -i '/<dcvalueelement="identifier"qualifier="uri">/d' 2019-10-15-Bioversity/*/dublin_core.xml
```
- It's really stupid, but for some reason the handles are included even though I specified the `-m` option, so after the export I removed the `dc.identifier.uri` metadata values from the items
- Then I imported a test subset of them in my local test environment:
- I had forgotten (again) that the `dspace export` command doesn't preserve collection ownership or mappings, so I will have to create a temporary collection on CGSpace to import these to, then do the mappings again after import...
- On CGSpace I will increase the RAM of the command line Java process for good luck before import...
- Create a test user for Mohammad Salem to test depositing from MEL to DSpace Test, as the last one I had created in 2019-08 was cleared when we re-syncronized DSpace Test with CGSpace recently.
- Give a presentationa (via WebEx) about open source software to the ILRI Open Access Week
- The title was *Making ILRI code open: Software as an International Public Good*
- It is available on CGSpace: https://hdl.handle.net/10568/105514
## 2019-10-28
- Move the CGSpace CG Core v2 notes from a [GitHub Gist](https://gist.github.com/alanorth/2db39e91f48d116e00a4edffd6ba6409) to a [page]({{< relref "cgspace-cgcorev2-migration.md" >}}) on this site for archive and searchability sake
- I noticed that the page title is messed up on the item view, and after over an hour of troubleshooting it I couldn't figure out why
- It seems to be because the `dc.title`→`dcterms.title` modifications cause the title metadata to disappear from DRI's `<pageMeta>` and therefore the title is not accessible to the XSL transformation
- Also, I noticed a few places in the Java code where `dc.title` is hard coded so I think this might be one of the fields that we just assume DSpace relies on internally
- I will revert all changes to `dc.title` and `dc.title.alternative`
- TODO: there are similar issues with the `citation_author` metadata element missing from DRI, so I might have to revert those changes too
- After more digging in the source I found out why the `dcterms.title` and `dcterms.creator` fields are not present in the DRI `pageMeta`...
- The `pageMeta` element is constructed in `dspace-xmlui/src/main/java/org/dspace/app/xmlui/wing/IncludePageMeta.java` and the code does not consider any other schemas besides DC
- I moved title and creator back to the original DC fields and then everything was working as expected in the pageMeta, so I guess we cannot use these in DCTERMS either!