diff --git a/content/posts/2024-04.md b/content/posts/2024-04.md index 0b119b4b3..cd694f556 100644 --- a/content/posts/2024-04.md +++ b/content/posts/2024-04.md @@ -79,4 +79,34 @@ return get.read().decode('utf-8') - It took ten or so minutes for it to finish (and note this is Python 2 inside OpenRefine so I had to be careful with Unicode), but worked well! +## 2024-04-18 + +- Write a SQL query to build the IFPRI CONTENTdm redirects to Handles: + +```sql +SELECT m.text_value, h.handle FROM metadatavalue m JOIN handle h on m.dspace_object_id = h.resource_id WHERE m.metadata_field_id=28 AND m.text_value LIKE 'Original URL%' AND h.resource_type_id=2; +``` + +- Similarly, I need a SQL query to get the redirects for duplicate Handles, querying for `dcterms.replaces`: + +```sql +SELECT m.text_value AS handle_from, h.handle AS handle_to FROM metadatavalue m JOIN handle h on m.dspace_object_id = h.resource_id WHERE m.metadata_field_id=181 AND h.resource_type_id=2; +``` + +- Then I can work that list into an nginx map with redirect, for example: + +```console +server { +... + + if ($new_uri) { + return 301 $new_uri; + } +} + +map $request_uri $new_uri { + /handle/10568/112821 /handle/10568/97605; +} +``` + diff --git a/docs/2024-04/index.html b/docs/2024-04/index.html index 9468f0bda..2b2174406 100644 --- a/docs/2024-04/index.html +++ b/docs/2024-04/index.html @@ -14,7 +14,7 @@ Work on CGSpace duplicate DOIs more - + @@ -34,9 +34,9 @@ Work on CGSpace duplicate DOIs more "@type": "BlogPosting", "headline": "April, 2024", "url": "https://alanorth.github.io/cgspace-notes/2024-04/", - "wordCount": "352", + "wordCount": "456", "datePublished": "2024-04-04T10:23:00+03:00", - "dateModified": "2024-04-16T09:35:30+03:00", + "dateModified": "2024-04-18T09:38:02+03:00", "author": { "@type": "Person", "name": "Alan Orth" @@ -191,7 +191,30 @@ curl -s -o /dev/null 0.01s user 0.01s system 0% cpu 4.764 total - +

2024-04-18

+ +
SELECT m.text_value, h.handle FROM metadatavalue m JOIN handle h on m.dspace_object_id = h.resource_id WHERE m.metadata_field_id=28 AND m.text_value LIKE 'Original URL%' AND h.resource_type_id=2;
+
+
SELECT m.text_value AS handle_from, h.handle AS handle_to FROM metadatavalue m JOIN handle h on m.dspace_object_id = h.resource_id WHERE m.metadata_field_id=181 AND h.resource_type_id=2;
+
+
server {
+...
+
+    if ($new_uri) {
+        return 301 $new_uri;
+    }
+}
+
+map $request_uri $new_uri {
+    /handle/10568/112821 /handle/10568/97605;
+}
+
diff --git a/docs/categories/index.html b/docs/categories/index.html index 036a2f953..75aafde49 100644 --- a/docs/categories/index.html +++ b/docs/categories/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/index.xml b/docs/categories/index.xml index dc10cf8ff..8b09a4685 100644 --- a/docs/categories/index.xml +++ b/docs/categories/index.xml @@ -6,7 +6,7 @@ Recent content in Categories on CGSpace Notes Hugo 0.125.0 en-us - Tue, 16 Apr 2024 09:35:30 +0300 + Thu, 18 Apr 2024 09:38:02 +0300 Notes diff --git a/docs/categories/notes/index.html b/docs/categories/notes/index.html index 67498885e..fec27aa5e 100644 --- a/docs/categories/notes/index.html +++ b/docs/categories/notes/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/index.xml b/docs/categories/notes/index.xml index 6254dc1ea..87ef400e6 100644 --- a/docs/categories/notes/index.xml +++ b/docs/categories/notes/index.xml @@ -6,7 +6,7 @@ Recent content in Notes on CGSpace Notes Hugo 0.125.0 en-us - Tue, 16 Apr 2024 09:35:30 +0300 + Thu, 18 Apr 2024 09:38:02 +0300 April, 2024 diff --git a/docs/categories/notes/page/2/index.html b/docs/categories/notes/page/2/index.html index 268e6d5d8..c3a6acda8 100644 --- a/docs/categories/notes/page/2/index.html +++ b/docs/categories/notes/page/2/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/3/index.html b/docs/categories/notes/page/3/index.html index fd29d741e..c499a199a 100644 --- a/docs/categories/notes/page/3/index.html +++ b/docs/categories/notes/page/3/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/4/index.html b/docs/categories/notes/page/4/index.html index b1c239942..4f28b5bab 100644 --- a/docs/categories/notes/page/4/index.html +++ b/docs/categories/notes/page/4/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/5/index.html b/docs/categories/notes/page/5/index.html index 0378945bf..0e3ca3cdd 100644 --- a/docs/categories/notes/page/5/index.html +++ b/docs/categories/notes/page/5/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/6/index.html b/docs/categories/notes/page/6/index.html index cea3be929..e24fb7d8b 100644 --- a/docs/categories/notes/page/6/index.html +++ b/docs/categories/notes/page/6/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/7/index.html b/docs/categories/notes/page/7/index.html index 3a6ff3e12..1a6323ce6 100644 --- a/docs/categories/notes/page/7/index.html +++ b/docs/categories/notes/page/7/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/8/index.html b/docs/categories/notes/page/8/index.html index 22c80a4b9..67e20efef 100644 --- a/docs/categories/notes/page/8/index.html +++ b/docs/categories/notes/page/8/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/categories/notes/page/9/index.html b/docs/categories/notes/page/9/index.html index a05342085..853ba0790 100644 --- a/docs/categories/notes/page/9/index.html +++ b/docs/categories/notes/page/9/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/index.html b/docs/index.html index 706bfc042..a49bac1cf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/index.xml b/docs/index.xml index 21da8f9ed..922d6dd10 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -6,7 +6,7 @@ Recent content on CGSpace Notes Hugo 0.125.0 en-us - Tue, 16 Apr 2024 09:35:30 +0300 + Thu, 18 Apr 2024 09:38:02 +0300 April, 2024 diff --git a/docs/page/10/index.html b/docs/page/10/index.html index 9767e2eed..712dc44cc 100644 --- a/docs/page/10/index.html +++ b/docs/page/10/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/11/index.html b/docs/page/11/index.html index a2bb84b2d..247d79057 100644 --- a/docs/page/11/index.html +++ b/docs/page/11/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/2/index.html b/docs/page/2/index.html index 8a98003d0..6fecff805 100644 --- a/docs/page/2/index.html +++ b/docs/page/2/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/3/index.html b/docs/page/3/index.html index c687345cd..cce0b3cf0 100644 --- a/docs/page/3/index.html +++ b/docs/page/3/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/4/index.html b/docs/page/4/index.html index 714173990..50581ae4e 100644 --- a/docs/page/4/index.html +++ b/docs/page/4/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/5/index.html b/docs/page/5/index.html index 774210a99..f2e0b4475 100644 --- a/docs/page/5/index.html +++ b/docs/page/5/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/6/index.html b/docs/page/6/index.html index deac091e3..6ccc9dc5f 100644 --- a/docs/page/6/index.html +++ b/docs/page/6/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/7/index.html b/docs/page/7/index.html index 507f25213..fbacc6952 100644 --- a/docs/page/7/index.html +++ b/docs/page/7/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/8/index.html b/docs/page/8/index.html index ecd9a5473..dde8aee4d 100644 --- a/docs/page/8/index.html +++ b/docs/page/8/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/page/9/index.html b/docs/page/9/index.html index 1d8520888..48f3d5f3b 100644 --- a/docs/page/9/index.html +++ b/docs/page/9/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/index.html b/docs/posts/index.html index 2a197d684..080a72b41 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/index.xml b/docs/posts/index.xml index 7660b59a3..1b7179438 100644 --- a/docs/posts/index.xml +++ b/docs/posts/index.xml @@ -6,7 +6,7 @@ Recent content in Posts on CGSpace Notes Hugo 0.125.0 en-us - Tue, 16 Apr 2024 09:35:30 +0300 + Thu, 18 Apr 2024 09:38:02 +0300 April, 2024 diff --git a/docs/posts/page/10/index.html b/docs/posts/page/10/index.html index 032aee415..b51bce314 100644 --- a/docs/posts/page/10/index.html +++ b/docs/posts/page/10/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/11/index.html b/docs/posts/page/11/index.html index 849898c77..41ea5d946 100644 --- a/docs/posts/page/11/index.html +++ b/docs/posts/page/11/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/2/index.html b/docs/posts/page/2/index.html index cf9a9c593..25f7e863a 100644 --- a/docs/posts/page/2/index.html +++ b/docs/posts/page/2/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/3/index.html b/docs/posts/page/3/index.html index bfb580c5f..55fe56394 100644 --- a/docs/posts/page/3/index.html +++ b/docs/posts/page/3/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/4/index.html b/docs/posts/page/4/index.html index 9a5bd3b78..8ab9b77c3 100644 --- a/docs/posts/page/4/index.html +++ b/docs/posts/page/4/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/5/index.html b/docs/posts/page/5/index.html index 80cae6b97..07ccd8c36 100644 --- a/docs/posts/page/5/index.html +++ b/docs/posts/page/5/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/6/index.html b/docs/posts/page/6/index.html index aaa1e1f05..babd435ca 100644 --- a/docs/posts/page/6/index.html +++ b/docs/posts/page/6/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/7/index.html b/docs/posts/page/7/index.html index 5983f0ee2..6429911ab 100644 --- a/docs/posts/page/7/index.html +++ b/docs/posts/page/7/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/8/index.html b/docs/posts/page/8/index.html index 26ec8b6c8..76d79cdc7 100644 --- a/docs/posts/page/8/index.html +++ b/docs/posts/page/8/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/posts/page/9/index.html b/docs/posts/page/9/index.html index f7fd27240..fbfc43608 100644 --- a/docs/posts/page/9/index.html +++ b/docs/posts/page/9/index.html @@ -10,7 +10,7 @@ - + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 2bdb39810..a42a82cac 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,19 +3,19 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> https://alanorth.github.io/cgspace-notes/2024-04/ - 2024-04-16T09:35:30+03:00 + 2024-04-18T09:38:02+03:00 https://alanorth.github.io/cgspace-notes/categories/ - 2024-04-16T09:35:30+03:00 + 2024-04-18T09:38:02+03:00 https://alanorth.github.io/cgspace-notes/ - 2024-04-16T09:35:30+03:00 + 2024-04-18T09:38:02+03:00 https://alanorth.github.io/cgspace-notes/categories/notes/ - 2024-04-16T09:35:30+03:00 + 2024-04-18T09:38:02+03:00 https://alanorth.github.io/cgspace-notes/posts/ - 2024-04-16T09:35:30+03:00 + 2024-04-18T09:38:02+03:00 https://alanorth.github.io/cgspace-notes/2024-03/ 2024-04-04T10:23:49+03:00