Spring RDF Migration Library should help users to maintain migrations for their Triple Stores.
Firstly, you need to define a migration runner bean in your configuration.
@Bean
public RdfProductionMigrationRunner rdfProductionMigrationRunner(RdfMigrationRepository rdfMigrationRepository,
ApplicationContext appContext) {
RdfProductionMigrationRunner mr = new RdfProductionMigrationRunner(rdfMigrationRepository, appContext);
mr.run();
return mr;
}
You have to adjust your MongoDB configuration to include entities and repositories from Spring RDF Migration library.
@Configuration
@EnableMongoRepositories(basePackages = {"com.example", "org.fairdatateam.rdf.migration"})
public class MongoConfig {
}
That's all! You can start creating your migrations. See the example below.
@RdfMigrationAnnotation(
number = 1,
name = "Init migration",
description = "Load initial data into Triple Store")
@Service
public class Rdf_Migration_0001_Init implements RdfProductionMigration {
@Autowired
protected Repository repository;
public void runMigration() {
// your code
}
}
Stack:
- Java (recommended JDK 17)
- Maven (recommended 3.2.5 or higher)
Run these commands from the root of the project
$ mvn package
Run these commands from the root of the project
$ mvn javadoc:javadoc