Skip to content

Commit

Permalink
Merge pull request #1270 from Informatievlaanderen/develop
Browse files Browse the repository at this point in the history
ci: finalize release 2.14.0
  • Loading branch information
jobulcke authored Apr 18, 2024
2 parents da158b8 + 33db897 commit c2af37d
Show file tree
Hide file tree
Showing 126 changed files with 157 additions and 637 deletions.
2 changes: 1 addition & 1 deletion ldes-fragmentisers/ldes-fragmentisers-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-fragmentisers</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldes-fragmentisers/ldes-fragmentisers-geospatial/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>ldes-fragmentisers</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldes-fragmentisers/ldes-fragmentisers-pagination/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>ldes-fragmentisers</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldes-fragmentisers/ldes-fragmentisers-reference/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-fragmentisers</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<artifactId>ldes-fragmentisers</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>

<artifactId>ldes-fragmentisers-timebased-hierarchical</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldes-fragmentisers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<artifactId>ldes-server</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>

<artifactId>ldes-fragmentisers</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldes-server-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<artifactId>ldes-server</artifactId>
<version>2.13.0-SNAPSHOT</version>
<version>2.14.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@ExtendWith(MockitoExtension.class)
class DcatDatasetServiceImplTest {
private static final String DATASET_ID = "id";
private static final String MODEL_FILE_PATH = "dcat-dataset/valid.ttl";
private static final String MODEL_FILE_PATH = "dcat/dataset/valid.ttl";
private DcatDataset dataset;

private DcatDatasetServiceImpl datasetService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void when_GetViewDescriptionResourceIsCalled_should_ReturnValidResource() {
@Test
void should_ReturnNamedDcatStatements_when_GetStatementsWithBaseIsCalled() {
String host = "http://localhost.dev";
Model view1 = RDFParser.source("viewconverter/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
Model view1 = RDFParser.source("dcat/dataservice/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
Model view2 = ModelFactory.createDefaultModel();
DcatView dcatView1 = DcatView.from(new ViewName("col1", "view1"), view1);
DcatView dcatView2 = DcatView.from(new ViewName("col1", "view2"), view2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void should_CombineServerDatasetAndViews_when_AllArePresent() {
}

private Optional<DcatServer> createServer() {
Model server = RDFParser.source("dcat/server.ttl").lang(Lang.TURTLE).build().toModel();
Model server = RDFParser.source("dcat/catalog/server.ttl").lang(Lang.TURTLE).build().toModel();
return Optional.of(new DcatServer(ID, server));
}

Expand All @@ -170,24 +170,24 @@ private List<DcatView> createViews() {
}

private List<DcatDataset> createDatasets() {
Model parcels = RDFParser.source("dcat/parcels.ttl").lang(Lang.TURTLE).build().toModel();
Model parcels = RDFParser.source("dcat/dataset/parcels.ttl").lang(Lang.TURTLE).build().toModel();
DcatDataset parcelDataset = new DcatDataset(COLLECTION_PARCELS, parcels);

Model buildings = RDFParser.source("dcat/buildings.ttl").lang(Lang.TURTLE).build().toModel();
Model buildings = RDFParser.source("dcat/dataset/buildings.ttl").lang(Lang.TURTLE).build().toModel();
DcatDataset buildingDataset = new DcatDataset(COLLECTION_BUILDINGS, buildings);
return List.of(parcelDataset, buildingDataset);
}

private List<DcatView> createDcatParcelViews() {
Model byPage = RDFParser.source("dcat/view-by-page.ttl").lang(Lang.TURTLE).build().toModel();
Model byTime = RDFParser.source("dcat/view-by-geospatial.ttl").lang(Lang.TURTLE).build().toModel();
Model byPage = RDFParser.source("dcat/dataservice/view-by-page.ttl").lang(Lang.TURTLE).build().toModel();
Model byTime = RDFParser.source("dcat/dataservice/view-by-geospatial.ttl").lang(Lang.TURTLE).build().toModel();
return List.of(
DcatView.from(new ViewName(COLLECTION_PARCELS, VIEW_BY_PAGE), byPage),
DcatView.from(new ViewName(COLLECTION_PARCELS, VIEW_BY_TIME), byTime));
}

private List<DcatView> createDcatBuildingViews() {
Model byPage = RDFParser.source("dcat/view-by-page.ttl").lang(Lang.TURTLE).build().toModel();
Model byPage = RDFParser.source("dcat/dataservice/view-by-page.ttl").lang(Lang.TURTLE).build().toModel();
return List.of(DcatView.from(new ViewName(COLLECTION_BUILDINGS, VIEW_BY_PAGE), byPage));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.services;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities.DcatDataset;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamTO;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamConverter;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamConverterImpl;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.FragmentationConfigExtractor;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.RetentionModelExtractor;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.ViewSpecificationConverter;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.*;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.converter.PrefixAdder;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.converter.PrefixAdderImpl;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.FragmentationConfig;
Expand Down Expand Up @@ -42,8 +37,8 @@ void setUp() throws URISyntaxException {
new FragmentationConfigExtractor(), prefixConstructor);
PrefixAdder prefixAdder = new PrefixAdderImpl();
eventStreamConverter = new EventStreamConverterImpl(viewSpecificationConverter, prefixAdder, prefixConstructor);
shacl = readModelFromFile("eventstream/streams/example-shape.ttl");
dataSetModel = readModelFromFile("dcat-dataset/valid.ttl");
shacl = readModelFromFile("shacl/collection-shape.ttl");
dataSetModel = readModelFromFile("dcat/dataset/valid.ttl");
}

@Nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void setUp() throws URISyntaxException {
dcatServerService,
eventPublisher);

dataset = new DcatDataset(COLLECTION, readModelFromFile("dcat-dataset/valid.ttl"));
dataset = new DcatDataset(COLLECTION, readModelFromFile("dcat/dataset/valid.ttl"));
eventStreamTOWithDataset = new EventStreamTO(COLLECTION, TIMESTAMP_PATH,
VERSION_OF_PATH, VERSION_CREATION_ENABLED, List.of(), ModelFactory.createDefaultModel(), dataset);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void setUp() {
class RetrieveShaclShape {
@Test
void when_collectionExists_and_hasShapeConfigured_then_retrieveShape() throws URISyntaxException {
final Model shape = readModelFromFile("eventstream/streams/example-shape.ttl");
final Model shape = readModelFromFile("shacl/collection-shape.ttl");
when(shaclShapeRepository.retrieveShaclShape(COLLECTION_NAME_1))
.thenReturn(Optional.of(new ShaclShape(COLLECTION_NAME_1, shape)));

Expand Down Expand Up @@ -85,7 +85,7 @@ void when_collectionDoesNotExists_then_throwException() {
class UpdateShaclShape {
@Test
void when_collectionExists_and_updateShape_then_expectUpdatedShacl() throws URISyntaxException {
final Model newShape = readModelFromFile("eventstream/streams/example-shape.ttl");
final Model newShape = readModelFromFile("shacl/collection-shape.ttl");
final ShaclShape shaclShape = new ShaclShape(COLLECTION_NAME_1, newShape);

ShaclShape updateShaclShape = service.updateShaclShape(shaclShape);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class EventStreamValidatorTest {

private final ModelValidator validator = new ShaclValidator("validator-shapes/eventstreamShaclShape.ttl");
private final ModelValidator validator = new ShaclValidator("shacl/validation/eventstreamShaclShape.ttl");

@Test
void test_support() {
Expand All @@ -36,7 +36,7 @@ void when_validLdesProvided_then_returnValid() throws URISyntaxException {

@Test
void when_invalidLdesProvided_then_returnInvalid() throws URISyntaxException {
Model model = readModelFromFile("eventstream/streams/invalid-shape.ttl");
Model model = readModelFromFile("shacl/invalid-shape.ttl");

assertThatThrownBy(() -> validator.validate(model)).isInstanceOf(ShaclValidationException.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ShaclShapeValidatorTest {

@Nested
class ShapeValidator {
private final ModelValidator validator = new ShaclValidator("validator-shapes/shapeShaclShape.ttl");
private final ModelValidator validator = new ShaclValidator("shacl/validation/shapeShaclShape.ttl");

@Test
void test_classSupport() {
Expand All @@ -36,34 +36,34 @@ void test_classSupport() {
}

@Test
void when_ValidateValidShaclShape_thenReturnValid() throws URISyntaxException {
final Model validShaclShape = RDFDataMgr.loadModel("eventstream/streams/valid-shape.ttl");
void when_ValidateValidShaclShape_thenReturnValid() {
final Model validShaclShape = RDFDataMgr.loadModel("shacl/valid-shape.ttl");

assertThatNoException().isThrownBy(() -> validator.validate(validShaclShape));
}

@Test
void when_validateInvalidShaclShape_thenReturnInvalid() {
final Model model = RDFDataMgr.loadModel("eventstream/streams/invalid-shape.ttl");
final Model model = RDFDataMgr.loadModel("shacl/invalid-shape.ttl");

assertThatThrownBy(() -> validator.validate(model)).isInstanceOf(ShaclValidationException.class);
}
}

@Nested
class ViewShapeValidator {
private final ModelValidator validator = new ShaclValidator("validator-shapes/viewShaclShape.ttl");
private final ModelValidator validator = new ShaclValidator("shacl/validation/viewShaclShape.ttl");

@Test
void given_ValidViewWithHierarchicalFragmentation_when_validateView_then_ThrowNoException() {
final Model model = RDFDataMgr.loadModel("view-with-hierarchical-timebased-frag.ttl");
final Model model = RDFDataMgr.loadModel("view/view-with-hierarchical-timebased-frag.ttl");

assertThatNoException().isThrownBy(() -> validator.validate(model));
}

@Test
void given_InvalidViewWithHierarchicalFragmentation_when_validateView_then_ThrowNoException() throws IOException {
final File file = ResourceUtils.getFile("classpath:view-with-hierarchical-timebased-frag.ttl");
final File file = ResourceUtils.getFile("classpath:view/view-with-hierarchical-timebased-frag.ttl");
final String modelString = FileUtils.readFileToString(file, StandardCharsets.UTF_8).replace("day", "invalid-value");
final Model model = RDFParser.fromString(modelString).lang(Lang.TURTLE).toModel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void test_support() {

@Test
void when_ValidModel_Then_Pass() {
Model dcat = RDFParser.source("dcat-dataset/valid.ttl").lang(Lang.TURTLE).toModel();
Model dcat = RDFParser.source("dcat/dataset/valid.ttl").lang(Lang.TURTLE).toModel();

assertThatNoException().isThrownBy(() -> validator.validate(dcat));
}
Expand All @@ -54,7 +54,7 @@ static class InvalidArgumentsProvider implements ArgumentsProvider {
private final String validDcat;

InvalidArgumentsProvider() throws IOException {
validDcat = FileUtils.readFileToString(ResourceUtils.getFile("classpath:dcat-dataset/valid.ttl"),
validDcat = FileUtils.readFileToString(ResourceUtils.getFile("classpath:dcat/dataset/valid.ttl"),
StandardCharsets.UTF_8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void test_support() {

@Test
void should_NotThrowAnything_when_Valid() {
final Model model = RDFParser.source("validation/valid-dcat-service.ttl").lang(Lang.TURTLE).build().toModel();
final Model model = RDFParser.source("dcat/dataservice/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();

assertThatNoException().isThrownBy(() -> validator.validate(model));
}
Expand Down Expand Up @@ -101,7 +101,7 @@ private String createModelWithACatalog() {
}

private String readDcatFromFile() throws IOException {
File file = ResourceUtils.getFile("classpath:validation/valid-dcat-service.ttl");
File file = ResourceUtils.getFile("classpath:dcat/dataservice/dcat-view-valid.ttl");
return FileUtils.readFileToString(file, StandardCharsets.UTF_8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void test_GetDcat() {
void should_ReturnNamedDcatStatements_when_GetStatementsWithBaseIsCalled() {
final int nrOfAdditionalDcatStatements = 6; // servesDataset, 2 x endpointURL + identifier + 2 x endpointDescription
final String host = "http://localhost.dev";
final Model anon = RDFParser.source("viewconverter/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
final Model anon = RDFParser.source("dcat/dataservice/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
final Resource iri = ResourceFactory.createResource(host + "/" + COLLECTION_NAME + "/" + VIEW + "/description");

final DcatView dcatView = DcatView.from(VIEW_NAME, anon);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ConfigFilterPredicateTest {
@Test
void when_StatementsContainAStatementWithSamePredicateAsConfigFilterPredicate_then_TheseAreExtracted()
throws URISyntaxException {
Model viewModel = readModelFromFile("viewconverter/view_valid.ttl");
Model viewModel = readModelFromFile("view/view_valid.ttl");
ConfigFilterPredicate retentionFilter = new ConfigFilterPredicate(RETENTION_TYPE);
ConfigFilterPredicate fragmentationFilter = new ConfigFilterPredicate(FRAGMENTATION_OBJECT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.Objects;
import java.util.stream.Stream;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

class RetentionModelExtractorTest {
private final RetentionModelExtractor retentionModelExtractor = new RetentionModelExtractor();
Expand Down Expand Up @@ -46,10 +46,10 @@ static class EventStreamArgumentProvider implements ArgumentsProvider {
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext extensionContext) {
return Stream.of(
Arguments.of("viewconverter/retentionpolicies/timebased_retentionpolicy.ttl", 1, List.of(2)),
Arguments.of("viewconverter/retentionpolicies/versionbased_retentionpolicy.ttl", 1, List.of(2)),
Arguments.of("viewconverter/retentionpolicies/fictional_retentionpolicy.ttl", 1, List.of(6)),
Arguments.of("viewconverter/retentionpolicies/multiple_retentionpolicies.ttl", 2,
Arguments.of("retention/timebased_retentionpolicy.ttl", 1, List.of(2)),
Arguments.of("retention/versionbased_retentionpolicy.ttl", 1, List.of(2)),
Arguments.of("retention/fictional_retentionpolicy.ttl", 1, List.of(6)),
Arguments.of("retention/multiple_retentionpolicies.ttl", 2,
List.of(2, 2)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ void setup() throws URISyntaxException {
viewSpecificationConverter = new ViewSpecificationConverter(new RetentionModelExtractor(),
new FragmentationConfigExtractor(),
new PrefixConstructor(HOST_NAME, false));
Model retentionModel = readModelFromFile("viewconverter/retentionpolicies/example_timebased.ttl");
Model retentionModel = readModelFromFile("retention/example_timebased.ttl");
FragmentationConfig fragmentationConfig = new FragmentationConfig();
fragmentationConfig.setName("ExampleFragmentation");
fragmentationConfig.setConfig(
Map.of("pageSize", "100", "property", "example/property"));
List<FragmentationConfig> fragmentations = List.of(fragmentationConfig);
ViewName viewName = new ViewName(COLLECTION_NAME, VIEW_NAME);
view = new ViewSpecification(viewName, List.of(retentionModel), fragmentations, 100);
Model dcat = RDFParser.source("viewconverter/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
Model dcat = RDFParser.source("dcat/dataservice/dcat-view-valid.ttl").lang(Lang.TURTLE).build().toModel();
DcatView dcatView = DcatView.from(viewName, dcat);
view.setDcat(dcatView);
}

@Test
void when_ValidModel_Then_ReturnViewSpecification() throws URISyntaxException {
Model viewModel = readModelFromFile("viewconverter/view_valid.ttl");
Model viewModel = readModelFromFile("view/view_valid.ttl");
ViewSpecification actualView = viewSpecificationConverter.viewFromModel(viewModel, COLLECTION_NAME);
assertEquals(view, actualView);
assertTrue(compareList(view.getFragmentations().stream().map(FragmentationConfig::getConfig).toList(),
Expand All @@ -64,15 +64,15 @@ void when_ValidModel_Then_ReturnViewSpecification() throws URISyntaxException {

@Test
void when_ViewSpecification_Then_ReturnModel() throws URISyntaxException {
Model viewModel = readModelFromFile("viewconverter/view_valid.ttl");
Model viewModel = readModelFromFile("view/view_valid.ttl");
Model actualModel = viewSpecificationConverter.modelFromView(view);

assertThat(viewModel).matches(actualModel::isIsomorphicWith);
}

@Test
void when_MultipleFragmentationStrategies_Then_OrderIsKept() throws URISyntaxException {
Model expectedModel = readModelFromFile("viewconverter/view_multiple_fragmentations.ttl");
Model expectedModel = readModelFromFile("view/view_multiple_fragmentations.ttl");
ViewSpecification expectedViewSpecification = getExpectedViewSpecification();

ViewSpecification actualViewSpecification = viewSpecificationConverter.viewFromModel(expectedModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ void when_DeleteExistingDcat_then_ReturnStatus200() throws Exception {
}

private Model readModelFromFile() {
return RDFParser.source("dcat/valid-server-dcat.ttl").lang(Lang.TURTLE).toModel();
return RDFParser.source("dcat/catalog/valid-server-dcat.ttl").lang(Lang.TURTLE).toModel();
}

private String readDataFromFile() throws IOException {
final File file = ResourceUtils.getFile("classpath:dcat/valid-server-dcat.ttl");
final File file = ResourceUtils.getFile("classpath:dcat/catalog/valid-server-dcat.ttl");
return FileUtils.readFileToString(file, StandardCharsets.UTF_8);
}

Expand Down
Loading

0 comments on commit c2af37d

Please sign in to comment.