Update notes for 2017-02-16

This commit is contained in:
Alan Orth 2017-02-16 19:41:58 +02:00
parent beaf2c0d81
commit b1c11adb57
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
5 changed files with 45 additions and 11 deletions

View File

@ -103,11 +103,17 @@ UPDATE 58193
- I noticed a few items that have incorrect DOI links (`dc.identifier.doi`), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:
```
dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like 'http%://%';
dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value not like 'http%://%';
```
- This will replace any that begin with `10.`:
- This will replace any that begin with `10.` and change them to `https://dx.doi.org/10.`:
```
dspace=# update metadatavalue set text_value = regexp_replace(text_value, '(^10\..+$)', 'https://dx.doi.org/\1') where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like '10.%';
```
- This will get any that begin with `doi:10.` and change them to `https://dx.doi.org/10.x`:
```
dspace=# update metadatavalue set text_value = regexp_replace(text_value, '^doi:(10\..+$)', 'https://dx.doi.org/\1') where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like 'doi:10%';
```

View File

@ -92,7 +92,7 @@ Looks like we’ll be using cg.identifier.ccafsprojectpii as the field name
"headline": "February, 2017",
"url": "https://alanorth.github.io/cgspace-notes/2017-02/",
"wordCount": "713",
"wordCount": "774",
"datePublished": "2017-02-07T07:04:52-08:00",
@ -289,16 +289,23 @@ UPDATE 58193
<li>I noticed a few items that have incorrect DOI links (<code>dc.identifier.doi</code>), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:</li>
</ul>
<pre><code>dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like 'http%://%';
<pre><code>dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value not like 'http%://%';
</code></pre>
<ul>
<li>This will replace any that begin with <code>10.</code>:</li>
<li>This will replace any that begin with <code>10.</code> and change them to <code>https://dx.doi.org/10.</code>:</li>
</ul>
<pre><code>dspace=# update metadatavalue set text_value = regexp_replace(text_value, '(^10\..+$)', 'https://dx.doi.org/\1') where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like '10.%';
</code></pre>
<ul>
<li>This will get any that begin with <code>doi:10.</code> and change them to <code>https://dx.doi.org/10.x</code>:</li>
</ul>
<pre><code>dspace=# update metadatavalue set text_value = regexp_replace(text_value, '^doi:(10\..+$)', 'https://dx.doi.org/\1') where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like 'doi:10%';
</code></pre>

View File

@ -137,14 +137,21 @@ UPDATE 58193
&lt;li&gt;I noticed a few items that have incorrect DOI links (&lt;code&gt;dc.identifier.doi&lt;/code&gt;), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like &#39;http%://%&#39;;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value not like &#39;http%://%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt;:&lt;/li&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;(^10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;10.%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will get any that begin with &lt;code&gt;doi:10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.x&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;^doi:(10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;doi:10%&#39;;
&lt;/code&gt;&lt;/pre&gt;</description>
</item>

View File

@ -137,14 +137,21 @@ UPDATE 58193
&lt;li&gt;I noticed a few items that have incorrect DOI links (&lt;code&gt;dc.identifier.doi&lt;/code&gt;), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like &#39;http%://%&#39;;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value not like &#39;http%://%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt;:&lt;/li&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;(^10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;10.%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will get any that begin with &lt;code&gt;doi:10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.x&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;^doi:(10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;doi:10%&#39;;
&lt;/code&gt;&lt;/pre&gt;</description>
</item>

View File

@ -136,14 +136,21 @@ UPDATE 58193
&lt;li&gt;I noticed a few items that have incorrect DOI links (&lt;code&gt;dc.identifier.doi&lt;/code&gt;), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like &#39;http%://%&#39;;
&lt;pre&gt;&lt;code&gt;dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value not like &#39;http%://%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt;:&lt;/li&gt;
&lt;li&gt;This will replace any that begin with &lt;code&gt;10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;(^10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;10.%&#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This will get any that begin with &lt;code&gt;doi:10.&lt;/code&gt; and change them to &lt;code&gt;https://dx.doi.org/10.x&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;dspace=# update metadatavalue set text_value = regexp_replace(text_value, &#39;^doi:(10\..+$)&#39;, &#39;https://dx.doi.org/\1&#39;) where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = &#39;identifier&#39; and qualifier = &#39;doi&#39;) and text_value like &#39;doi:10%&#39;;
&lt;/code&gt;&lt;/pre&gt;</description>
</item>