From ff2e0823692b54644bfa3517c5e8f27571bb67cc Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:07:06 +0100 Subject: [PATCH 1/4] remove RepositoryMigrationConfig The implementation for v2 was still WIP anyway. For now we focus on fixtures-based bootstrapping. If necessary, we can restore migration-based bootstrapping later. --- .../config/RepositoryMigrationConfig.java | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/main/java/org/fairdatapoint/config/RepositoryMigrationConfig.java diff --git a/src/main/java/org/fairdatapoint/config/RepositoryMigrationConfig.java b/src/main/java/org/fairdatapoint/config/RepositoryMigrationConfig.java deleted file mode 100644 index 9c7f96a32..000000000 --- a/src/main/java/org/fairdatapoint/config/RepositoryMigrationConfig.java +++ /dev/null @@ -1,48 +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. - */ -package org.fairdatapoint.config; - -import org.fairdatapoint.Profiles; -import org.fairdatateam.rdf.migration.database.RdfMigrationRepository; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigrationRunner; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -public class RepositoryMigrationConfig { - - @Bean - @Profile(Profiles.PRODUCTION) - public RdfProductionMigrationRunner rdfProductionMigrationRunner( - RdfMigrationRepository rdfMigrationRepository, - ApplicationContext appContext - ) { - final RdfProductionMigrationRunner mr = - new RdfProductionMigrationRunner(rdfMigrationRepository, appContext); - mr.run(); - return mr; - } - -} From bbbae338b5404e1f95aa56e503916b2acb62dd2b Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:10:48 +0100 Subject: [PATCH 2/4] remove spring-rdf-migration dependency this was only used by RepositoryMigrationConfig --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 361daa58d..733440f45 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ 21 - 2.0.0 0.2.0 @@ -81,11 +80,6 @@ - - org.fairdatateam.rdf - spring-rdf-migration - ${spring.rdf.migration.version} - org.fairdatateam.rdf rdf-resource-resolver-core From 0b5c1ae03de846568e900f33dc9cc280ff3aad61 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:14:47 +0100 Subject: [PATCH 3/4] remove rdf migration classes from rdf/migration/production These were only partially implemented and marked for removal, in favor of the bootstrap approach. --- .../production/Rdf_Migration_0001_Init.java | 97 ------------------- .../Rdf_Migration_0002_Metadata_Draft.java | 42 -------- .../production/Rdf_Migration_0003_FDPO.java | 41 -------- .../Rdf_Migration_0004_Cleanup_Index.java | 41 -------- ...Rdf_Migration_0005_FixMetadataVersion.java | 41 -------- 5 files changed, 262 deletions(-) delete mode 100644 src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0001_Init.java delete mode 100644 src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0002_Metadata_Draft.java delete mode 100644 src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0003_FDPO.java delete mode 100644 src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0004_Cleanup_Index.java delete mode 100644 src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0005_FixMetadataVersion.java diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0001_Init.java b/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0001_Init.java deleted file mode 100644 index e2313a4e3..000000000 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0001_Init.java +++ /dev/null @@ -1,97 +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. - */ -package org.fairdatapoint.database.rdf.migration.production; - -import lombok.extern.slf4j.Slf4j; -import org.fairdatapoint.service.reset.FactoryDefaults; -import org.fairdatateam.rdf.migration.entity.RdfMigrationAnnotation; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigration; -import org.bson.Document; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.util.List; - -@RdfMigrationAnnotation( - number = 1, - name = "Init migration", - description = "Load basic fixtures for repository, catalog, dataset and distribution") -@Slf4j -@Service -public class Rdf_Migration_0001_Init implements RdfProductionMigration { - // TODO: use data specs for initial data - - @Autowired - private Repository mainRepository; - - @Autowired - @Qualifier("persistentUrl") - private String persistentUrl; - - @Value("${metadataProperties.accessRightsDescription:This resource has no access restriction}") - private String accessRightsDescription; - - @Autowired - private IRI license; - - @Autowired - private IRI language; - - public void runMigration() { - createRepositoryInTripleStore(); - storePermissionForRepository(); - } - - private void createRepositoryInTripleStore() { - try (RepositoryConnection conn = mainRepository.getConnection()) { - final List statements = FactoryDefaults.repositoryStatements( - persistentUrl, - license, - language, - accessRightsDescription - ); - conn.add(statements); - } - catch (RepositoryException exception) { - log.error(exception.getMessage(), exception); - } - } - - private void storePermissionForRepository() { - // TODO - return; - } - - private Document repositoryPermission() { - // TODO - return null; - } - -} diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0002_Metadata_Draft.java b/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0002_Metadata_Draft.java deleted file mode 100644 index 908cd5f52..000000000 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0002_Metadata_Draft.java +++ /dev/null @@ -1,42 +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. - */ -package org.fairdatapoint.database.rdf.migration.production; - -import lombok.extern.slf4j.Slf4j; -import org.fairdatateam.rdf.migration.entity.RdfMigrationAnnotation; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigration; -import org.springframework.stereotype.Service; - -@RdfMigrationAnnotation( - number = 2, - name = "Metadata Draft", - description = "Support metadata in DRAFT state") -@Slf4j -@Service -public class Rdf_Migration_0002_Metadata_Draft implements RdfProductionMigration { - // TODO: remove (use seed) - - public void runMigration() { - - } -} diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0003_FDPO.java b/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0003_FDPO.java deleted file mode 100644 index 1e7bca1b5..000000000 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0003_FDPO.java +++ /dev/null @@ -1,41 +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. - */ -package org.fairdatapoint.database.rdf.migration.production; - -import lombok.extern.slf4j.Slf4j; -import org.fairdatateam.rdf.migration.entity.RdfMigrationAnnotation; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigration; -import org.springframework.stereotype.Service; - -@RdfMigrationAnnotation( - number = 3, - name = "FDPO Compliance", - description = "Comply with FDP-O Metadata Service") -@Slf4j -@Service -public class Rdf_Migration_0003_FDPO implements RdfProductionMigration { - // TODO: remove (use seed) - - public void runMigration() { - } -} diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0004_Cleanup_Index.java b/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0004_Cleanup_Index.java deleted file mode 100644 index b9635c9c2..000000000 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0004_Cleanup_Index.java +++ /dev/null @@ -1,41 +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. - */ -package org.fairdatapoint.database.rdf.migration.production; - -import lombok.extern.slf4j.Slf4j; -import org.fairdatateam.rdf.migration.entity.RdfMigrationAnnotation; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigration; -import org.springframework.stereotype.Service; - -@RdfMigrationAnnotation( - number = 4, - name = "Cleanup Index", - description = "Cleanup harvested record stored in separate named graphs") -@Slf4j -@Service -public class Rdf_Migration_0004_Cleanup_Index implements RdfProductionMigration { - // TODO: remove (use seed) - - public void runMigration() { - } -} diff --git a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0005_FixMetadataVersion.java b/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0005_FixMetadataVersion.java deleted file mode 100644 index f6ef3d14c..000000000 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/production/Rdf_Migration_0005_FixMetadataVersion.java +++ /dev/null @@ -1,41 +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. - */ -package org.fairdatapoint.database.rdf.migration.production; - -import lombok.extern.slf4j.Slf4j; -import org.fairdatateam.rdf.migration.entity.RdfMigrationAnnotation; -import org.fairdatateam.rdf.migration.runner.RdfProductionMigration; -import org.springframework.stereotype.Service; - -@RdfMigrationAnnotation( - number = 5, - name = "Fix Metadata Version", - description = "Use dcat:version instead of dcterms:hasVersion") -@Slf4j -@Service -public class Rdf_Migration_0005_FixMetadataVersion implements RdfProductionMigration { - // TODO: remove (use seed) - - public void runMigration() { - } -} From a942b553b1a9db31d9d999c57f49b6b710d72b13 Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:29:04 +0100 Subject: [PATCH 4/4] mark RdfDevelopmentMigrationRunner deprecated Keep it around for reference, but remove before merging into develop. --- .../rdf/migration/RdfDevelopmentMigrationRunner.java | 6 ++++++ 1 file changed, 6 insertions(+) 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..3b7cdf390 100644 --- a/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java +++ b/src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java @@ -35,6 +35,12 @@ import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; +/** + * Loads initial RDF data for development. + * TODO: remove all classes and files related to RDF migration, in favor of the fixtures-based approach. + * @deprecated use RDF fixtures instead, see {@link org.fairdatapoint.service.bootstrap bootstrap package} + */ +@Deprecated(forRemoval = true, since = "1") @Service @Profile(Profiles.NON_PRODUCTION) public class RdfDevelopmentMigrationRunner {