mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2024-11-26 16:38:19 +01:00
584 lines
36 KiB
HTML
584 lines
36 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" >
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
|
|
<meta property="og:title" content="February, 2023" />
|
|
<meta property="og:description" content="2023-02-01
|
|
|
|
Export CGSpace to cross check the DOI metadata with Crossref
|
|
|
|
I want to try to expand my use of their data to journals, publishers, volumes, issues, etc…
|
|
|
|
|
|
" />
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/2023-02/" />
|
|
<meta property="article:published_time" content="2023-02-01T10:57:36+03:00" />
|
|
<meta property="article:modified_time" content="2023-02-15T19:47:13+03:00" />
|
|
|
|
|
|
|
|
<meta name="twitter:card" content="summary"/>
|
|
<meta name="twitter:title" content="February, 2023"/>
|
|
<meta name="twitter:description" content="2023-02-01
|
|
|
|
Export CGSpace to cross check the DOI metadata with Crossref
|
|
|
|
I want to try to expand my use of their data to journals, publishers, volumes, issues, etc…
|
|
|
|
|
|
"/>
|
|
<meta name="generator" content="Hugo 0.110.0">
|
|
|
|
|
|
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "http://schema.org",
|
|
"@type": "BlogPosting",
|
|
"headline": "February, 2023",
|
|
"url": "https://alanorth.github.io/cgspace-notes/2023-02/",
|
|
"wordCount": "2333",
|
|
"datePublished": "2023-02-01T10:57:36+03:00",
|
|
"dateModified": "2023-02-15T19:47:13+03:00",
|
|
"author": {
|
|
"@type": "Person",
|
|
"name": "Alan Orth"
|
|
},
|
|
"keywords": "Notes"
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<link rel="canonical" href="https://alanorth.github.io/cgspace-notes/2023-02/">
|
|
|
|
<title>February, 2023 | CGSpace Notes</title>
|
|
|
|
|
|
<!-- combined, minified CSS -->
|
|
|
|
<link href="https://alanorth.github.io/cgspace-notes/css/style.c6ba80bc50669557645abe05f86b73cc5af84408ed20f1551a267bc19ece8228.css" rel="stylesheet" integrity="sha256-xrqAvFBmlVdkWr4F+GtzzFr4RAjtIPFVGiZ7wZ7Ogig=" crossorigin="anonymous">
|
|
|
|
|
|
<!-- minified Font Awesome for SVG icons -->
|
|
|
|
<script defer src="https://alanorth.github.io/cgspace-notes/js/fontawesome.min.f5072c55a0721857184db93a50561d7dc13975b4de2e19db7f81eb5f3fa57270.js" integrity="sha256-9QcsVaByGFcYTbk6UFYdfcE5dbTeLhnbf4HrXz+lcnA=" crossorigin="anonymous"></script>
|
|
|
|
<!-- RSS 2.0 feed -->
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
<div class="blog-masthead">
|
|
<div class="container">
|
|
<nav class="nav blog-nav">
|
|
<a class="nav-link " href="https://alanorth.github.io/cgspace-notes/">Home</a>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<header class="blog-header">
|
|
<div class="container">
|
|
<h1 class="blog-title" dir="auto"><a href="https://alanorth.github.io/cgspace-notes/" rel="home">CGSpace Notes</a></h1>
|
|
<p class="lead blog-description" dir="auto">Documenting day-to-day work on the <a href="https://cgspace.cgiar.org">CGSpace</a> repository.</p>
|
|
</div>
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-sm-8 blog-main">
|
|
|
|
|
|
|
|
|
|
<article class="blog-post">
|
|
<header>
|
|
<h2 class="blog-post-title" dir="auto"><a href="https://alanorth.github.io/cgspace-notes/2023-02/">February, 2023</a></h2>
|
|
<p class="blog-post-meta">
|
|
<time datetime="2023-02-01T10:57:36+03:00">Wed Feb 01, 2023</time>
|
|
in
|
|
<span class="fas fa-folder" aria-hidden="true"></span> <a href="/categories/notes/" rel="category tag">Notes</a>
|
|
|
|
|
|
</p>
|
|
</header>
|
|
<h2 id="2023-02-01">2023-02-01</h2>
|
|
<ul>
|
|
<li>Export CGSpace to cross check the DOI metadata with Crossref
|
|
<ul>
|
|
<li>I want to try to expand my use of their data to journals, publishers, volumes, issues, etc…</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul>
|
|
<li>First, extract a list of DOIs for use with <code>crossref-doi-lookup.py</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-console" data-lang="console"><span style="display:flex;"><span>$ csvcut -c <span style="color:#e6db74">'cg.identifier.doi[en_US]'</span> ~/Downloads/2023-02-01-cgspace.csv <span style="color:#ae81ff">\
|
|
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span> | csvgrep -c 1 -m 'doi.org' \
|
|
</span></span><span style="display:flex;"><span> | csvgrep -c 1 -m ' ' -i \
|
|
</span></span><span style="display:flex;"><span> | csvgrep -c 1 -r '.*cifor.*' -i \
|
|
</span></span><span style="display:flex;"><span> | sed 1d > /tmp/2023-02-01-dois.txt
|
|
</span></span><span style="display:flex;"><span>$ ./ilri/crossref-doi-lookup.py -e a.orth@cgiar.org -i /tmp/2023-02-01-dois.txt -o ~/Downloads/2023-01-31-crossref-results.csv -d
|
|
</span></span></code></pre></div><ul>
|
|
<li>Then extract the ID, DOI, journal, volume, issue, publisher, etc from the CGSpace dump and rename the <code>cg.identifier.doi[en_US]</code> to <code>doi</code> so we can join on it with the Crossref results file:</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>$ csvcut -c <span style="color:#e6db74">'id,cg.identifier.doi[en_US],cg.journal[en_US],cg.volume[en_US],cg.issue[en_US],dcterms.publisher[en_US],cg.number[en_US],dcterms.license[en_US]'</span> ~/Downloads/2023-02-01-cgspace.csv <span style="color:#ae81ff">\
|
|
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span> | csvgrep -c 'cg.identifier.doi[en_US]' -r '.*cifor.*' -i \
|
|
</span></span><span style="display:flex;"><span> | sed -e '1s/cg.identifier.doi\[en_US\]/doi/' \
|
|
</span></span><span style="display:flex;"><span> -e 's_https://doi.org/__g' \
|
|
</span></span><span style="display:flex;"><span> -e 's_https://dx.doi.org/__g' \
|
|
</span></span><span style="display:flex;"><span> > /tmp/2023-02-01-cgspace-doi-metadata.csv
|
|
</span></span><span style="display:flex;"><span>$ csvjoin -c doi /tmp/2023-02-01-cgspace-doi-metadata.csv ~/Downloads/2023-02-01-crossref-results.csv > /tmp/2023-02-01-cgspace-crossref-check.csv
|
|
</span></span></code></pre></div><ul>
|
|
<li>And import into OpenRefine for analysis and cleaning</li>
|
|
<li>I just noticed that Crossref also has types, so we could use that in the future too!</li>
|
|
<li>I got a few corrections after examining manually, but I didn’t manage to identify any patterns that I could use to do any automatic matching or cleaning</li>
|
|
</ul>
|
|
<h2 id="2023-02-05">2023-02-05</h2>
|
|
<ul>
|
|
<li>Normalize text lang attributes in PostgreSQL, run a quick Discovery index, and then export CGSpace to check Initiative mappings and countries/regions</li>
|
|
<li>Run all system updates on CGSpace (linode18) and reboot it</li>
|
|
</ul>
|
|
<h2 id="2023-02-06">2023-02-06</h2>
|
|
<ul>
|
|
<li>Peter said that a new Initiative was approved last month so we need to add it to CGSpace: <code>Fragility, Conflict, and Migration</code></li>
|
|
<li>There is lots of discussion about the “issue date” versus “available date” with Enrico and IFPRI, after lots of feedback from the PRMS QA
|
|
<ul>
|
|
<li>I filed <a href="https://github.com/AgriculturalSemantics/cg-core/issues/43">an issue on CG Core to propose using <code>dcterms.available</code> as an optional field to indicate the online date</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-07">2023-02-07</h2>
|
|
<ul>
|
|
<li>IFPRI’s web developer Tony managed to get his Drupal harvester to have a useful user agent:</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>54.x.x.x - - [06/Feb/2023:10:10:32 +0100] "POST /rest/items/find-by-metadata-field?limit=%22100&offset=0 HTTP/1.1" 200 58855 "-" "IFPRI drupal POST harvester"
|
|
</span></span></code></pre></div><ul>
|
|
<li>He also noticed that there is no pagination on POST requests to <code>/rest/items/find-by-metadata-field</code>, and that he needs to increase his timeout for requests that return 100+ results, ie:</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>curl -f -H "Content-Type: application/json" -X POST "https://dspacetest.cgiar.org/rest/items/find-by-metadata-field" -d '{"key":"cg.subject.actionArea", "value":"Systems Transformation", "language": "en_US"}'
|
|
</span></span></code></pre></div><ul>
|
|
<li>I need to ask on the DSpace Slack about this POST pagination</li>
|
|
<li>Abenet and Udana noticed that the Handle server was not running
|
|
<ul>
|
|
<li>Looking in the <code>error.log</code> file I see that the service is complaining about a lock file being present</li>
|
|
<li>This is because Linode had to do emergency maintenance on the VM host this morning and the Handle server didn’t shut down properly</li>
|
|
</ul>
|
|
</li>
|
|
<li>I’m having an issue with <code>poetry update</code> so I spent some time debugging and filed <a href="https://github.com/python-poetry/poetry/issues/7482">an issue</a></li>
|
|
<li>Proof and import nine items for the Digital Innovation Inititive for IFPRI
|
|
<ul>
|
|
<li>There were only some minor issues in the metadata</li>
|
|
<li>I also did a duplicate check with <code>check-duplicates.py</code> just in case</li>
|
|
</ul>
|
|
</li>
|
|
<li>I did some minor updates on csv-metadata-quality
|
|
<ul>
|
|
<li>First, to reduce warnings on non-SPDX licenses like “Copyrighted; all rights reserved” and “Other” since they are very common for us and I’m sick of seeing the warnings</li>
|
|
<li>Second, to skip whitespace and newline fixes on the abstract field since so many times they are intended</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-08">2023-02-08</h2>
|
|
<ul>
|
|
<li>Make some edits to IFPRI records requested by Jawoo and Leigh</li>
|
|
<li>Help Alessandra upload a last minute report for SAPLING</li>
|
|
<li>Proof and upload twenty-seven IFPRI records to CGSpace
|
|
<ul>
|
|
<li>It’s a good thing I did a duplicate check because I found three duplicates!</li>
|
|
</ul>
|
|
</li>
|
|
<li>Export CGSpace to update Initiative mappings and country/region mappings
|
|
<ul>
|
|
<li>Then start a harvest on AReS</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-09">2023-02-09</h2>
|
|
<ul>
|
|
<li>Do some minor work on the CSS on the DSpace 7 test</li>
|
|
</ul>
|
|
<h2 id="2023-02-10">2023-02-10</h2>
|
|
<ul>
|
|
<li>I noticed a large number of PostgreSQL locks from dspaceWeb on CGSpace:</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>$ psql -c <span style="color:#e6db74">'SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid;'</span> | grep -o -E <span style="color:#e6db74">'(dspaceWeb|dspaceApi|dspaceCli)'</span> | sort | uniq -c
|
|
</span></span><span style="display:flex;"><span> 2033 dspaceWeb
|
|
</span></span></code></pre></div><ul>
|
|
<li>Looking at the lock age, I see some already 1 day old, including this curious query:</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>select nextval ('public.registrationdata_seq')
|
|
</span></span></code></pre></div><ul>
|
|
<li>I killed all locks that were more than a few hours old</li>
|
|
<li>Export CGSpace to update Initiative collection mappings</li>
|
|
<li>Discuss adding <code>dcterms.available</code> to the submission form
|
|
<ul>
|
|
<li>I also looked in the <code>dcterms.description</code> field on CGSpace and found ~1,500 items where the is an indication of an online published date</li>
|
|
<li>Using some facets in OpenRefine I narrowed down the ones mentioning “online” and then extracted the dates to a new column:</li>
|
|
</ul>
|
|
</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>cells['dcterms.description[en_US]'].value.replace(/.*?(\d+{2}) ([a-zA-Z]+) (\d+{2}).*/,"$3-$2-$1")
|
|
</span></span></code></pre></div><ul>
|
|
<li>Then to handle formats like “2022-April-26” and “2021-Nov-11” I used some replacement GRELs (note the order so we don’t replace short patterns in longer strings prematurely):</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>value.replace("January","01").replace("February","02").replace("March","03").replace("April","04").replace("May","05").replace("June","06").replace("July","07").replace("August","08").replace("September","09").replace("October","10").replace("November","11").replace("December","12")
|
|
</span></span><span style="display:flex;"><span>value.replace("Jan","01").replace("Feb","02").replace("Mar","03").replace("Apr","04").replace("May","05").replace("Jun","06").replace("Jul","07").replace("Aug","08").replace("Sep","09").replace("Oct","10").replace("Nov","11").replace("Dec","12")
|
|
</span></span></code></pre></div><ul>
|
|
<li>This covered about 1,300 items, then I did about 100 more messier ones with some more regex wranling
|
|
<ul>
|
|
<li>I removed the <code>dcterms.description[en_US]</code> field from items where I updated the dates</li>
|
|
</ul>
|
|
</li>
|
|
<li>Then I added <code>dcterms.available</code> to the submission form and the item view
|
|
<ul>
|
|
<li>We need to announce this to the editors</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-13">2023-02-13</h2>
|
|
<ul>
|
|
<li>Export CGSpace to do some metadata quality checks
|
|
<ul>
|
|
<li>I added CGIAR Trust Fund as a donor to some new Initiative outputs</li>
|
|
<li>I moved some abstracts from the description field</li>
|
|
<li>I moved some version information to the <code>cg.edition</code> field</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-14">2023-02-14</h2>
|
|
<ul>
|
|
<li>The PRMS team in Colombia sent some questions about countries on CGSpace
|
|
<ul>
|
|
<li>I had to fix some, that were clearly wrong, but there is also a difference between CGSpace and MEL because we use mostly iso-codes, and MEL uses the UN M.49 list</li>
|
|
<li>Then I re-ran the country code tagger from cgspace-java-helpers, forcing the update on all items in the Initiatives community</li>
|
|
</ul>
|
|
</li>
|
|
<li>Remove Alliance research levers from <code>cg.contributor.crp</code> field after discussing with Daniel and Maria
|
|
<ul>
|
|
<li>This was a mistake on TIP’s part, and there is no direct mapping between research levers and CRPs</li>
|
|
</ul>
|
|
</li>
|
|
<li>I exported CGSpace to check Initiative collection mappings, regions, and licenses
|
|
<ul>
|
|
<li>Peter told me that all CGIAR blog posts for the Initiatives should be CC-BY-4.0, and I see the logo at the bottom in light gray!</li>
|
|
<li>I had previously missed that and removed some licenses for blog posts</li>
|
|
<li>I checked cgiar.org, ifpri.org, icarda.org, iwmi.cgiar.org, irri.org, etc and corrected a handful</li>
|
|
</ul>
|
|
</li>
|
|
<li>Start a harvest on AReS</li>
|
|
</ul>
|
|
<h2 id="2023-02-15">2023-02-15</h2>
|
|
<ul>
|
|
<li>Work on rebasing my local DSpace 7 dev branches on top of the latest 7.5-SNAPSHOT
|
|
<ul>
|
|
<li>It seems the issues I had with the <code>dspace submission-forms-migrate</code> tool in <a href="/cgspace-notes/2022-08/">August, 2022</a> were fixed</li>
|
|
</ul>
|
|
</li>
|
|
<li>I imported a fresh PostgreSQL snapshot from CGSpace and then removed the Atmire migrations and ran the new migrations as I originally noted in <a href="/cgspace-notes/2022-03/">March, 2022</a>, and is pointed out in the <a href="https://wiki.lyrasis.org/display/DSDOC7x/Upgrading+DSpace">DSpace 7 upgrade notes</a>
|
|
<ul>
|
|
<li>Now I get a new error:</li>
|
|
</ul>
|
|
</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>localhost/dspace7= ☘ DELETE FROM schema_version WHERE version IN ('5.0.2017.09.25', '6.0.2017.01.30', '6.0.2017.09.25');
|
|
</span></span><span style="display:flex;"><span>localhost/dspace7= ☘ DELETE FROM schema_version WHERE description LIKE '%Atmire%' OR description LIKE '%CUA%' OR description LIKE '%cua%';
|
|
</span></span><span style="display:flex;"><span>localhost/dspace7= \q
|
|
</span></span><span style="display:flex;"><span>$ ./bin/dspace database migrate ignored
|
|
</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>CREATE INDEX resourcepolicy_action_idx ON resourcepolicy(action_id)
|
|
</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> at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:275)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:222)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:126)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:69)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:58)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:57)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:377)
|
|
</span></span><span style="display:flex;"><span> ... 24 more
|
|
</span></span><span style="display:flex;"><span>Caused by: org.postgresql.util.PSQLException: ERROR: relation "resourcepolicy_action_idx" already exists
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
|
|
</span></span><span style="display:flex;"><span> at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)
|
|
</span></span><span style="display:flex;"><span> at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
|
|
</span></span><span style="display:flex;"><span> at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:201)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:95)
|
|
</span></span><span style="display:flex;"><span> at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:210)
|
|
</span></span><span style="display:flex;"><span> ... 30 more
|
|
</span></span></code></pre></div><ul>
|
|
<li>I dropped that index and then the migration succeeded:</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>localhost/dspace7= ☘ DROP INDEX resourcepolicy_action_idx;
|
|
</span></span><span style="display:flex;"><span>localhost/dspace7= ☘ \q
|
|
</span></span><span style="display:flex;"><span>$ ./bin/dspace database migrate ignored
|
|
</span></span><span style="display:flex;"><span>Done.
|
|
</span></span></code></pre></div><ul>
|
|
<li>I think that particular error is because I applied the <a href="https://github.com/DSpace/DSpace/pull/1792">indexes in this unmerged DSpace 6 patch</a>, so I don’t need to report this as an error in DSpace 7</li>
|
|
</ul>
|
|
<h2 id="2023-02-16">2023-02-16</h2>
|
|
<ul>
|
|
<li>I found a suspicious number of PostgreSQL locks on CGSpace and decided to investigate:</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>$ psql -c <span style="color:#e6db74">'SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid;'</span> | grep -o -E <span style="color:#e6db74">'(dspaceWeb|dspaceApi|dspaceCli)'</span> | sort | uniq -c
|
|
</span></span><span style="display:flex;"><span> 44 dspaceApi
|
|
</span></span><span style="display:flex;"><span> 372 dspaceCli
|
|
</span></span><span style="display:flex;"><span> 446 dspaceWeb
|
|
</span></span></code></pre></div><ul>
|
|
<li>This started happening yesterday and I killed a few locks that were several hours old after inspecting the <code>locks-age.sql</code> output</li>
|
|
<li>I also checked the <code>locks.sql</code> output, which helpfully lists the blocked PID and the blocking PID, to find one blocking PID that was idle in transaction
|
|
<ul>
|
|
<li>I killed that process and then all other locks were instantly processed</li>
|
|
</ul>
|
|
</li>
|
|
<li>I filed <a href="https://github.com/DSpace/dspace-angular/issues/2103">a GitHub issue</a> on dspace-angular requesting the item view to use the bitstream description instead of the file name if present</li>
|
|
<li>Weekly CG Core types meeting
|
|
<ul>
|
|
<li>I need to go through the actions and remove those items that are only for CGSpace internal use, ie:
|
|
<ul>
|
|
<li>CD-ROM</li>
|
|
<li>Manuscript-unpublished</li>
|
|
<li>Photo Report</li>
|
|
<li>Questionnaire</li>
|
|
<li>Wiki</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>Weekly CGIAR Repository Working Group meeting</li>
|
|
<li>I did some experiments with Crossref dates for about 20,000 DOIs in CGSpace using my <code>crossref-doi-lookup.py</code> script</li>
|
|
<li>Some things I noted from reading the <a href="https://github.com/CrossRef/rest-api-doc/blob/master/api_format.md">Crossref API docs</a> and inspecting the records for a few dozen DOIs manually:
|
|
<ul>
|
|
<li><code>["created"]["date-parts"]</code> → Date on which the DOI was first registered (not useful for us)</li>
|
|
<li><code>["published-print"]["date-parts"]</code> → Date on which the work was published in print</li>
|
|
<li><code>["journal-issue"]["published-print"]["date-parts"]</code> → When present, is 99% the same as the above</li>
|
|
<li><code>["published-online"]["date-parts"]</code> → Date on which the work was published online</li>
|
|
<li><code>["journal-issue"]["published-online"]["date-parts"]</code> → Much more rare, and only 50% the same as the above, so unreliable</li>
|
|
<li><code>["issued"]["date-parts"]</code> → Earliest of published-print and published-online (not useful to us)</li>
|
|
</ul>
|
|
</li>
|
|
<li>After checking the DOIs manully I decided that when the <code>published-print</code> date exists, it is usually more accurate than our issued dates
|
|
<ul>
|
|
<li>I set 12,300 issue dates to those from Crossref</li>
|
|
</ul>
|
|
</li>
|
|
<li>I also decided that, when <code>published-online</code> exists, it is usually accurate when I check the publisher page (we don’t have many online dates to compare)
|
|
<ul>
|
|
<li>I set the available date for ~7,000 items to the published-online date as long as:
|
|
<ul>
|
|
<li>There was no <code>dcterms.available</code> date already</li>
|
|
<li>It was different than the issued date, because for now I only want online dates that are different, in case this is an online only journal in which case that can be the issue date… maybe I’ll re-visit that later</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-17">2023-02-17</h2>
|
|
<ul>
|
|
<li>It seems some (all?) of the changes I applied to dates last night didn’t get saved…
|
|
<ul>
|
|
<li>I don’t know what happened, so I will run them again after some investigation</li>
|
|
<li>I submitted the first batch of ~7,600 changes and it took twelve hours!</li>
|
|
<li>I almost cancelled it because after applying the changes there was a lock blocking everything for two hours, and it seemed to be stuck, but I kept checking it and saw that the <code>query_start</code> and <code>state_change</code> were being updated despite it being state “idle in transaction”:</li>
|
|
</ul>
|
|
</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>$ psql -c <span style="color:#e6db74">'SELECT * FROM pg_stat_activity WHERE pid=1025176'</span> | less -S
|
|
</span></span></code></pre></div><ul>
|
|
<li>I will apply the other changes in smaller batches…</li>
|
|
<li>Lately I’ve noticed a lot of activity from the country code tagger curation task
|
|
<ul>
|
|
<li>Looking in the logs I see items being tagged that are very old and should have already been tagged years ago</li>
|
|
<li>Also, I see a ton of these errors whenever the task is updating an item:</li>
|
|
</ul>
|
|
</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>2023-02-17 08:01:00,252 INFO org.dspace.curate.Curator @ Curation task: countrycodetagger performed on: 10568/89020 with status: 0. Result: '10568/89020: added 1 alpha2 country code(s)'
|
|
</span></span><span style="display:flex;"><span>2023-02-17 08:01:00,467 ERROR com.atmire.versioning.ModificationLogger @ Error while writing item to versioning index: a0fe9d9a-6ac1-4b6a-8fcb-dae07a6bbf58 message:missing required field: epersonID
|
|
</span></span><span style="display:flex;"><span>org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: missing required field: epersonID
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod(HttpSolrServer.java:552)
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:210)
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:206)
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:124)
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:116)
|
|
</span></span><span style="display:flex;"><span> at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:102)
|
|
</span></span><span style="display:flex;"><span> at com.atmire.versioning.ModificationLogger.indexItem(ModificationLogger.java:263)
|
|
</span></span><span style="display:flex;"><span> at com.atmire.versioning.ModificationConsumer.end(ModificationConsumer.java:134)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.event.BasicDispatcher.dispatch(BasicDispatcher.java:157)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.core.Context.dispatchEvents(Context.java:455)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.visit(Curator.java:541)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator$TaskRunner.run(Curator.java:568)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.doCollection(Curator.java:515)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.doCommunity(Curator.java:487)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.doSite(Curator.java:451)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.curate(Curator.java:269)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.Curator.curate(Curator.java:203)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.curate.CurationCli.main(CurationCli.java:220)
|
|
</span></span><span style="display:flex;"><span> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
|
</span></span><span style="display:flex;"><span> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
|
</span></span><span style="display:flex;"><span> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
|
</span></span><span style="display:flex;"><span> at java.lang.reflect.Method.invoke(Method.java:498)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
|
|
</span></span><span style="display:flex;"><span> at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
|
|
</span></span></code></pre></div><ul>
|
|
<li>This must be related…</li>
|
|
</ul>
|
|
<h2 id="2023-02-18">2023-02-18</h2>
|
|
<ul>
|
|
<li>I realized why the country-code-tagger was tagging everything: I had overridden the <code>force</code> parameter last week!</li>
|
|
<li>Start a harvest on AReS</li>
|
|
</ul>
|
|
<h2 id="2023-02-20">2023-02-20</h2>
|
|
<ul>
|
|
<li>IWMI is concerned that some of their items with top Altmetric attention scores don’t show up in the AReS Explorer
|
|
<ul>
|
|
<li>I looked into it for one and found that AReS is using the Handle, but Altmetric hasn’t associated the Handle with the DOI</li>
|
|
</ul>
|
|
</li>
|
|
<li>Looking into country and region issues for the PRMS team
|
|
<ul>
|
|
<li>Last week they had some questions about some invalid countries that ended up being typos</li>
|
|
<li>I realized my cgspace-java-helpers country-code-tagger curation task is not using the latest version, so it was missing Türkiye</li>
|
|
<li>I compiled the new version and ran it manually, but I have to upload a new version to Maven Central and then update the dependency in <code>dspace/modules/additions/pom.xml</code> ughhhhhh</li>
|
|
<li>I tagged version 6.2 with the change for Türkiye and uploaded to to Maven Central with <code>mvn clean deploy</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>I’m having second thoughts about switching to UN M.49 for countries because there are just too many tradeoffs
|
|
<ul>
|
|
<li>I want to find a way to keep our existing list, and codify some rules for it</li>
|
|
<li>There are several discussions related to the shortcomings of ISO themselves and the iso-codes project, for example:
|
|
<ul>
|
|
<li><a href="https://salsa.debian.org/iso-codes-team/iso-codes/-/issues/33">Inconsistency with articles in ISO-3166-1 English short names</a> (this one was filed by me two years ago!)</li>
|
|
<li><a href="https://salsa.debian.org/iso-codes-team/iso-codes/-/issues/44">ISO 3166-1: What’s the policy for <code>common_name</code>?</a></li>
|
|
</ul>
|
|
</li>
|
|
<li>I almost want to say fuck it, let’s just use iso-codes and tell everyone to deal with it, but make sure we handle ISO 3166-1 Alpha2 or probably Alpha3 in the future</li>
|
|
<li>Something like:
|
|
<ul>
|
|
<li>Prefer <code>common_name</code> if it exists</li>
|
|
<li>Prefer the shorter of <code>name</code> and <code>official name</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="2023-02-21">2023-02-21</h2>
|
|
<ul>
|
|
<li>Continue working on my <code>parse-iso-codes.py</code> script to parse the iso-codes JSON for ISO 3166-1
|
|
<ul>
|
|
<li>I also started a spreadsheet to track current CGSpace country names, proposed new names using the compromise above, and UN M.49 names</li>
|
|
<li>I proposed this to Peter but he wasn’t happy because there are still some stupidly long and political names there</li>
|
|
</ul>
|
|
</li>
|
|
<li>I bumped the version of cgspace-java-helpers to 6.2-SNAPSHOT and pushed it to Maven Central because I can’t figure out how to get non-snapshot releases to go there</li>
|
|
<li>Ouch, grunt 1.6.0 was released a few weeks ago, which relies on Node.js v16, thus breaking the Mirage 2 build in DSpace 6
|
|
<ul>
|
|
<li>I filed <a href="https://github.com/DSpace/DSpace/issues/8676">an issue in DSpace</a></li>
|
|
</ul>
|
|
</li>
|
|
<li>Help Moises from CIP troubleshoot harvesting issues on their WordPress site
|
|
<ul>
|
|
<li>I see 2,000 requests with the user agent “RTB website BOT” today and they are all HTTP 200</li>
|
|
</ul>
|
|
</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># grep <span style="color:#e6db74">'RTB website BOT'</span> /var/log/nginx/rest.log | awk <span style="color:#e6db74">'{print $9}'</span> | sort | uniq -c | sort -h
|
|
</span></span><span style="display:flex;"><span> 2023 200
|
|
</span></span></code></pre></div><!-- raw HTML omitted -->
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
</div> <!-- /.blog-main -->
|
|
|
|
<aside class="col-sm-3 ml-auto blog-sidebar">
|
|
|
|
|
|
|
|
<section class="sidebar-module">
|
|
<h4>Recent Posts</h4>
|
|
<ol class="list-unstyled">
|
|
|
|
|
|
<li><a href="/cgspace-notes/2023-02/">February, 2023</a></li>
|
|
|
|
<li><a href="/cgspace-notes/2023-01/">January, 2023</a></li>
|
|
|
|
<li><a href="/cgspace-notes/2022-12/">December, 2022</a></li>
|
|
|
|
<li><a href="/cgspace-notes/2022-11/">November, 2022</a></li>
|
|
|
|
<li><a href="/cgspace-notes/2022-10/">October, 2022</a></li>
|
|
|
|
</ol>
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="sidebar-module">
|
|
<h4>Links</h4>
|
|
<ol class="list-unstyled">
|
|
|
|
<li><a href="https://cgspace.cgiar.org">CGSpace</a></li>
|
|
|
|
<li><a href="https://dspacetest.cgiar.org">DSpace Test</a></li>
|
|
|
|
<li><a href="https://github.com/ilri/DSpace">CGSpace @ GitHub</a></li>
|
|
|
|
</ol>
|
|
</section>
|
|
|
|
</aside>
|
|
|
|
|
|
</div> <!-- /.row -->
|
|
</div> <!-- /.container -->
|
|
|
|
|
|
|
|
<footer class="blog-footer">
|
|
<p dir="auto">
|
|
|
|
Blog template created by <a href="https://twitter.com/mdo">@mdo</a>, ported to Hugo by <a href='https://twitter.com/mralanorth'>@mralanorth</a>.
|
|
|
|
</p>
|
|
<p>
|
|
<a href="#">Back to top</a>
|
|
</p>
|
|
</footer>
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|