1
|
-- https://support.openaire.eu/issues/6897 defined the new table for EOSC fields for dat sources
|
2
|
--CREATE TABLE dsm_datasources_eosc(
|
3
|
-- id varchar(255) references dsm_datasources(id),
|
4
|
-- jurisdiction text,
|
5
|
-- thematic boolean,
|
6
|
-- knowledge_graph boolean,
|
7
|
-- content_policies text[],
|
8
|
-- _dnet_resource_identifier_ varchar(2048) default ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text))
|
9
|
--);
|
10
|
|
11
|
-- all institutional repositories have jurisdiction = 'Institutional' (5419 on dev)
|
12
|
|
13
|
INSERT INTO dsm_datasources_eosc(id, jurisdiction, _dnet_resource_identifier_)
|
14
|
SELECT id, 'Institutional', _dnet_resource_identifier_
|
15
|
FROM dsm_datasources
|
16
|
WHERE typology = 'pubsrepository::institutional';
|
17
|
|
18
|
-- scholarcomminfra have global jurisdiction (3 on dev)
|
19
|
|
20
|
INSERT INTO dsm_datasources_eosc(id, jurisdiction, _dnet_resource_identifier_)
|
21
|
SELECT id, 'Global', _dnet_resource_identifier_
|
22
|
FROM dsm_datasources
|
23
|
WHERE typology = 'scholarcomminfra' or typology='infospace';
|
24
|
|
25
|
-- thematic repositories are thematic (379 on dev)
|
26
|
INSERT INTO dsm_datasources_eosc(id, thematic, _dnet_resource_identifier_)
|
27
|
SELECT id, true, _dnet_resource_identifier_
|
28
|
FROM dsm_datasources
|
29
|
WHERE typology = 'pubsrepository::thematic';
|
30
|
|
31
|
-- journals, publishers and aggregators of journals have content_policies = ['Journal articles'] (16569 on dev)
|
32
|
INSERT INTO dsm_datasources_eosc(id, content_policies, _dnet_resource_identifier_)
|
33
|
SELECT id, ARRAY ['Journal articles'], _dnet_resource_identifier_
|
34
|
FROM dsm_datasources
|
35
|
WHERE typology = 'aggregator::pubsrepository::journals' or typology='pubsrepository::journal';
|
36
|
|
37
|
-- Now for the specific, well-known data sources we should fix the typology (when needed) and include the new fields
|
38
|
-- note that ids are from beta (in the hope that they are the same in prod)
|
39
|
|
40
|
-- Crossref is an entity registry (of products) with global jurisdiction
|
41
|
UPDATE dsm_datasources SET typology='entityregistry::products' WHERE id='openaire____::crossref';
|
42
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
43
|
VALUES('openaire____::crossref', 'openaire____::crossref', 'Global');
|
44
|
|
45
|
-- Datacite is an entity registry (of products) with global jurisdiction
|
46
|
UPDATE dsm_datasources SET typology='entityregistry::products' WHERE id='openaire____::datacite';
|
47
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
48
|
VALUES('openaire____::datacite', 'openaire____::datacite', 'Global');
|
49
|
|
50
|
-- ORCID is an entity registry (of persons) with global jurisdiction
|
51
|
UPDATE dsm_datasources SET typology='entityregistry::researchers' WHERE id='openaire____::orcid';
|
52
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
53
|
VALUES('openaire____::orcid', 'openaire____::orcid', 'Global');
|
54
|
|
55
|
-- ROR is an entity registry (of orgs) with global jurisdicition
|
56
|
UPDATE dsm_datasources SET typology='entityregistry::organizations' WHERE id='openaire____::ROR';
|
57
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
58
|
VALUES('openaire____::ROR', 'openaire____::ROR', 'Global');
|
59
|
|
60
|
-- Grid.ac is an entity registry (of orgs) with global jurisdicition
|
61
|
UPDATE dsm_datasources SET typology='entityregistry::organizations' WHERE id='openaire____::grid';
|
62
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
63
|
VALUES('openaire____::grid', 'openaire____::grid', 'Global');
|
64
|
|
65
|
-- re3data is an entity registry (of data sources) with global jurisdiction
|
66
|
UPDATE dsm_datasources SET typology='entityregistry::repositories' WHERE id='openaire____::re3data';
|
67
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
68
|
VALUES('openaire____::re3data', 'openaire____::re3data', 'Global');
|
69
|
|
70
|
|
71
|
-- opendoar is an entity registry (of data sources) with global jurisdiction
|
72
|
UPDATE dsm_datasources SET typology='entityregistry::repositories' WHERE id='openaire____::opendoar';
|
73
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
74
|
VALUES('openaire____::opendoar', 'openaire____::opendoar', 'Global');
|
75
|
|
76
|
-- Unpaywall is an aggregator with global jurisdiction
|
77
|
UPDATE dsm_datasources SET typology='aggregator::pubsrepository::unknown' WHERE id='openaire____::unpaywall';
|
78
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
79
|
VALUES('openaire____::unpaywall', 'openaire____::unpaywall', 'Global');
|
80
|
|
81
|
-- MAG is an aggregator with global jurisdiction and knowledge graph = true
|
82
|
UPDATE dsm_datasources SET typology='aggregator::pubsrepository::unknown' WHERE id='openaire____::microsoft';
|
83
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction, knowledge_graph)
|
84
|
VALUES('openaire____::microsoft', 'openaire____::microsoft', 'Global', true);
|
85
|
|
86
|
-- OpenAIRE is an aggregator with global jurisdiction and knowledge graph = true
|
87
|
--UPDATE dsm_datasources SET typology='aggregator' WHERE id='infrastruct_::openaire';
|
88
|
UPDATE dsm_datasources_eosc SET knowledge_graph = true WHERE _dnet_resource_identifier_ = 'infrastruct_::openaire';
|
89
|
|
90
|
-- ScholeXplorer is an aggregator with global jurisdiction and knowledge graph = true
|
91
|
--UPDATE dsm_datasources SET typology='aggregator' WHERE id='openaire____::scholexplorer';
|
92
|
UPDATE dsm_datasources_eosc SET knowledge_graph = true WHERE _dnet_resource_identifier_ = 'openaire____::scholexplorer';
|
93
|
|
94
|
|
95
|
-- patstat has a regional jurisdiction
|
96
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
97
|
VALUES('openaire____::EPO', 'openaire____::EPO', 'Regional');
|
98
|
|
99
|
-- Software Heritage is an aggregator with global jurisdiction
|
100
|
UPDATE dsm_datasources SET typology='aggregator::softwarerepository' WHERE id='openaire____::SoftwareHeritage';
|
101
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
102
|
VALUES('openaire____::SoftwareHeritage', 'openaire____::SoftwareHeritage', 'Global');
|
103
|
|
104
|
-- bio.tools is thematic
|
105
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, thematic)
|
106
|
VALUES('rest________::bioTools', 'rest________::bioTools', true);
|
107
|
|
108
|
|
109
|
|
110
|
--DRIVER is an aggregator with global jurisdiction
|
111
|
UPDATE dsm_datasources SET typology='aggregator::pubsrepository::unknown' WHERE id='openaire____::driver';
|
112
|
INSERT INTO dsm_datasources_eosc(id, _dnet_resource_identifier_, jurisdiction)
|
113
|
VALUES('openaire____::driver', 'openaire____::driver', 'Global');
|
114
|
|
115
|
|
116
|
-- FIX DOAJ journals with the proper content policies until we fix the transformation (#6970)
|
117
|
UPDATE dsm_datasources_eosc SET content_policies = ARRAY ['Journal articles'] where id like 'doajarticles%';
|