diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java b/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java index 59c4aeb2c..4e825f0eb 100644 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java +++ b/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java @@ -22,7 +22,6 @@ */ package org.fairdatapoint.database.rdf.migration; -import jakarta.annotation.PostConstruct; import org.fairdatapoint.Profiles; import org.fairdatapoint.database.rdf.migration.development.metadata.AclMigration; import org.fairdatapoint.database.rdf.migration.development.metadata.RdfMetadataMigration; @@ -32,7 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.annotation.Profile; +import org.springframework.context.event.EventListener; import org.springframework.stereotype.Service; @Service @@ -52,7 +53,7 @@ public class RdfDevelopmentMigrationRunner { @Qualifier("genericMetadataRepository") private GenericMetadataRepository metadataRepository; - @PostConstruct + @EventListener(ApplicationReadyEvent.class) public void run() { rdfMetadataMigration.runMigration(); if (activeProfile.equals(Profiles.DEVELOPMENT)) { diff --git a/src/main/resources/application-development.yml b/src/main/resources/application-development.yml index 359635210..171b64706 100644 --- a/src/main/resources/application-development.yml +++ b/src/main/resources/application-development.yml @@ -12,6 +12,9 @@ spring: username: fdp password: fdp flyway: - locations: classpath:dev/db/migration,classpath:db/migration + locations: classpath:db/migration fail-on-missing-locations: true clean-disabled: false + +bootstrap: + enabled: true diff --git a/src/main/resources/dev/db/migration/V0001.1__dev-data-users.sql b/src/main/resources/dev/db/migration/V0001.1__dev-data-users.sql deleted file mode 100644 index 998d05ade..000000000 --- a/src/main/resources/dev/db/migration/V0001.1__dev-data-users.sql +++ /dev/null @@ -1,61 +0,0 @@ --- --- The MIT License --- Copyright © 2016-2024 FAIR Data Team --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- THE SOFTWARE. --- - --- User Accounts -INSERT INTO public.user_account (uuid, first_name, last_name, email, password_hash, user_role, created_at, updated_at) -VALUES ('95589e50-d261-492b-8852-9324e9a66a42', 'Admin', 'von Universe', 'admin@example.com', '$2a$10$L.0OZ8QjV3yLhoCDvU04gu.WP1wGQih41MsBdvtQOshJJntaugBxe', 'ADMIN', NOW(), NOW()); - -INSERT INTO public.user_account (uuid, first_name, last_name, email, password_hash, user_role, created_at, updated_at) -VALUES ('7e64818d-6276-46fb-8bb1-732e6e09f7e9', 'Albert', 'Einstein', 'albert.einstein@example.com', '$2a$10$hZF1abbZ48Tf.3RndC9W6OlDt6gnBoD/2HbzJayTs6be7d.5DbpnW', 'USER', NOW(), NOW()); - -INSERT INTO public.user_account (uuid, first_name, last_name, email, password_hash, user_role, created_at, updated_at) -VALUES ('b5b92c69-5ed9-4054-954d-0121c29b6800', 'Nikola', 'Tesla', 'nikola.tesla@example.com', '$2a$10$tMbZUZg9AbYL514R.hZ0tuzvfZJR5NQhSVeJPTQhNwPf6gv/cvrna', 'USER', NOW(), NOW()); - -INSERT INTO public.user_account (uuid, first_name, last_name, email, password_hash, user_role, created_at, updated_at) -VALUES ('8d1a4c06-bb0e-4d03-a01f-14fa49bbc152', 'Isaac', 'Newton', 'isaac.newton@example.com', '$2a$10$DLkI7NAZDzWVaKG1lVtloeoPNLPoAgDDBqQKQiSAYDZXrf2QKkuHC', 'USER', NOW(), NOW()); - --- API Keys -INSERT INTO public.api_key (uuid, token, user_account_id, created_at, updated_at) -VALUES ('a1c00673-24c5-4e0a-bdbe-22e961ee7548', 'a274793046e34a219fd0ea6362fcca61a001500b71724f4c973a017031653c20', '7e64818d-6276-46fb-8bb1-732e6e09f7e9', NOW(), NOW()); - -INSERT INTO public.api_key (uuid, token, user_account_id, created_at, updated_at) -VALUES ('62657760-21fe-488c-a0ea-f612a70493da', 'dd5dc3b53b6145cfa9f6c58b72ebad21cd2f860ace62451ba4e3c74a0e63540a', 'b5b92c69-5ed9-4054-954d-0121c29b6800', NOW(), NOW()); - --- Saved Search Queries -INSERT INTO public.search_saved_query (uuid, name, description, type, var_prefixes, var_graph_pattern, var_ordering, user_account_id, created_at, updated_at) -VALUES ('d31e3da1-2cfa-4b55-a8cb-71d1acf01aef', 'All datasets', 'Quickly query all datasets (DCAT)', 'PUBLIC', - 'PREFIX dcat: ', '?entity rdf:type dcat:Dataset .', 'ASC(?title)', '7e64818d-6276-46fb-8bb1-732e6e09f7e9', - NOW(), NOW()); - -INSERT INTO public.search_saved_query (uuid, name, description, type, var_prefixes, var_graph_pattern, var_ordering, user_account_id, created_at, updated_at) -VALUES ('c7d0b6a0-5b0a-4b0e-9b0a-9b0a9b0a9b0a', 'All distributions', 'Quickly query all distributions (DCAT)', 'INTERNAL', - 'PREFIX dcat: ', '?entity rdf:type dcat:Distribution .', 'ASC(?title)', '7e64818d-6276-46fb-8bb1-732e6e09f7e9', - NOW(), NOW()); - -INSERT INTO public.search_saved_query (uuid, name, description, type, var_prefixes, var_graph_pattern, var_ordering, user_account_id, created_at, updated_at) -VALUES ('97da9119-834e-4687-8321-3df157547178', 'Things with data', 'This is private query of Nikola Tesla!', 'PRIVATE', - 'PREFIX dcat: ', - '?entity ?relationPredicate ?relationObject . - FILTER isLiteral(?relationObject) - FILTER CONTAINS(LCASE(str(?relationObject)), LCASE("data"))', - 'ASC(?title)', '7e64818d-6276-46fb-8bb1-732e6e09f7e9', NOW(), NOW()); diff --git a/src/main/resources/dev/db/migration/V0001.2__dev-data-schemas.sql b/src/main/resources/dev/db/migration/V0001.2__dev-data-schemas.sql deleted file mode 100644 index 310c8377f..000000000 --- a/src/main/resources/dev/db/migration/V0001.2__dev-data-schemas.sql +++ /dev/null @@ -1,505 +0,0 @@ --- --- The MIT License --- Copyright © 2016-2024 FAIR Data Team --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- THE SOFTWARE. --- - --- Resource -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('6a668323-3936-4b53-8380-a4fd2ed082ee', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('71d77460-f919-4f72-b265-ed26567fe361', - '6a668323-3936-4b53-8380-a4fd2ed082ee', - NULL, - '1.0.0', - 'Resource', - '', - '@prefix : . - @prefix dash: . - @prefix dcat: . - @prefix dct: . - @prefix foaf: . - @prefix sh: . - @prefix xsd: . - - :ResourceShape a sh:NodeShape ; - sh:targetClass dcat:Resource ; - sh:property [ - sh:path dct:title ; - sh:nodeKind sh:Literal ; - sh:minCount 1 ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - sh:order 1 ; - ], [ - sh:path dct:description ; - sh:nodeKind sh:Literal ; - sh:maxCount 1 ; - dash:editor dash:TextAreaEditor ; - sh:order 2 ; - ], [ - sh:path dct:publisher ; - sh:node :AgentShape ; - sh:minCount 1 ; - sh:maxCount 1 ; - dash:editor dash:BlankNodeEditor ; - sh:order 3 ; - ], [ - sh:path dcat:version ; - sh:name "version" ; - sh:nodeKind sh:Literal ; - sh:minCount 1 ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 4 ; - ], [ - sh:path dct:language ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:defaultValue ; - sh:order 5 ; - ], [ - sh:path dct:license ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:defaultValue ; - sh:order 6 ; - ], [ - sh:path dct:rights ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 7 ; - ] . - - :AgentShape a sh:NodeShape ; - sh:targetClass foaf:Agent ; - sh:property [ - sh:path foaf:name ; - sh:nodeKind sh:Literal ; - sh:minCount 1 ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - ] . - ', - ARRAY ['http://www.w3.org/ns/dcat#Resource'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - TRUE, - NULL, - NULL, - NOW(), - NOW()); - --- Data Service -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('89d94c1b-f6ff-4545-ba9b-120b2d1921d0', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('9111d436-fe58-4bd5-97ae-e6f86bc2997a', - '89d94c1b-f6ff-4545-ba9b-120b2d1921d0', - NULL, - '1.0.0', - 'Data Service', - '', - '@prefix : . -@prefix dash: . -@prefix dcat: . -@prefix dct: . -@prefix sh: . -@prefix xsd: . - -:DataServiceShape a sh:NodeShape ; - sh:targetClass dcat:DataService ; - sh:property [ - sh:path dcat:endpointURL ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - sh:order 20 ; - ] , [ - sh:path dcat:endpointDescription ; - sh:nodeKind sh:Literal ; - sh:maxCount 1 ; - dash:editor dash:TextAreaEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 21 ; -] . -', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#DataService'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('2efc8366-541d-493f-8661-69ad8f72dfa1', '9111d436-fe58-4bd5-97ae-e6f86bc2997a', '6a668323-3936-4b53-8380-a4fd2ed082ee', 0); - --- Metadata Service -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('6f7a5a76-6185-4bd0-9fe9-62ecc90c9bad', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('36b22b70-6203-4dd2-9fb6-b39a776bf467', - '6f7a5a76-6185-4bd0-9fe9-62ecc90c9bad', - NULL, - '1.0.0', - 'Metadata Service', - '', - '@prefix : . -@prefix fdp: . -@prefix sh: . - -:MetadataServiceShape a sh:NodeShape ; - sh:targetClass fdp:MetadataService . -', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#DataService', 'https://w3id.org/fdp/fdp-o#MetadataService'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('8742361b-cd00-4167-b859-e45fa36d0cb7', '36b22b70-6203-4dd2-9fb6-b39a776bf467', '89d94c1b-f6ff-4545-ba9b-120b2d1921d0', 0); - --- FAIR Data Point -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('a92958ab-a414-47e6-8e17-68ba96ba3a2b', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('4e64208d-f102-45a0-96e3-17b002e6213e', - 'a92958ab-a414-47e6-8e17-68ba96ba3a2b', - NULL, - '1.0.0', - 'FAIR Data Point', - '', - '@prefix : . -@prefix dash: . -@prefix dct: . -@prefix fdp: . -@prefix sh: . -@prefix xsd: . - -:FDPShape a sh:NodeShape ; - sh:targetClass fdp:FAIRDataPoint ; - sh:property [ - sh:path fdp:startDate ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 40 ; - ] , [ - sh:path fdp:endDate ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 41 ; - ] , [ - sh:path fdp:uiLanguage ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - sh:defaultValue ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 42 ; - ] , [ - sh:path fdp:metadataIdentifier ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 43 ; - ] , [ - sh:path fdp:metadataIssued ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:viewer dash:LiteralViewer ; - sh:order 44 ; - ] , [ - sh:path fdp:metadataModified ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:viewer dash:LiteralViewer ; - sh:order 45 ; - ] . - ', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#DataService', 'https://w3id.org/fdp/fdp-o#MetadataService', 'https://w3id.org/fdp/fdp-o#FAIRDataPoint'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('afebd441-8aa5-464d-bc3c-033f175449b4', '4e64208d-f102-45a0-96e3-17b002e6213e', '6f7a5a76-6185-4bd0-9fe9-62ecc90c9bad', 0); - --- Catalog -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('2aa7ba63-d27a-4c0e-bfa6-3a4e250f4660', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('c9640671-945d-4114-88fb-e81314cb7ab2', - '2aa7ba63-d27a-4c0e-bfa6-3a4e250f4660', - NULL, - '1.0.0', - 'Catalog', - '', - '@prefix : . -@prefix dash: . -@prefix dcat: . -@prefix dct: . -@prefix foaf: . -@prefix sh: . -@prefix xsd: . - -:CatalogShape a sh:NodeShape ; - sh:targetClass dcat:Catalog ; - sh:property [ - sh:path dct:issued ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:viewer dash:LiteralViewer ; - sh:order 20 ; - ], [ - sh:path dct:modified ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:viewer dash:LiteralViewer ; - sh:order 21 ; - ], [ - sh:path foaf:homePage ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 22 ; - ], [ - sh:path dcat:themeTaxonomy ; - sh:nodeKind sh:IRI ; - dash:viewer dash:LabelViewer ; - sh:order 23 ; - ] . -', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#Catalog'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('e75cb601-318d-41ea-9a8b-32e0749c80a7', 'c9640671-945d-4114-88fb-e81314cb7ab2', '6a668323-3936-4b53-8380-a4fd2ed082ee', 0); - --- Dataset -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('866d7fb8-5982-4215-9c7c-18d0ed1bd5f3', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('9cc3c89a-76cf-4639-a71f-652627af51db', - '866d7fb8-5982-4215-9c7c-18d0ed1bd5f3', - NULL, - '1.0.0', - 'Dataset', - '', - '@prefix : . -@prefix dash: . -@prefix dcat: . -@prefix dct: . -@prefix sh: . -@prefix xsd: . - -:DatasetShape a sh:NodeShape ; - sh:targetClass dcat:Dataset ; - sh:property [ - sh:path dct:issued ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 20 ; - ], [ - sh:path dct:modified ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 21 ; - ], [ - sh:path dcat:theme ; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 22 ; - ], [ - sh:path dcat:contactPoint ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 23 ; - ], [ - sh:path dcat:keyword ; - sh:nodeKind sh:Literal ; - dash:editor dash:TextFieldEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 24 ; - ], [ - sh:path dcat:landingPage ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - dash:viewer dash:LabelViewer ; - sh:order 25 ; - ] . -', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#Dataset'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('da13ba37-09f8-4937-9055-e3ee3aefc57c', '9cc3c89a-76cf-4639-a71f-652627af51db', '6a668323-3936-4b53-8380-a4fd2ed082ee', 0); - --- Distribution -INSERT INTO metadata_schema (uuid, created_at, updated_at) -VALUES ('ebacbf83-cd4f-4113-8738-d73c0735b0ab', NOW(), NOW()); -INSERT INTO metadata_schema_version (uuid, metadata_schema_id, previous_version_id, version, name, description, - definition, target_classes, type, origin, imported_from, state, published, - abstract, suggested_resource_name, suggested_url_prefix, created_at, updated_at) -VALUES ('3cda8cd3-b08b-4797-822d-d3f3e83c466a', - 'ebacbf83-cd4f-4113-8738-d73c0735b0ab', - NULL, - '1.0.0', - 'Distribution', - '', - '@prefix : . -@prefix dash: . -@prefix dcat: . -@prefix dct: . -@prefix sh: . -@prefix xsd: . - -:DistributionShape a sh:NodeShape ; - sh:targetClass dcat:Distribution ; - sh:property [ - sh:path dct:issued ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 20 ; - ] , [ - sh:path dct:modified ; - sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - dash:editor dash:DatePickerEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 21 ; - ] , [ - sh:path dcat:accessURL ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - sh:order 22 ; - ] , [ - sh:path dcat:downloadURL ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - dash:editor dash:URIEditor ; - sh:order 23 ; - ] , [ - sh:path dcat:mediaType ; - sh:nodeKind sh:Literal ; - sh:minCount 1 ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 24 ; - ] , [ - sh:path dcat:format ; - sh:nodeKind sh:Literal ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 25 ; - ] , [ - sh:path dcat:byteSize ; - sh:nodeKind sh:Literal ; - sh:maxCount 1 ; - dash:editor dash:TextFieldEditor ; - dash:viewer dash:LiteralViewer ; - sh:order 26 ; - ] . -', - ARRAY ['http://www.w3.org/ns/dcat#Resource', 'http://www.w3.org/ns/dcat#Distribution'], - 'INTERNAL', - NULL, - NULL, - 'LATEST', - FALSE, - FALSE, - NULL, - NULL, - NOW(), - NOW()); -INSERT INTO metadata_schema_extension (uuid, metadata_schema_version_id, extended_metadata_schema_id, order_priority) -VALUES ('a3b16a4e-cac7-4b71-a3de-94bb86714b5b', '3cda8cd3-b08b-4797-822d-d3f3e83c466a', '6a668323-3936-4b53-8380-a4fd2ed082ee', 0); diff --git a/src/main/resources/dev/db/migration/V0001.3__dev-data-rds.sql b/src/main/resources/dev/db/migration/V0001.3__dev-data-rds.sql deleted file mode 100644 index ed4f047ff..000000000 --- a/src/main/resources/dev/db/migration/V0001.3__dev-data-rds.sql +++ /dev/null @@ -1,68 +0,0 @@ --- --- The MIT License --- Copyright © 2016-2024 FAIR Data Team --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- THE SOFTWARE. --- - --- Distribution -INSERT INTO resource_definition (uuid, name, url_prefix, created_at, updated_at) -VALUES ('02c649de-c579-43bb-b470-306abdc808c7', 'Distribution', 'distribution', now(), now()); - -INSERT INTO resource_definition_link (uuid, resource_definition_id, title, property_uri, order_priority, created_at, updated_at) -VALUES ('660a1821-a5d2-48d0-a26b-0c6d5bac3de4', '02c649de-c579-43bb-b470-306abdc808c7', 'Access online', 'http://www.w3.org/ns/dcat#accessURL', 1, now(), now()); - -INSERT INTO resource_definition_link (uuid, resource_definition_id, title, property_uri, order_priority, created_at, updated_at) -VALUES ('c2eaebb8-4d8d-469d-8736-269adeded996', '02c649de-c579-43bb-b470-306abdc808c7', 'Download', 'http://www.w3.org/ns/dcat#downloadURL', 2, now(), now()); - -INSERT INTO metadata_schema_usage (uuid, resource_definition_id, metadata_schema_id, order_priority) -VALUES ('bbf4ecb3-c529-4c02-955c-7160755debf5', '02c649de-c579-43bb-b470-306abdc808c7', 'ebacbf83-cd4f-4113-8738-d73c0735b0ab', 1); - --- Dataset -INSERT INTO resource_definition (uuid, name, url_prefix, created_at, updated_at) -VALUES ('2f08228e-1789-40f8-84cd-28e3288c3604', 'Dataset', 'dataset', now(), now()); - -INSERT INTO resource_definition_child (uuid, source_resource_definition_id, target_resource_definition_id, relation_uri, title, tags_uri, order_priority, created_at, updated_at) -VALUES ('9f138a13-9d45-4371-b763-0a3b9e0ec912', '2f08228e-1789-40f8-84cd-28e3288c3604', '02c649de-c579-43bb-b470-306abdc808c7', 'http://www.w3.org/ns/dcat#distribution', 'Distributions', NULL, 1, now(), now()); - -INSERT INTO resource_definition_child_metadata (uuid, resource_definition_child_id, title, property_uri, order_priority, created_at, updated_at) -VALUES ('723e95d3-1696-45e2-9429-f6e98e3fb893', '9f138a13-9d45-4371-b763-0a3b9e0ec912', 'Media Type', 'http://www.w3.org/ns/dcat#mediaType', 1, now(), now()); - -INSERT INTO metadata_schema_usage (uuid, resource_definition_id, metadata_schema_id, order_priority) -VALUES ('b8a0ed37-42a1-487e-8842-09fe082c4cc6', '2f08228e-1789-40f8-84cd-28e3288c3604', '866d7fb8-5982-4215-9c7c-18d0ed1bd5f3', 1); - --- Catalog -INSERT INTO resource_definition (uuid, name, url_prefix, created_at, updated_at) -VALUES ('a0949e72-4466-4d53-8900-9436d1049a4b', 'Catalog', 'catalog', now(), now()); - -INSERT INTO resource_definition_child (uuid, source_resource_definition_id, target_resource_definition_id, relation_uri, title, tags_uri, order_priority, created_at, updated_at) -VALUES ('e9f0f5d3-2a93-4aa3-9dd0-acb1d76f54fc', 'a0949e72-4466-4d53-8900-9436d1049a4b', '2f08228e-1789-40f8-84cd-28e3288c3604', 'http://www.w3.org/ns/dcat#dataset', 'Datasets', 'http://www.w3.org/ns/dcat#theme', 1, now(), now()); - -INSERT INTO metadata_schema_usage (uuid, resource_definition_id, metadata_schema_id, order_priority) -VALUES ('e4df9510-a3ad-4e3b-a1a9-5fc330d8b1f0', 'a0949e72-4466-4d53-8900-9436d1049a4b', '2aa7ba63-d27a-4c0e-bfa6-3a4e250f4660', 1); - --- FAIR Data Point -INSERT INTO resource_definition (uuid, name, url_prefix, created_at, updated_at) -VALUES ('77aaad6a-0136-4c6e-88b9-07ffccd0ee4c', 'FAIR Data Point', '', now(), now()); - -INSERT INTO resource_definition_child (uuid, source_resource_definition_id, target_resource_definition_id, relation_uri, title, tags_uri, order_priority, created_at, updated_at) -VALUES ('b8648597-8fbd-4b89-9e30-5eab82675e42', '77aaad6a-0136-4c6e-88b9-07ffccd0ee4c', 'a0949e72-4466-4d53-8900-9436d1049a4b', 'https://w3id.org/fdp/fdp-o#metadataCatalog', 'Catalogs', 'http://www.w3.org/ns/dcat#themeTaxonomy', 1, now(), now()); - -INSERT INTO metadata_schema_usage (uuid, resource_definition_id, metadata_schema_id, order_priority) -VALUES ('9b3a32a8-a14c-4eb0-ba02-3aa8e13a8f11', '77aaad6a-0136-4c6e-88b9-07ffccd0ee4c', 'a92958ab-a414-47e6-8e17-68ba96ba3a2b', 1); diff --git a/src/main/resources/dev/db/migration/V0001.4__dev-data-membership.sql b/src/main/resources/dev/db/migration/V0001.4__dev-data-membership.sql deleted file mode 100644 index 8240e0bfe..000000000 --- a/src/main/resources/dev/db/migration/V0001.4__dev-data-membership.sql +++ /dev/null @@ -1,43 +0,0 @@ --- --- The MIT License --- Copyright © 2016-2024 FAIR Data Team --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- THE SOFTWARE. --- - -INSERT INTO membership (uuid, name, allowed_entities, created_at, updated_at) -VALUES ('49f2bcfd-ef0a-4a3a-a1a3-0fc72a6892a8', 'Owner', ARRAY ['a0949e72-4466-4d53-8900-9436d1049a4b', '2f08228e-1789-40f8-84cd-28e3288c3604', '02c649de-c579-43bb-b470-306abdc808c7'], NOW(), NOW()); - -INSERT INTO membership (uuid, name, allowed_entities, created_at, updated_at) -VALUES ('87a2d984-7db2-43f6-805c-6b0040afead5', 'Data Provider', ARRAY ['a0949e72-4466-4d53-8900-9436d1049a4b'], NOW(), NOW()); - -INSERT INTO membership_permission (uuid, membership_id, mask, code, created_at, updated_at) -VALUES ('e0d9f853-637b-4c50-9ad9-07b6349bf76f', '49f2bcfd-ef0a-4a3a-a1a3-0fc72a6892a8', 2, 'W', NOW(), NOW()); - -INSERT INTO membership_permission (uuid, membership_id, mask, code, created_at, updated_at) -VALUES ('de4e4f85-f11d-475b-b6f0-33bdfe5f923a', '49f2bcfd-ef0a-4a3a-a1a3-0fc72a6892a8', 4, 'C', NOW(), NOW()); - -INSERT INTO membership_permission (uuid, membership_id, mask, code, created_at, updated_at) -VALUES ('60bebbf0-210d-4b05-af85-ca1b58546261', '49f2bcfd-ef0a-4a3a-a1a3-0fc72a6892a8', 8, 'D', NOW(), NOW()); - -INSERT INTO membership_permission (uuid, membership_id, mask, code, created_at, updated_at) -VALUES ('36c3b6e9-f2e3-48b7-bae1-4dc3196a3657', '49f2bcfd-ef0a-4a3a-a1a3-0fc72a6892a8', 16, 'A', NOW(), NOW()); - -INSERT INTO membership_permission (uuid, membership_id, mask, code, created_at, updated_at) -VALUES ('589d09d3-1c29-4c6f-97fc-6ea4e007fb85', '87a2d984-7db2-43f6-805c-6b0040afead5', 4, 'C', NOW(), NOW()); diff --git a/src/main/resources/dev/db/migration/V0001.5__dev-settings.sql b/src/main/resources/dev/db/migration/V0001.5__dev-settings.sql deleted file mode 100644 index 75496e02a..000000000 --- a/src/main/resources/dev/db/migration/V0001.5__dev-settings.sql +++ /dev/null @@ -1,73 +0,0 @@ --- --- The MIT License --- Copyright © 2016-2024 FAIR Data Team --- --- Permission is hereby granted, free of charge, to any person obtaining a copy --- of this software and associated documentation files (the "Software"), to deal --- in the Software without restriction, including without limitation the rights --- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --- copies of the Software, and to permit persons to whom the Software is --- furnished to do so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in --- all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN --- THE SOFTWARE. --- - --- Settings -INSERT INTO settings (uuid, app_title, app_subtitle, ping_enabled, ping_endpoints, autocomplete_search_ns, created_at, updated_at) -VALUES ('00000000-0000-0000-0000-000000000000', 'FAIR Data Point', 'FDP Development Instance', False, ARRAY ['https://home.fairdatapoint.org'], True, now(), now()); - --- Autocomplete Sources -INSERT INTO settings_autocomplete_source (uuid, settings_id, rdf_type, sparql_endpoint, sparql_query, order_priority, created_at, updated_at) -VALUES ('d4045a98-dd25-493e-a0b1-d704921c0930', '00000000-0000-0000-0000-000000000000', 'http://www.w3.org/2000/01/rdf-schema#Class', 'http://localhost:3030/ds/query', -'SELECT DISTINCT ?uri ?label -WHERE { ?uri a . -?uri ?label . -FILTER regex(?label, ".*%s.*", "i") } -ORDER BY ?label', - 1, now(), now()); - --- Search Filters: Type -INSERT INTO settings_search_filter (uuid, settings_id, type, label, predicate, query_records, order_priority, created_at, updated_at) -VALUES ('57a98728-ce8c-4e7f-b0f8-94e2668b44d3', '00000000-0000-0000-0000-000000000000', 'IRI', 'Type', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', False, 1, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('b48c2c7f-d7fb-47ae-a72c-b1b360e16f6e', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'Catalog', 'http://www.w3.org/ns/dcat#Catalog', 1, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('3e1598ac-9d29-47f0-8e7b-3c26ca0134a0', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'Dataset', 'http://www.w3.org/ns/dcat#Dataset', 2, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('5697d8d9-f09d-4ebe-b834-b37eb0624c3f', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'Distribution', 'http://www.w3.org/ns/dcat#Distribution', 3, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('022c3bc6-0598-408c-8d2e-b486dafb73dd', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'Data Service', 'http://www.w3.org/ns/dcat#DataService', 4, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('7cee5591-8620-4fea-b883-a94285012b8d', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'Metadata Service', 'https://w3id.org/fdp/fdp-o#MetadataService', 5, now(), now()); - -INSERT INTO settings_search_filter_item (uuid, filter_id, label, value, order_priority, created_at, updated_at) -VALUES ('9d661dca-8017-4dba-b930-cd2834ea59e8', '57a98728-ce8c-4e7f-b0f8-94e2668b44d3', 'FAIR Data Point', 'https://w3id.org/fdp/fdp-o#FAIRDataPoint', 6, now(), now()); - --- Search Filters: License -INSERT INTO settings_search_filter (uuid, settings_id, type, label, predicate, query_records, order_priority, created_at, updated_at) -VALUES ('26913eb3-67dd-45c9-b8ff-4c97e8162a9b', '00000000-0000-0000-0000-000000000000', 'IRI', 'License', 'http://purl.org/dc/terms/license', True, 2, now(), now()); - --- Search Filters: License -INSERT INTO settings_search_filter (uuid, settings_id, type, label, predicate, query_records, order_priority, created_at, updated_at) -VALUES ('cb25afb4-6169-42f8-bde5-181c803773a8', '00000000-0000-0000-0000-000000000000', 'IRI', 'Version', 'http://www.w3.org/ns/dcat#version', True, 3, now(), now()); - --- Metrics -INSERT INTO settings_metric (uuid, settings_id, metric_uri, resource_uri, order_priority, created_at, updated_at) -VALUES ('8435491b-c16c-4457-ae94-e0f4128603d5', '00000000-0000-0000-0000-000000000000', 'https://purl.org/fair-metrics/FM_F1A', 'https://www.ietf.org/rfc/rfc3986.txt', 1, now(), now()); - -INSERT INTO settings_metric (uuid, settings_id, metric_uri, resource_uri, order_priority, created_at, updated_at) -VALUES ('af93d36a-0af0-4054-8c00-2675d460b231', '00000000-0000-0000-0000-000000000000', 'https://purl.org/fair-metrics/FM_A1.1', 'https://www.wikidata.org/wiki/Q8777', 2, now(), now());