Update notes for 2019-03-14

This commit is contained in:
Alan Orth 2019-03-14 22:15:10 +02:00
parent ec914d873f
commit 2807f179ba
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
3 changed files with 60 additions and 8 deletions

View File

@ -154,6 +154,31 @@ if(isBlank(value), 'PLANT PRODUCTION & HEALTH', value + '||PLANT PRODUCTION & HE
- CGSpace had the same issue with blank items like earlier this month and I restarted Tomcat to fix it
- Create a pull request to change Swaziland to Eswatini and Macedonia to North Macedonia ([#414](https://github.com/ilri/DSpace/pull/414))
- I see thirty-six items using Swaziland country metadata, and Peter says we should change only those from 2018 and 2019
- I think that I could get the resource IDs from SQL and then export them using `dspace metadata-export`...
- This is a bit ugly, but it works (using the [DSpace 5 SQL helper function](https://wiki.duraspace.org/display/DSPACE/Helper+SQL+functions+for+DSpace+5) to resolve ID to handle):
```
for id in $(psql -U postgres -d dspacetest -h localhost -c "SELECT resource_id FROM metadatavalue WHERE resource_type_id=2 AND metadata_field_id=228 AND text_value LIKE '%SWAZILAND%'" | grep -oE '[0-9]{3,}'); do
echo "Getting handle for id: ${id}"
handle=$(psql -U postgres -d dspacetest -h localhost -c "SELECT ds5_item2itemhandle($id)" | grep -oE '[0-9]{5}/[0-9]+')
~/dspace/bin/dspace metadata-export -f /tmp/${id}.csv -i $handle
done
```
- Then I couldn't figure out a clever way to join all the CSVs, so I just grepped them to find the IDs with dates from 2018 and 2019 and there are apparently only three:
```
$ grep -oE '201[89]' /tmp/*.csv | sort -u
/tmp/94834.csv:2018
/tmp/95615.csv:2018
/tmp/96747.csv:2018
```
- And looking at those items more closely, only one of them has an *issue date* of after 2018-04, so I will only update that one (as the countrie's name only changed in 2018-04)
- Run all system updates and reboot linode20
- Follow up with Felix from Earlham to see if he's done testing DSpace Test with COPO so I can re-sync the server from CGSpace

View File

@ -25,7 +25,7 @@ I think I will need to ask Udana to re-copy and paste the abstracts with more ca
<meta property="og:type" content="article" />
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/2019-03/" />
<meta property="article:published_time" content="2019-03-01T12:16:30&#43;01:00"/>
<meta property="article:modified_time" content="2019-03-12T22:47:45&#43;02:00"/>
<meta property="article:modified_time" content="2019-03-14T20:18:29&#43;02:00"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="March, 2019"/>
@ -55,9 +55,9 @@ I think I will need to ask Udana to re-copy and paste the abstracts with more ca
"@type": "BlogPosting",
"headline": "March, 2019",
"url": "https://alanorth.github.io/cgspace-notes/2019-03/",
"wordCount": "1300",
"wordCount": "1471",
"datePublished": "2019-03-01T12:16:30&#43;01:00",
"dateModified": "2019-03-12T22:47:45&#43;02:00",
"dateModified": "2019-03-14T20:18:29&#43;02:00",
"author": {
"@type": "Person",
"name": "Alan Orth"
@ -320,7 +320,34 @@ UPDATE 44
<ul>
<li>I see thirty-six items using Swaziland country metadata, and Peter says we should change only those from 2018 and 2019</li>
<li>I think that I could get the resource IDs from SQL and then export them using <code>dspace metadata-export</code>&hellip;</li>
</ul></li>
<li>This is a bit ugly, but it works (using the <a href="https://wiki.duraspace.org/display/DSPACE/Helper+SQL+functions+for+DSpace+5">DSpace 5 SQL helper function</a> to resolve ID to handle):</li>
</ul>
<pre><code>for id in $(psql -U postgres -d dspacetest -h localhost -c &quot;SELECT resource_id FROM metadatavalue WHERE resource_type_id=2 AND metadata_field_id=228 AND text_value LIKE '%SWAZILAND%'&quot; | grep -oE '[0-9]{3,}'); do
echo &quot;Getting handle for id: ${id}&quot;
handle=$(psql -U postgres -d dspacetest -h localhost -c &quot;SELECT ds5_item2itemhandle($id)&quot; | grep -oE '[0-9]{5}/[0-9]+')
~/dspace/bin/dspace metadata-export -f /tmp/${id}.csv -i $handle
done
</code></pre>
<ul>
<li>Then I couldn&rsquo;t figure out a clever way to join all the CSVs, so I just grepped them to find the IDs with dates from 2018 and 2019 and there are apparently only three:</li>
</ul>
<pre><code>$ grep -oE '201[89]' /tmp/*.csv | sort -u
/tmp/94834.csv:2018
/tmp/95615.csv:2018
/tmp/96747.csv:2018
</code></pre>
<ul>
<li>And looking at those items more closely, only one of them has an <em>issue date</em> of after 2018-04, so I will only update that one (as the countrie&rsquo;s name only changed in 2018-04)</li>
<li>Run all system updates and reboot linode20</li>
<li>Follow up with Felix from Earlham to see if he&rsquo;s done testing DSpace Test with COPO so I can re-sync the server from CGSpace</li>
</ul>

View File

@ -4,7 +4,7 @@
<url>
<loc>https://alanorth.github.io/cgspace-notes/2019-03/</loc>
<lastmod>2019-03-12T22:47:45+02:00</lastmod>
<lastmod>2019-03-14T20:18:29+02:00</lastmod>
</url>
<url>
@ -214,7 +214,7 @@
<url>
<loc>https://alanorth.github.io/cgspace-notes/</loc>
<lastmod>2019-03-12T22:47:45+02:00</lastmod>
<lastmod>2019-03-14T20:18:29+02:00</lastmod>
<priority>0</priority>
</url>
@ -225,7 +225,7 @@
<url>
<loc>https://alanorth.github.io/cgspace-notes/tags/notes/</loc>
<lastmod>2019-03-12T22:47:45+02:00</lastmod>
<lastmod>2019-03-14T20:18:29+02:00</lastmod>
<priority>0</priority>
</url>
@ -237,13 +237,13 @@
<url>
<loc>https://alanorth.github.io/cgspace-notes/posts/</loc>
<lastmod>2019-03-12T22:47:45+02:00</lastmod>
<lastmod>2019-03-14T20:18:29+02:00</lastmod>
<priority>0</priority>
</url>
<url>
<loc>https://alanorth.github.io/cgspace-notes/tags/</loc>
<lastmod>2019-03-12T22:47:45+02:00</lastmod>
<lastmod>2019-03-14T20:18:29+02:00</lastmod>
<priority>0</priority>
</url>