Add notes

This commit is contained in:
Alan Orth 2024-04-18 17:00:25 +03:00
parent 60b244486f
commit 6db3da2739
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
39 changed files with 98 additions and 45 deletions

View File

@ -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;
}
```
<!-- vim: set sw=2 ts=2: -->

View File

@ -14,7 +14,7 @@ Work on CGSpace duplicate DOIs more
<meta property="og:type" content="article" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/2024-04/" />
<meta property="article:published_time" content="2024-04-04T10:23:00+03:00" />
<meta property="article:modified_time" content="2024-04-16T09:35:30+03:00" />
<meta property="article:modified_time" content="2024-04-18T09:38:02+03:00" />
@ -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
</span></span></code></pre></div><ul>
<li>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!</li>
</ul>
<!-- raw HTML omitted -->
<h2 id="2024-04-18">2024-04-18</h2>
<ul>
<li>Write a SQL query to build the IFPRI CONTENTdm redirects to Handles:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sql" data-lang="sql"><span style="display:flex;"><span><span style="color:#66d9ef">SELECT</span> m.text_value, h.handle <span style="color:#66d9ef">FROM</span> metadatavalue m <span style="color:#66d9ef">JOIN</span> handle h <span style="color:#66d9ef">on</span> m.dspace_object_id <span style="color:#f92672">=</span> h.resource_id <span style="color:#66d9ef">WHERE</span> m.metadata_field_id<span style="color:#f92672">=</span><span style="color:#ae81ff">28</span> <span style="color:#66d9ef">AND</span> m.text_value <span style="color:#66d9ef">LIKE</span> <span style="color:#e6db74">&#39;Original URL%&#39;</span> <span style="color:#66d9ef">AND</span> h.resource_type_id<span style="color:#f92672">=</span><span style="color:#ae81ff">2</span>;
</span></span></code></pre></div><ul>
<li>Similarly, I need a SQL query to get the redirects for duplicate Handles, querying for <code>dcterms.replaces</code>:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sql" data-lang="sql"><span style="display:flex;"><span><span style="color:#66d9ef">SELECT</span> m.text_value <span style="color:#66d9ef">AS</span> handle_from, h.handle <span style="color:#66d9ef">AS</span> handle_to <span style="color:#66d9ef">FROM</span> metadatavalue m <span style="color:#66d9ef">JOIN</span> handle h <span style="color:#66d9ef">on</span> m.dspace_object_id <span style="color:#f92672">=</span> h.resource_id <span style="color:#66d9ef">WHERE</span> m.metadata_field_id<span style="color:#f92672">=</span><span style="color:#ae81ff">181</span> <span style="color:#66d9ef">AND</span> h.resource_type_id<span style="color:#f92672">=</span><span style="color:#ae81ff">2</span>;
</span></span></code></pre></div><ul>
<li>Then I can work that list into an nginx map with redirect, for example:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-console" data-lang="console"><span style="display:flex;"><span>server {
</span></span><span style="display:flex;"><span>...
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> if ($new_uri) {
</span></span><span style="display:flex;"><span> return 301 $new_uri;
</span></span><span style="display:flex;"><span> }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>map $request_uri $new_uri {
</span></span><span style="display:flex;"><span> /handle/10568/112821 /handle/10568/97605;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><!-- raw HTML omitted -->

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -6,7 +6,7 @@
<description>Recent content in Categories on CGSpace Notes</description>
<generator>Hugo 0.125.0</generator>
<language>en-us</language>
<lastBuildDate>Tue, 16 Apr 2024 09:35:30 +0300</lastBuildDate>
<lastBuildDate>Thu, 18 Apr 2024 09:38:02 +0300</lastBuildDate>
<atom:link href="https://alanorth.github.io/cgspace-notes/categories/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Notes</title>

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -6,7 +6,7 @@
<description>Recent content in Notes on CGSpace Notes</description>
<generator>Hugo 0.125.0</generator>
<language>en-us</language>
<lastBuildDate>Tue, 16 Apr 2024 09:35:30 +0300</lastBuildDate>
<lastBuildDate>Thu, 18 Apr 2024 09:38:02 +0300</lastBuildDate>
<atom:link href="https://alanorth.github.io/cgspace-notes/categories/notes/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>April, 2024</title>

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/categories/notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -6,7 +6,7 @@
<description>Recent content on CGSpace Notes</description>
<generator>Hugo 0.125.0</generator>
<language>en-us</language>
<lastBuildDate>Tue, 16 Apr 2024 09:35:30 +0300</lastBuildDate>
<lastBuildDate>Thu, 18 Apr 2024 09:38:02 +0300</lastBuildDate>
<atom:link href="https://alanorth.github.io/cgspace-notes/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>April, 2024</title>

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -6,7 +6,7 @@
<description>Recent content in Posts on CGSpace Notes</description>
<generator>Hugo 0.125.0</generator>
<language>en-us</language>
<lastBuildDate>Tue, 16 Apr 2024 09:35:30 +0300</lastBuildDate>
<lastBuildDate>Thu, 18 Apr 2024 09:38:02 +0300</lastBuildDate>
<atom:link href="https://alanorth.github.io/cgspace-notes/posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>April, 2024</title>

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -10,7 +10,7 @@
<meta property="og:description" content="Documenting day-to-day work on the [CGSpace](https://cgspace.cgiar.org) repository." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/posts/" />
<meta property="og:updated_time" content="2024-04-16T09:35:30+03:00" />
<meta property="og:updated_time" content="2024-04-18T09:38:02+03:00" />

View File

@ -3,19 +3,19 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://alanorth.github.io/cgspace-notes/2024-04/</loc>
<lastmod>2024-04-16T09:35:30+03:00</lastmod>
<lastmod>2024-04-18T09:38:02+03:00</lastmod>
</url><url>
<loc>https://alanorth.github.io/cgspace-notes/categories/</loc>
<lastmod>2024-04-16T09:35:30+03:00</lastmod>
<lastmod>2024-04-18T09:38:02+03:00</lastmod>
</url><url>
<loc>https://alanorth.github.io/cgspace-notes/</loc>
<lastmod>2024-04-16T09:35:30+03:00</lastmod>
<lastmod>2024-04-18T09:38:02+03:00</lastmod>
</url><url>
<loc>https://alanorth.github.io/cgspace-notes/categories/notes/</loc>
<lastmod>2024-04-16T09:35:30+03:00</lastmod>
<lastmod>2024-04-18T09:38:02+03:00</lastmod>
</url><url>
<loc>https://alanorth.github.io/cgspace-notes/posts/</loc>
<lastmod>2024-04-16T09:35:30+03:00</lastmod>
<lastmod>2024-04-18T09:38:02+03:00</lastmod>
</url><url>
<loc>https://alanorth.github.io/cgspace-notes/2024-03/</loc>
<lastmod>2024-04-04T10:23:49+03:00</lastmod>