Revision 7193
Added by ben leinfelder over 12 years ago
src/doi_registration.sql | ||
---|---|---|
5 | 5 |
text('testing') as ezid_account, |
6 | 6 |
doc.doctype, |
7 | 7 |
id.guid, |
8 |
'https://cn-stage.dataone.org/cn/v1/resolve/' || id.guid as url,
|
|
8 |
'https://cn-stage.dataone.org/cn/v1/resolve/' || regexp_replace(regexp_replace(id.guid, '/', '%2F', 'g'), ':', '%3A', 'g') as url,
|
|
9 | 9 |
text('Unknown') as title, |
10 | 10 |
text(null) as creator, |
11 | 11 |
text(null) as publisher, |
... | ... | |
21 | 21 |
text('testing') as ezid_account, |
22 | 22 |
doc.doctype, |
23 | 23 |
id.guid, |
24 |
'https://cn-stage.dataone.org/cn/v1/resolve/' || id.guid as url,
|
|
24 |
'https://cn-stage.dataone.org/cn/v1/resolve/' || regexp_replace(regexp_replace(id.guid, '/', '%2F', 'g'), ':', '%3A', 'g') as url,
|
|
25 | 25 |
text('Unknown') as title, |
26 | 26 |
text(null) as creator, |
27 | 27 |
text(null) as publisher, |
... | ... | |
259 | 259 |
set title = replace(title, E'\n', ' '); |
260 | 260 |
|
261 | 261 |
update doi_registration |
262 |
set title = regexp_replace(title, E'\\s+', ' '); |
|
262 |
set title = regexp_replace(title, E'\\s+', ' ', 'g');
|
|
263 | 263 |
|
264 | 264 |
update doi_registration |
265 |
set title = regexp_replace(title, E'^\\s+', ''); |
|
265 |
set title = regexp_replace(title, E'^\\s+', '', 'g');
|
|
266 | 266 |
|
267 | 267 |
COPY (select ezid_account, guid as doi, url, title, creator, publisher, pub_date from doi_registration order by doi) |
268 | 268 |
TO '/tmp/doi_registration.csv' |
Also available in: Unified diff
encode '/' and ':' in the DOI used for the resolve URL