mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Add notes for 2024-03-11
This commit is contained in:
@ -65,4 +65,28 @@ UPDATE metadatavalue SET text_value='United Nations Children''s Fund' WHERE dspa
|
||||
|
||||
- Note the use of two single quotes to escape the one in the name
|
||||
|
||||
## 2024-03-11
|
||||
|
||||
- Experimenting with moving some of my Python scripts to the DSpace 7 REST API
|
||||
- I need a way to get UUIDs for Handles...
|
||||
- Seems that I can use a Discovery query like: https://dspace7test.ilri.org/server/api/discover/search/objects?dsoType=item&query=handle:10568/130864
|
||||
- Then just take the first result...?
|
||||
- I spent some time working on the script get abstracts from CGSpace, and found a bug in my logic
|
||||
- I also noticed that one item had two abstracts, but the first one was blank!
|
||||
- Looking deeper, I found 113 blank metadata values so I deleted those:
|
||||
|
||||
```sql
|
||||
BEGIN;
|
||||
DELETE FROM metadatavalue WHERE dspace_object_id IN (SELECT uuid FROM item) AND text_value='';
|
||||
COMMIT;
|
||||
```
|
||||
|
||||
- I also found a few dozen items with "N/A" for their citation, so I deleted those too:
|
||||
|
||||
```sql
|
||||
BEGIN;
|
||||
DELETE FROM metadatavalue WHERE dspace_object_id IN (SELECT uuid FROM item) AND text_value='N/A' AND metadata_field_id=146;
|
||||
COMMIT;
|
||||
```
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user