mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Update notes for 2020-08-20
This commit is contained in:
@ -19,7 +19,7 @@ It is class based so I can easily add support for other vocabularies, and the te
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://alanorth.github.io/cgspace-notes/2020-08/" />
|
||||
<meta property="article:published_time" content="2020-08-02T15:35:54+03:00" />
|
||||
<meta property="article:modified_time" content="2020-08-14T11:22:16+03:00" />
|
||||
<meta property="article:modified_time" content="2020-08-19T22:08:33+03:00" />
|
||||
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:title" content="August, 2020"/>
|
||||
@ -43,9 +43,9 @@ It is class based so I can easily add support for other vocabularies, and the te
|
||||
"@type": "BlogPosting",
|
||||
"headline": "August, 2020",
|
||||
"url": "https://alanorth.github.io/cgspace-notes/2020-08/",
|
||||
"wordCount": "3168",
|
||||
"wordCount": "3406",
|
||||
"datePublished": "2020-08-02T15:35:54+03:00",
|
||||
"dateModified": "2020-08-14T11:22:16+03:00",
|
||||
"dateModified": "2020-08-19T22:08:33+03:00",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "Alan Orth"
|
||||
@ -632,6 +632,7 @@ $ curl -s "http://localhost:8081/solr/statistics-2010/update?softCommit=tru
|
||||
<li>I had been running the tasks on the entire repository with <code>-i 10568/0</code>, but I think I might need to try again with the special <code>all</code> option before writing to the dspace-tech mailing list for help
|
||||
<ul>
|
||||
<li>Actually I just tested the <code>all</code> option on DSpace 5.8 and it still does many of the items multiple times, once for each of their mappings</li>
|
||||
<li>I sent a message to the dspace-tech mailing list</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>I finished the Atmire stats processing on all cores on DSpace Test:
|
||||
@ -702,6 +703,39 @@ $ curl -s "http://localhost:8081/solr/statistics-2010/update?softCommit=tru
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="2020-08-20">2020-08-20</h2>
|
||||
<ul>
|
||||
<li>Natalia from CIAT was asking how she can download all the PDFs for the items in a search result
|
||||
<ul>
|
||||
<li>The search result is for the keyword “trade off” in the WLE community</li>
|
||||
<li>I converted the Discovery search to an open-search query to extract the XML, but we can’t get all the results on one page so I had to change the <code>rpp</code> to 100 and request a few times to get them all:</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<pre><code>$ http 'https://cgspace.cgiar.org/open-search/discover?scope=10568%2F34494&query=trade+off&rpp=100&start=0' User-Agent:'curl' > /tmp/wle-trade-off-page1.xml
|
||||
$ http 'https://cgspace.cgiar.org/open-search/discover?scope=10568%2F34494&query=trade+off&rpp=100&start=100' User-Agent:'curl' > /tmp/wle-trade-off-page2.xml
|
||||
$ http 'https://cgspace.cgiar.org/open-search/discover?scope=10568%2F34494&query=trade+off&rpp=100&start=200' User-Agent:'curl' > /tmp/wle-trade-off-page3.xml
|
||||
</code></pre><ul>
|
||||
<li>Ugh, and to extract the <code><id></code> from each <code><entry></code> we have to use an XPath query, but use a <a href="http://blog.powered-up-games.com/wordpress/archives/70">hack to ignore the default namespace by setting each element’s local name</a>:</li>
|
||||
</ul>
|
||||
<pre><code>$ xmllint --xpath '//*[local-name()="entry"]/*[local-name()="id"]/text()' /tmp/wle-trade-off-page1.xml >> /tmp/ids.txt
|
||||
$ xmllint --xpath '//*[local-name()="entry"]/*[local-name()="id"]/text()' /tmp/wle-trade-off-page2.xml >> /tmp/ids.txt
|
||||
$ xmllint --xpath '//*[local-name()="entry"]/*[local-name()="id"]/text()' /tmp/wle-trade-off-page3.xml >> /tmp/ids.txt
|
||||
$ sort -u /tmp/ids.txt > /tmp/ids-sorted.txt
|
||||
$ grep -oE '[0-9]+/[0-9]+' /tmp/ids.txt > /tmp/handles.txt
|
||||
</code></pre><ul>
|
||||
<li>Now I have all the handles for the matching items and I can use the REST API to get each item’s PDFs…
|
||||
<ul>
|
||||
<li>I wrote <code>get-wle-pdfs.py</code> to read the handles from a text file and get all PDFs: <a href="https://github.com/ilri/DSpace/blob/5_x-prod/get-wle-pdfs.py">https://github.com/ilri/DSpace/blob/5_x-prod/get-wle-pdfs.py</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Add <code>Foreign, Commonwealth and Development Office, United Kingdom</code> to the controlled vocabulary for sponsors on CGSpace
|
||||
<ul>
|
||||
<li>This is the new name for DFID as of 2020-09-01</li>
|
||||
<li>We will continue using DFID for older items</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- raw HTML omitted -->
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user