From 33bd9c396feaed9171b5ff122b34f02198abc287 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Mon, 7 Feb 2022 10:33:09 +0100 Subject: [PATCH] move vs dnet_services --- .../src/main/resources/dnet_dsm.data.sql | 176 ------ .../src/main/resources/dnet_dsm.sql | 510 ------------------ .../src/main/resources/dnet_info.sql | 21 - .../sql/recent_registered_datasources.sql.st | 6 +- ...ent_registered_datasources_fromDate.st.sql | 6 +- ...tered_datasources_fromDate_typology.st.sql | 6 +- 6 files changed, 9 insertions(+), 716 deletions(-) delete mode 100644 apps/dnet-exporter-api/src/main/resources/dnet_dsm.data.sql delete mode 100644 apps/dnet-exporter-api/src/main/resources/dnet_dsm.sql delete mode 100644 apps/dnet-exporter-api/src/main/resources/dnet_info.sql diff --git a/apps/dnet-exporter-api/src/main/resources/dnet_dsm.data.sql b/apps/dnet-exporter-api/src/main/resources/dnet_dsm.data.sql deleted file mode 100644 index ee3ec218..00000000 --- a/apps/dnet-exporter-api/src/main/resources/dnet_dsm.data.sql +++ /dev/null @@ -1,176 +0,0 @@ -INSERT INTO dsm_identities(pid, issuertype) VALUES ('77', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('680', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('260', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('637', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('528', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('577', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('566', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('241', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('491', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('324', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('375', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('152', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('1025', 'roar'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/100004440', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/100000001', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/100000002', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100007601', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100001871', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100008982', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100000925', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100000923', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100001602', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100002428', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100000690', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('10.13039/501100002341', 'doi'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2242 8989', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 5900 900X', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2169 9189', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2181 2823', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 0427 7672', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 1958 7073', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2169 1945', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2154 0709', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2176 1982', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0789 9694', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2228 3249', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2176 7727', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 0611 9213', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 0609 4140', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 4663 8325', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 1092 7772', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 0452 5752', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2297 5165', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0672 3101', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 1957 0992', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 1091 8438', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0507 0997', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0665 7300', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0685 2712', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0004 0647 6886', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 0943 9683', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 2096 9829', 'isni'); -INSERT INTO dsm_identities(pid, issuertype) VALUES ('0000 0001 1957 9997', 'isni'); - -INSERT INTO funder_identity(funder, pid) VALUES ('H2020', '680'); -INSERT INTO funder_identity(funder, pid) VALUES ('H2020', '10.13039/501100007601'); -INSERT INTO funder_identity(funder, pid) VALUES ('H2020', '0000 0001 2242 8989'); -INSERT INTO funder_identity(funder, pid) VALUES ('FP7', '0000 0004 5900 900X'); -INSERT INTO funder_identity(funder, pid) VALUES ('FCT', '260'); -INSERT INTO funder_identity(funder, pid) VALUES ('FCT', '10.13039/501100001871'); -INSERT INTO funder_identity(funder, pid) VALUES ('FCT', '0000 0001 2169 9189'); -INSERT INTO funder_identity(funder, pid) VALUES ('FCT', '0000 0001 2181 2823'); -INSERT INTO funder_identity(funder, pid) VALUES ('WT', '637'); -INSERT INTO funder_identity(funder, pid) VALUES ('WT', '10.13039/100004440'); -INSERT INTO funder_identity(funder, pid) VALUES ('WT', '0000 0004 0427 7672'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '528'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '10.13039/501100008982'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '10.13039/100000001'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '0000 0001 1958 7073'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '0000 0001 2169 1945'); -INSERT INTO funder_identity(funder, pid) VALUES ('NSF', '0000 0001 2154 0709'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '577'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '10.13039/501100000925'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 2176 1982'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 0789 9694'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 2228 3249'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 2176 7727'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 0789 9694'); -INSERT INTO funder_identity(funder, pid) VALUES ('NHMRC', '0000 0001 2228 3249'); -INSERT INTO funder_identity(funder, pid) VALUES ('ARC', '566'); -INSERT INTO funder_identity(funder, pid) VALUES ('ARC', '10.13039/501100000923'); -INSERT INTO funder_identity(funder, pid) VALUES ('ARC', '0000 0004 0611 9213'); -INSERT INTO funder_identity(funder, pid) VALUES ('MSES', '0000 0004 0609 4140'); -INSERT INTO funder_identity(funder, pid) VALUES ('CSF', '0000 0004 4663 8325'); -INSERT INTO funder_identity(funder, pid) VALUES ('NWO', '241'); -INSERT INTO funder_identity(funder, pid) VALUES ('NWO', '0000 0001 1092 7772'); -INSERT INTO funder_identity(funder, pid) VALUES ('SFI', '10.13039/501100001602'); -INSERT INTO funder_identity(funder, pid) VALUES ('SFI', '0000 0004 0452 5752'); -INSERT INTO funder_identity(funder, pid) VALUES ('NIH', '10.13039/100000002'); -INSERT INTO funder_identity(funder, pid) VALUES ('NIH', '0000 0001 2297 5165'); -INSERT INTO funder_identity(funder, pid) VALUES ('NIH', '491'); -INSERT INTO funder_identity(funder, pid) VALUES ('SNSF', '324'); -INSERT INTO funder_identity(funder, pid) VALUES ('SNSF', '0000 0001 0672 3101'); -INSERT INTO funder_identity(funder, pid) VALUES ('SNSF', '0000 0001 1957 0992'); -INSERT INTO funder_identity(funder, pid) VALUES ('FWF', '77'); -INSERT INTO funder_identity(funder, pid) VALUES ('FWF', '10.13039/501100002428'); -INSERT INTO funder_identity(funder, pid) VALUES ('FWF', '0000 0001 1091 8438'); -INSERT INTO funder_identity(funder, pid) VALUES ('RCUK', '375'); -INSERT INTO funder_identity(funder, pid) VALUES ('RCUK', '10.13039/501100000690'); -INSERT INTO funder_identity(funder, pid) VALUES ('RCUK', '0000 0001 0507 0997'); -INSERT INTO funder_identity(funder, pid) VALUES ('TBT', '0000 0001 0665 7300'); -INSERT INTO funder_identity(funder, pid) VALUES ('TBT', '0000 0001 0685 2712'); -INSERT INTO funder_identity(funder, pid) VALUES ('AFF', '1025'); -INSERT INTO funder_identity(funder, pid) VALUES ('AFF', '10.13039/501100002341'); -INSERT INTO funder_identity(funder, pid) VALUES ('AFF', '0000 0004 0647 6886'); -INSERT INTO funder_identity(funder, pid) VALUES ('CONICYT', '0000 0001 0943 9683'); -INSERT INTO funder_identity(funder, pid) VALUES ('DFG', '152'); -INSERT INTO funder_identity(funder, pid) VALUES ('DFG', '0000 0001 2096 9829'); -INSERT INTO funder_identity(funder, pid) VALUES ('DFG', '0000 0001 1957 9997'); - - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('H2020', 'European Commission - Horizon 2020', 'H2020', 'EU', 'http://ec.europa.eu/research/participants/data/ref/h2020/grants_manual/hi/oa_pilot/h2020-hi-oa-pilot-guide_en.pdf', 'OA mandate for publications; OA to research data by default', '2015-08-24'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('FP7', 'European Commission - 7th Framework program', 'FP7', 'EU', 'http://ec.europa.eu/research/fp7', 'OA advised for publications; 2012 – 2013 (FP7)Special Clause 39 ERC on Open Access applies', '2013-05-07'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('FCT', 'Portuguese Foundation for Science and Technology', 'FCT', 'PT', 'https://www.fct.pt/acessoaberto/index.phtml.en', 'OA mandate for publications; OA to research data advised', '2015-02-27'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('WT', 'Wellcome Trust', 'WT', '', 'https://wellcome.ac.uk/funding/managing-grant/open-access-policy', 'OA mandate for articles, monographs and book chapters; CC-BY licence required', '2013-05-07'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('NSF', 'National Science Foundation', 'NSF', 'US', 'https://www.nsf.gov/news/special_reports/public_access', 'Version of record or AAM of articles, conferences and data deposited into the repository; persistent identifier to full text on publisher’s website', '2016-03-04'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('NHMRC', 'National Health and Medical Research Council', 'NHMRC', 'AU', 'https://www.nhmrc.gov.au/grants-funding/policy/nhmrc-open-access-policy', 'OA mandate for publications', '2015-08-24'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('ARC', 'Australian Research Council', 'ARC', 'AU', 'http://www.arc.gov.au/arc-open-access-policy', 'OA mandate for research outputs, except for research data', '2015-08-24'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('MESTD', 'Ministry of Education, Science and Technological Development', 'MESTD', 'RS', 'NOAD', 'NOAD', '2017-01-23'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('MSES', 'Ministry of Science Education and Sport', 'MSES/MZOS', 'HR', 'NOAD', 'NOAD', '2015-09-14'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('CSF', 'Croatian Science Foundation', 'CSF/HRZZ', 'HR', 'NOAD', 'NOAD', '2015-09-14'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('NWO', 'Netherlands Organisation for Scientific Research', 'NWO', 'NL', 'NOAD', 'NOAD', '2016-06-23'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('SFI', 'Science Foundation Ireland', 'SFI', 'IE', 'http://www.sfi.ie/resources/open-access-dec-10.pdf', 'OA mandate to publications, conference proceedings and technical reports', '2015-07-21'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('NIH', 'National Institute of Health', 'NIH', 'US', 'https://publicaccess.nih.gov/policy.htm', 'OA to articles', '2017-09-21'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('SNSF', 'Swiss National Science Foundation', 'SNSF', 'CH', 'NOAD', 'NOAD', '2016-11-16'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('FWF', 'Austrian Science Fund', 'FWF', 'AT', 'NOAD', 'NOAD', '2017-09-21'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('RCUK', 'Research Council UK', 'RCUK', 'UK', 'NOAD', 'NOAD', '2017-11-02'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('TBT', 'Scientific and Technological Research Council of Turkey', 'Tubitak', 'TR', 'NOAD', 'NOAD', '2017-11-02'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('DFG', 'German Research Foundation', 'DFG', 'DE', 'NOAD', 'NOAD', '2017-09-29'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('TARA', 'Tara Expedition Foundation', 'TARA', 'FR', 'NOAD', 'NOAD', '2016-12-02'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('AFF', 'Academy of Finland', 'AFF', 'FI', 'NOAD', 'NOAD', '2017-09-21'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('CONICYT', 'Comisión Nacional de Investigación Científica y Tecnológica', 'CONICYT', 'CL', 'http://www.lareferencia.info', '', '2017-09-08'); - -INSERT INTO funders(id, name, shortname, jurisdiction, websiteurl, policy, registrationdate) -VALUES ('SGOV', 'Ministry of Economy, Industry and Competitiveness', 'SGOV', 'ES', 'NOAD', 'NOAD', '2017-09-14'); diff --git a/apps/dnet-exporter-api/src/main/resources/dnet_dsm.sql b/apps/dnet-exporter-api/src/main/resources/dnet_dsm.sql deleted file mode 100644 index b40ee542..00000000 --- a/apps/dnet-exporter-api/src/main/resources/dnet_dsm.sql +++ /dev/null @@ -1,510 +0,0 @@ - -CREATE TABLE dsm_api ( - id character varying(255) NOT NULL, - protocol character varying(255), - datasource character varying(255), - contentdescription character varying(255) DEFAULT 'metadata'::character varying, - active boolean DEFAULT false, - removable boolean DEFAULT false, - typology character varying(255) DEFAULT 'UNKNOWN'::character varying, - compatibility character varying(255) DEFAULT 'UNKNOWN'::character varying, - metadata_identifier_path character varying(512) DEFAULT NULL::character varying, - last_collection_total integer, - last_collection_date timestamp without time zone, - last_collection_mdid character varying(255) DEFAULT NULL::character varying, - last_aggregation_total integer, - last_aggregation_date timestamp without time zone, - last_aggregation_mdid character varying(255) DEFAULT NULL::character varying, - last_download_total integer, - last_download_date timestamp without time zone, - last_download_objid character varying(255) DEFAULT NULL::character varying, - last_validation_job character varying(255) DEFAULT NULL::character varying, - baseurl text, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)), - compatibility_override character varying(255) DEFAULT NULL::character varying -); - - -ALTER TABLE public.dsm_api OWNER TO dnetapi; - - -CREATE TABLE dsm_datasource_organization ( - datasource character varying(255) NOT NULL, - organization character varying(255) NOT NULL, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_datasource_organization OWNER TO dnetapi; - --- --- Name: dsm_datasources; Type: TABLE; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE TABLE dsm_datasources ( - id character varying(255) NOT NULL, - officialname character varying(512) NOT NULL, - englishname character varying(512), - websiteurl character varying(255), - logourl character varying(255), - contactemail character varying(255), - latitude double precision DEFAULT 0.0, - longitude double precision DEFAULT 0.0, - timezone character varying(10) DEFAULT '0.0'::character varying, - namespaceprefix character(12) NOT NULL, - languages text, - od_contenttypes text, - collectedfrom character varying(255), - dateofvalidation date, - optional1 character varying(255), - optional2 character varying(255), - typology character varying(255) NOT NULL, - provenanceaction character varying(255) DEFAULT 'UNKNOWN'::character varying, - dateofcollection date DEFAULT ('now'::text)::date NOT NULL, - platform character varying(255), - activationid character varying(255), - description text, - releasestartdate date, - releaseenddate date, - missionstatementurl character varying(512), - dataprovider boolean, - serviceprovider boolean, - databaseaccesstype character varying(64), - datauploadtype character varying(64), - databaseaccessrestriction character varying(64), - datauploadrestriction character varying(64), - versioning boolean, - citationguidelineurl character varying(512), - qualitymanagementkind character varying(64), - pidsystems text, - certificates text, - aggregator character varying(64) DEFAULT 'OPENAIRE'::character varying NOT NULL, - issn character varying(20), - eissn character varying(20), - lissn character varying(20), - registeredby character varying(255), - subjects text, - managed boolean DEFAULT false, - registrationdate date, - consentTermsOfUse boolean default null, - fullTextDownload boolean default null, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_datasources OWNER TO dnetapi; - --- --- Name: dsm_organizations; Type: TABLE; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE TABLE dsm_organizations ( - id character varying(255) NOT NULL, - legalshortname character varying(255), - legalname character varying(255), - websiteurl text, - logourl character varying(255), - ec_legalbody boolean DEFAULT false, - ec_legalperson boolean DEFAULT false, - ec_nonprofit boolean DEFAULT false, - ec_researchorganization boolean DEFAULT false, - ec_highereducation boolean DEFAULT false, - ec_internationalorganizationeurinterests boolean DEFAULT false, - ec_internationalorganization boolean DEFAULT false, - ec_enterprise boolean DEFAULT false, - ec_smevalidated boolean DEFAULT false, - ec_nutscode boolean DEFAULT false, - country character varying(255), - collectedfrom character varying(255), - optional1 character varying(255), - optional2 character varying(255), - dateofcollection date DEFAULT ('now'::text)::date NOT NULL, - provenanceaction character varying(255) DEFAULT 'UNKNOWN'::character varying, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)), - lastupdate date DEFAULT ('now'::text)::date NOT NULL, - trust double precision DEFAULT 0.9 -); - - -ALTER TABLE public.dsm_organizations OWNER TO dnetapi; - --- --- Name: browse_countries; Type: VIEW; Schema: public; Owner: dnet --- - -CREATE VIEW browse_countries AS - SELECT o.country AS term, - count(*) AS total - FROM (((dsm_api a - LEFT JOIN dsm_datasources d ON (((a.datasource)::text = (d.id)::text))) - LEFT JOIN dsm_datasource_organization dao ON (((d.id)::text = (dao.datasource)::text))) - LEFT JOIN dsm_organizations o ON (((dao.organization)::text = (o.id)::text))) - GROUP BY o.country - ORDER BY count(*) DESC; - - -ALTER TABLE public.browse_countries OWNER TO dnet; - - - -CREATE TABLE dsm_apiparams ( - param character varying(255) NOT NULL, - value text DEFAULT ''::character varying NOT NULL, - api character varying(255) NOT NULL, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_apiparams OWNER TO dnetapi; - --- --- Name: dsm_datasource_api; Type: VIEW; Schema: public; Owner: dnet --- - -CREATE OR REPLACE VIEW dsm_datasource_api AS - SELECT - row_number() OVER (ORDER BY a.id) AS rowid, - d.id, - d.officialname, - d.englishname, - d.websiteurl, - d.contactemail, - d.collectedfrom, - d.typology, - d.platform, - d.registeredby, - d.managed, - a.protocol, - a.contentdescription, - a.active, - a.removable, - a.typology AS apitypology, - a.compatibility, - a.baseurl - FROM (dsm_datasources d - LEFT JOIN dsm_api a ON (((d.id)::text = (a.datasource)::text))); - --- --- Name: dsm_datasourcepids; Type: TABLE; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE TABLE dsm_datasourcepids ( - datasource character varying(255) NOT NULL, - pid character varying(255) NOT NULL, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_datasourcepids OWNER TO dnetapi; - --- --- Name: dsm_identities; Type: TABLE; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE TABLE dsm_identities ( - pid character varying(255) NOT NULL, - issuertype character varying(255), - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_identities OWNER TO dnetapi; - --- --- Name: dsm_organizationpids; Type: TABLE; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE TABLE dsm_organizationpids ( - organization character varying(255) NOT NULL, - pid character varying(255) NOT NULL, - _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) -); - - -ALTER TABLE public.dsm_organizationpids OWNER TO dnetapi; - --- --- Name: funder_identity; Type: TABLE; Schema: public; Owner: dnet; Tablespace: --- - -CREATE TABLE funder_identity ( - funder character varying(255), - pid character varying(255) -); - - -ALTER TABLE public.funder_identity OWNER TO dnet; - --- --- Name: funders; Type: TABLE; Schema: public; Owner: dnet; Tablespace: --- - -CREATE TABLE funders ( - id character varying(255) NOT NULL, - name character varying(255), - shortname character varying(255), - jurisdiction character varying(255), - websiteurl text, - policy character varying(255), - registrationdate date DEFAULT ('now'::text)::date NOT NULL, - lastupdatedate date -); - - -ALTER TABLE public.funders OWNER TO dnet; - --- --- Name: fundingpaths; Type: TABLE; Schema: public; Owner: dnet; Tablespace: --- - - - - - - - - - - - - - - --- --- Name: project_organization; Type: TABLE; Schema: public; Owner: dnet; Tablespace: --- - ---CREATE TABLE project_organization ( --- participantnumber integer, --- project character varying(255) NOT NULL, --- resporganization character varying(255) NOT NULL, --- semanticclass character varying(255) DEFAULT 'UNKNOWN'::character varying, --- trust double precision DEFAULT 0.9, --- _dnet_resource_identifier_ character varying(2048) DEFAULT ((('temp_'::text || md5((clock_timestamp())::text)) || '_'::text) || md5((random())::text)) ---); - - ---ALTER TABLE public.project_organization OWNER TO dnet; - - - - --- --- Name: dsm_api_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_api - ADD CONSTRAINT dsm_api_pkey PRIMARY KEY (id); - - --- --- Name: dsm_apicollection_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_apiparams - ADD CONSTRAINT dsm_apicollection_pkey PRIMARY KEY (api, param); - - --- --- Name: dsm_datasourcepids_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_datasourcepids - ADD CONSTRAINT dsm_datasourcepids_pkey PRIMARY KEY (datasource, pid); - - --- --- Name: dsm_datasources_namespaceprefix_key; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_datasources - ADD CONSTRAINT dsm_datasources_namespaceprefix_key UNIQUE (namespaceprefix); - - --- --- Name: dsm_datasources_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_datasources - ADD CONSTRAINT dsm_datasources_pkey PRIMARY KEY (id); - - --- --- Name: dsm_identities_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_identities - ADD CONSTRAINT dsm_identities_pkey PRIMARY KEY (pid); - - --- --- Name: dsm_organization_datasource_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_datasource_organization - ADD CONSTRAINT dsm_organization_datasource_pkey PRIMARY KEY (datasource, organization); - - --- --- Name: dsm_organizationpids_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_organizationpids - ADD CONSTRAINT dsm_organizationpids_pkey PRIMARY KEY (organization, pid); - - --- --- Name: dsm_organizations_pkey; Type: CONSTRAINT; Schema: public; Owner: dnetapi; Tablespace: --- - -ALTER TABLE ONLY dsm_organizations - ADD CONSTRAINT dsm_organizations_pkey PRIMARY KEY (id); - - - - - - --- --- Name: dsm_datasources_contactemail_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_datasources_contactemail_idx ON dsm_datasources USING btree (contactemail); - - --- --- Name: dsm_datasources_englishname_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_datasources_englishname_idx ON dsm_datasources USING btree (englishname); - - --- --- Name: dsm_datasources_managed_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_datasources_managed_idx ON dsm_datasources USING btree (managed); - - --- --- Name: dsm_datasources_officialname_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_datasources_officialname_idx ON dsm_datasources USING btree (officialname); - - --- --- Name: dsm_datasources_registeredby_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_datasources_registeredby_idx ON dsm_datasources USING btree (registeredby); - - --- --- Name: dsm_organizations_country_idx; Type: INDEX; Schema: public; Owner: dnetapi; Tablespace: --- - -CREATE INDEX dsm_organizations_country_idx ON dsm_organizations USING btree (country); - - - - - - - - -ALTER TABLE ONLY dsm_api - ADD CONSTRAINT dsm_api_datasource_fkey FOREIGN KEY (datasource) REFERENCES dsm_datasources(id) ON DELETE CASCADE; - - --- --- Name: dsm_apicollections_api_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_apiparams - ADD CONSTRAINT dsm_apicollections_api_fkey FOREIGN KEY (api) REFERENCES dsm_api(id); - - --- --- Name: dsm_datasource_organization_datasource_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_datasource_organization - ADD CONSTRAINT dsm_datasource_organization_datasource_fkey FOREIGN KEY (datasource) REFERENCES dsm_datasources(id); - - --- --- Name: dsm_datasource_organization_organization_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_datasource_organization - ADD CONSTRAINT dsm_datasource_organization_organization_fkey FOREIGN KEY (organization) REFERENCES dsm_organizations(id) ON DELETE CASCADE; - - --- --- Name: dsm_datasourcepids_datasource_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_datasourcepids - ADD CONSTRAINT dsm_datasourcepids_datasource_fkey FOREIGN KEY (datasource) REFERENCES dsm_datasources(id); - - --- --- Name: dsm_datasourcepids_pid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_datasourcepids - ADD CONSTRAINT dsm_datasourcepids_pid_fkey FOREIGN KEY (pid) REFERENCES dsm_identities(pid); - - --- --- Name: dsm_datasources_collectedfrom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_datasources - ADD CONSTRAINT dsm_datasources_collectedfrom_fkey FOREIGN KEY (collectedfrom) REFERENCES dsm_datasources(id); - - --- --- Name: dsm_organizationpids_organization_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_organizationpids - ADD CONSTRAINT dsm_organizationpids_organization_fkey FOREIGN KEY (organization) REFERENCES dsm_organizations(id); - - --- --- Name: dsm_organizationpids_pid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_organizationpids - ADD CONSTRAINT dsm_organizationpids_pid_fkey FOREIGN KEY (pid) REFERENCES dsm_identities(pid); - - --- --- Name: dsm_organizations_collectedfrom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnetapi --- - -ALTER TABLE ONLY dsm_organizations - ADD CONSTRAINT dsm_organizations_collectedfrom_fkey FOREIGN KEY (collectedfrom) REFERENCES dsm_datasources(id); - - - -REVOKE ALL ON SCHEMA public FROM PUBLIC; -REVOKE ALL ON SCHEMA public FROM postgres; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO PUBLIC; - - -REVOKE ALL ON TABLE browse_countries FROM PUBLIC; -REVOKE ALL ON TABLE browse_countries FROM dnet; -GRANT ALL ON TABLE browse_countries TO dnet; -GRANT ALL ON TABLE browse_countries TO dnetapi; - - -REVOKE ALL ON TABLE dsm_datasource_api FROM PUBLIC; -REVOKE ALL ON TABLE dsm_datasource_api FROM dnet; -GRANT ALL ON TABLE dsm_datasource_api TO dnet; -GRANT SELECT ON TABLE dsm_datasource_api TO dnetapi; - - diff --git a/apps/dnet-exporter-api/src/main/resources/dnet_info.sql b/apps/dnet-exporter-api/src/main/resources/dnet_info.sql deleted file mode 100644 index 23ddb680..00000000 --- a/apps/dnet-exporter-api/src/main/resources/dnet_info.sql +++ /dev/null @@ -1,21 +0,0 @@ - -CREATE TABLE info ( - key character varying(255) NOT NULL PRIMARY KEY, - value DATE -); - -GRANT ALL ON TABLE info TO dnet; -GRANT ALL ON TABLE info TO dnetapi; - -INSERT INTO info(key) VALUES ('oaf_load_date'); -INSERT INTO info(key) VALUES ('odf_load_date'); -INSERT INTO info(key) VALUES ('inference_date'); -INSERT INTO info(key) VALUES ('claim_load_date'); -INSERT INTO info(key) VALUES ('stats_update_date'); - -INSERT INTO info(key) VALUES ('crossref_update_date'); -INSERT INTO info(key) VALUES ('unpaywall_update_date'); -INSERT INTO info(key) VALUES ('orcid_update_date'); -INSERT INTO info(key) VALUES ('mag_update_date'); - - diff --git a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources.sql.st b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources.sql.st index a1d29624..d6e3a311 100644 --- a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources.sql.st +++ b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources.sql.st @@ -10,9 +10,9 @@ select a.last_collection_date as "lastCollectionDate", a.last_collection_total as "lastCollectionTotal" from - dsm_datasources d - left outer join dsm_api a on (d.id = a.datasource) - left outer join dsm_datasource_organization dso on (d.id = dso.datasource) + dsm_services d + left outer join dsm_api a on (d.id = a.service) + left outer join dsm_service_organization dso on (d.id = dso.service) left outer join dsm_organizations o on (o.id = dso.organization) where d.registrationdate is not null diff --git a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate.st.sql b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate.st.sql index 057d5a2f..e014461c 100644 --- a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate.st.sql +++ b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate.st.sql @@ -1,8 +1,8 @@ select count(d.id) as count from - dsm_datasources d - left outer join dsm_api a on (d.id = a.datasource) - left outer join dsm_datasource_organization dso on (d.id = dso.datasource) + dsm_services d + left outer join dsm_api a on (d.id = a.service) + left outer join dsm_service_organization dso on (d.id = dso.service) left outer join dsm_organizations o on (o.id = dso.organization) where d.registrationdate >= cast(? as date) diff --git a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate_typology.st.sql b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate_typology.st.sql index ae5de98c..76a8fb45 100644 --- a/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate_typology.st.sql +++ b/apps/dnet-exporter-api/src/main/resources/eu/dnetlib/openaire/sql/recent_registered_datasources_fromDate_typology.st.sql @@ -1,8 +1,8 @@ select count(d.id) as count from - dsm_datasources d - left outer join dsm_api a on (d.id = a.datasource) - left outer join dsm_datasource_organization dso on (d.id = dso.datasource) + dsm_services d + left outer join dsm_api a on (d.id = a.service) + left outer join dsm_service_organization dso on (d.id = dso.service) left outer join dsm_organizations o on (o.id = dso.organization) where d.registrationdate >= cast(? as date)