mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Update notes for 2019-08-28
This commit is contained in:
@ -283,5 +283,33 @@ sys 2m24.715s
|
||||
## 2019-08-28
|
||||
|
||||
- Skype with Jane about AReS Phase III priorities
|
||||
- I did a test to automatically fix some authors in the database using my csv-metadata-quality script
|
||||
- First I dumped a list of all unique authors:
|
||||
|
||||
```
|
||||
dspace=# \copy (select distinct text_value, count(*) as count from metadatavalue where metadata_field_id = (select metadata_field_id from metadatafieldregistry where element = 'contributor' and qualifier = 'author') AND resource_type_id = 2 group by text_value order by count desc) to /tmp/2019-08-28-all-authors.csv with csv header;
|
||||
COPY 65597
|
||||
```
|
||||
|
||||
- Then I created a new CSV with two author columns (edit title of second column after):
|
||||
|
||||
```
|
||||
$ csvcut -c dc.contributor.author,dc.contributor.author /tmp/2019-08-28-all-authors.csv > /tmp/all-authors.csv
|
||||
```
|
||||
|
||||
- Then I ran my script on the new CSV, skipping one of the author columns:
|
||||
|
||||
```
|
||||
$ csv-metadata-quality -u -i /tmp/all-authors.csv -o /tmp/authors.csv -x dc.contributor.author
|
||||
```
|
||||
|
||||
- This fixed a bunch of issues with spaces, commas, unneccesary Unicode characters, etc
|
||||
- Then I ran the corrections on my test server and there were 185 of them!
|
||||
|
||||
```
|
||||
$ ./fix-metadata-values.py -i /tmp/authors.csv -db dspace -u dspace -p 'fuuu' -f dc.contributor.author -m 3 -t correctauthor
|
||||
```
|
||||
|
||||
- I very well might run these on CGSpace soon...
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user