Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: finalise 3.5.0 #1411

Merged
merged 42 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
36def96
fix: broken compaction due to used uuids (#1373)
jobulcke Sep 25, 2024
dba8d86
ci: prepare release 3.5.0 (#1376)
jobulcke Sep 25, 2024
8c1e1f8
chore: restructuring to maintenance (#1375)
jobulcke Sep 25, 2024
a9b5df8
feat: simplify maintenance (#1374)
jobulcke Oct 3, 2024
84fbd53
chore(deps): bump org.owasp:dependency-check-maven from 9.0.9 to 10.0…
dependabot[bot] Oct 4, 2024
263bc48
chore(deps): bump com.google.guava:guava from 33.0.0-jre to 33.3.1-jr…
dependabot[bot] Oct 4, 2024
80735e8
chore(deps): bump org.springframework.data:spring-data-commons (#1388)
dependabot[bot] Oct 4, 2024
b7f3c63
fix: flaky test (#1381)
jobulcke Oct 7, 2024
c2d0e43
chore: db cleanup (#1382)
jobulcke Oct 7, 2024
844edb1
feat: charset included in headers (#1380)
jobulcke Oct 7, 2024
d1435e1
fix: broken compaction rework (#1383)
jobulcke Oct 7, 2024
28ea31d
Update build-documentation.yml
Yalz Oct 8, 2024
f6435ec
ci: Update build-documentation.yml
Yalz Oct 8, 2024
d519488
Update build-documentation.yml
Yalz Oct 8, 2024
ac331b8
fix: sort BucketisedMembers on write
rorlic Oct 14, 2024
a608649
chore: use collection_stats to improve performance
rorlic Oct 14, 2024
7ce5e20
chore: use collection_stats to improve performance
jobulcke Oct 8, 2024
436ed97
chore: use collection_stats to improve performance
rorlic Oct 14, 2024
96254e1
fix: update db views inside code
Yalz Oct 14, 2024
95ebcdf
fix: retrieve correct auto generated key + correct context retrieval
Yalz Oct 15, 2024
aaab067
feat: drop unnecessary db check on ingest (#1399)
jobulcke Oct 21, 2024
21c6ede
feat: isolate maven modules
Yalz Oct 17, 2024
ccde5c8
fix: Only write page relation once
Yalz Oct 21, 2024
a07a458
feat: drop unnecessary db check on ingest (#1399)
jobulcke Oct 21, 2024
5e557f5
Merge branch 'develop' into feat/modular-restructure
Yalz Oct 22, 2024
22819ed
fix: sonar cleanup
Yalz Oct 22, 2024
4f3a6bc
fix: cleanup Dockerfile
Yalz Oct 22, 2024
ddc308a
Merge pull request #1400 from Informatievlaanderen/feat/modular-restr…
Yalz Oct 22, 2024
13bf254
fix: missing page members
rorlic Oct 15, 2024
e351d35
fix: no more duplicate page relations
rorlic Oct 18, 2024
21c4e0e
fix: remove unused last id
rorlic Oct 18, 2024
b8c5b53
Merge branch 'develop' into fix/missing-page-members
Yalz Oct 23, 2024
6f8719a
fix: broken MemberItemReader
Yalz Oct 24, 2024
6fb8820
fix: pr + sonar feedback
Yalz Oct 24, 2024
d46588f
Merge pull request #1401 from Informatievlaanderen/fix/missing-page-m…
Yalz Oct 24, 2024
6344971
chore: bump jena to next major version (#1402)
jobulcke Oct 24, 2024
52f932d
feat: relax timebased fragmentation (#1403)
jobulcke Oct 25, 2024
fffc2c9
docs: update project structure in docs (#1404)
Yalz Oct 25, 2024
7b442dc
Fix/broken image (#1407)
rorlic Oct 31, 2024
de64ed5
feat: configurable version delimiter (#1405)
jobulcke Nov 5, 2024
051db75
fix: correct mvn parent for pagination
Yalz Nov 5, 2024
3cdd412
Merge branch 'main' into develop
Yalz Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
feat: isolate maven modules
  • Loading branch information
Yalz committed Oct 22, 2024
commit 21c6ede7f74dec67990871b6175dff807107e8ae
4 changes: 2 additions & 2 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM amazoncorretto:21-alpine-jdk

COPY ./ldes-server-application/target/ldes-server-application.jar ./

COPY ./ldes-server-infra-postgres/postgres-ingest-repository/target/postgres-ingest-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-retention-repository/target/postgres-retention-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-member-repository/target/postgres-member-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-maintenance-repository/target/postgres-retention-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-fragmentation-repository/target/postgres-fragmentation-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-pagination-repository/target/postgres-pagination-repository-jar-with-dependencies.jar ./lib/
COPY ./ldes-server-infra-postgres/postgres-admin-repository/target/postgres-admin-repository-jar-with-dependencies.jar ./lib/
Expand Down

This file was deleted.

Binary file not shown.
70 changes: 70 additions & 0 deletions ldes-server-admin/ldes-server-admin-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<artifactId>ldes-server-admin</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>

<artifactId>ldes-server-admin-common</artifactId>

<dependencies>
<dependency>
<groupId>be.vlaanderen.informatievlaanderen.vsds</groupId>
<artifactId>ldes-server-domain</artifactId>
</dependency>
<!-- TESTING -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>

<!-- NULL ANNOTATIONS -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${google-guava.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamConverterImpl;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants;
import org.apache.jena.rdf.model.*;
import org.apache.jena.util.ResourceUtils;

import java.util.List;
import java.util.Objects;

public class DcatDataset {
public static final Property TREE_SPECIFICATION = ResourceFactory.createProperty("https://w3id.org/tree/specification");
public static final Property LDES_SPECIFICATION = ResourceFactory.createProperty("https://w3id.org/ldes/specification");

private final String collectionName;
private final Model model;

public DcatDataset(String collectionName, Model model) {
this.collectionName = collectionName;
this.model = model;
}

public DcatDataset(String collectionName) {
this(collectionName, ModelFactory.createDefaultModel());
}

public String getCollectionName() {
return collectionName;
}

public Model getModel() {
return model;
}

public Model getModelWithIdentity(String hostname) {
String datasetIriString = getDatasetIriString(hostname);
Model modelWithIdentity = ModelFactory.createDefaultModel();
modelWithIdentity.add(model);
modelWithIdentity.listStatements(null, RdfConstants.RDF_SYNTAX_TYPE, ResourceFactory.createResource(EventStreamConverterImpl.DATASET_TYPE)).nextOptional()
.ifPresent(statement -> ResourceUtils.renameResource(statement.getSubject(), datasetIriString));
modelWithIdentity.add(ResourceFactory.createResource(datasetIriString), RdfConstants.DC_TERMS_IDENTIFIER,
modelWithIdentity.createTypedLiteral(datasetIriString, RdfConstants.RDF_LITERAL));
modelWithIdentity.add(createConformsToStatements(ResourceFactory.createResource(datasetIriString)));
return modelWithIdentity;
}

public String getDatasetIriString(String hostName) {
return hostName + "/" + getCollectionName();
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DcatDataset that = (DcatDataset) o;
return Objects.equals(collectionName, that.getCollectionName());
}

@Override
public int hashCode() {
return Objects.hash(collectionName);
}

private List<Statement> createConformsToStatements(Resource datasetIri) {
return List.of(
ResourceFactory.createStatement(datasetIri, RdfConstants.DC_CONFORMS_TO, TREE_SPECIFICATION),
ResourceFactory.createStatement(datasetIri, RdfConstants.DC_CONFORMS_TO, LDES_SPECIFICATION),
ResourceFactory.createStatement(TREE_SPECIFICATION, RdfConstants.RDF_SYNTAX_TYPE, RdfConstants.DC_STANDARD),
ResourceFactory.createStatement(LDES_SPECIFICATION, RdfConstants.RDF_SYNTAX_TYPE, RdfConstants.DC_STANDARD)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.entities;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities.DcatDataset;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.DcatView;
import org.apache.jena.rdf.model.*;
import org.apache.jena.util.ResourceUtils;
import org.apache.jena.vocabulary.RDF;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import static be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants.DC_TERMS_IDENTIFIER;
import static be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants.RDF_LITERAL;
import static org.apache.jena.rdf.model.ResourceFactory.*;
import static org.apache.jena.util.ResourceUtils.renameResource;

public class DcatServer {

public static final Property DCAT_CATALOG = createProperty("http://www.w3.org/ns/dcat#Catalog");
public static final Property DCAT_SERVICE = createProperty("http://www.w3.org/ns/dcat#service");
public static final Property DCAT_DATASET = createProperty("http://www.w3.org/ns/dcat#dataset");
public static final Property DCAT_CATALOG = ResourceFactory.createProperty("http://www.w3.org/ns/dcat#Catalog");
public static final Property DCAT_SERVICE = ResourceFactory.createProperty("http://www.w3.org/ns/dcat#service");
public static final Property DCAT_DATASET = ResourceFactory.createProperty("http://www.w3.org/ns/dcat#dataset");

private final String id;
private final Model dcat;
Expand Down Expand Up @@ -48,22 +45,22 @@ public List<Statement> getStatementsWithBase(String hostName, List<DcatView> dca

private Statement createIdentifierStatement(String hostName) {
Resource subject = getServerResource(hostName);
return createStatement(subject, DC_TERMS_IDENTIFIER, dcat.createTypedLiteral(id, RDF_LITERAL));
return ResourceFactory.createStatement(subject, RdfConstants.DC_TERMS_IDENTIFIER, dcat.createTypedLiteral(id, RdfConstants.RDF_LITERAL));
}

private List<Statement> createCatalogStatements(String hostName) {
final Model dcatWithIdentity = ModelFactory.createDefaultModel();
dcatWithIdentity.add(getDcat());
dcatWithIdentity.listStatements(null, RDF.type, DCAT_CATALOG).nextOptional()
.ifPresent(statement -> renameResource(statement.getSubject(), getServerResource(hostName).getURI()));
.ifPresent(statement -> ResourceUtils.renameResource(statement.getSubject(), getServerResource(hostName).getURI()));
return dcatWithIdentity.listStatements().toList();
}

private List<Statement> createDcatServiceStatements(String hostName, List<DcatView> dcatViews) {
Resource serverResource = getServerResource(hostName);
return dcatViews
.stream()
.map(dcatView -> createStatement(serverResource, DCAT_SERVICE,
.map(dcatView -> ResourceFactory.createStatement(serverResource, DCAT_SERVICE,
dcatView.getViewDescriptionResource(hostName)))
.toList();
}
Expand All @@ -72,13 +69,13 @@ private List<Statement> createDcatDataSetStatements(String hostName, List<DcatDa
Resource serverResource = getServerResource(hostName);
return datasets
.stream()
.map(dataset -> createStatement(serverResource, DCAT_DATASET,
createResource(dataset.getDatasetIriString(hostName))))
.map(dataset -> ResourceFactory.createStatement(serverResource, DCAT_DATASET,
ResourceFactory.createResource(dataset.getDatasetIriString(hostName))))
.toList();
}

public Resource getServerResource(String hostName) {
return createResource(hostName);
return ResourceFactory.createResource(hostName);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repositories;
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repository;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.entities.DcatServer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities.DcatDataset;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.services.DcatDatasetService;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.entities.DcatServer;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repositories.DcatServerRepository;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repository.DcatServerRepository;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.validation.DcatShaclValidator;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.validation.ModelValidator;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.service.DcatViewService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.services;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamTO;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamServiceSpi;
import be.vlaanderen.informatievlaanderen.ldes.server.admin.spi.EventStreamTO;
import org.apache.jena.rdf.model.Model;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.service;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.exception.ModelToViewConverterException;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.converter.RdfModelConverter;
import be.vlaanderen.informatievlaanderen.ldes.server.domain.model.FragmentationConfig;
import org.apache.jena.rdf.model.ModelFactory;
Expand All @@ -13,9 +14,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import static be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants.FRAGMENTATION_TYPE;
import static be.vlaanderen.informatievlaanderen.ldes.server.domain.constants.RdfConstants.RDF_SYNTAX_TYPE;

public class FragmentationConfigCreationFunction implements Function<RDFNode, FragmentationConfig> {

public static final String PAGINATION_FRAGMENTATION = "PaginationFragmentation";
Expand All @@ -28,7 +26,7 @@ public FragmentationConfig apply(RDFNode rdfNode) {
.listStatements(rdfNode.asResource(), null, (RDFNode) null)
.toList();
List<Statement> fragmentationStatements = statements.stream()
.filter(statement -> statement.getPredicate().equals(RDF_SYNTAX_TYPE)).toList();
.filter(statement -> statement.getPredicate().equals(RdfConstants.RDF_SYNTAX_TYPE)).toList();
validateFragmentationStatements(fragmentationStatements);
Map<String, String> fragmentationPropertiesMap = extractFragmentationProperties(statements,
fragmentationStatements);
Expand All @@ -42,9 +40,9 @@ public FragmentationConfig apply(RDFNode rdfNode) {
private void validateFragmentationStatements(List<Statement> fragmentationStatements) {
if (fragmentationStatements.size() != 1) {
throw new IllegalArgumentException(
"Cannot Create Fragmentation Config. Expected exactly 1 " + FRAGMENTATION_TYPE
+ " statement.\n Found no or multiple statements in :\n"
+ RdfModelConverter.toString(ModelFactory.createDefaultModel().add(fragmentationStatements),
"Cannot Create Fragmentation Config. Expected exactly 1 " + RdfConstants.FRAGMENTATION_TYPE
+ " statement.\n Found no or multiple statements in :\n"
+ RdfModelConverter.toString(ModelFactory.createDefaultModel().add(fragmentationStatements),
Lang.TURTLE));
}
}
Expand All @@ -65,7 +63,7 @@ private Map<String, String> extractFragmentationProperties(List<Statement> state

private String computeFragmentationName(List<Statement> statements) {
final String fragmentationName = statements.stream()
.filter(statement -> statement.getPredicate().equals(RDF_SYNTAX_TYPE))
.filter(statement -> statement.getPredicate().equals(RdfConstants.RDF_SYNTAX_TYPE))
.findFirst()
.orElseThrow(() -> new ModelToViewConverterException("Unable to find fragmentation type"))
.getResource()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
open module ldes.admin {

exports be.vlaanderen.informatievlaanderen.ldes.server.admin.spi;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.repository;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.services;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.entities;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.repository;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatserver.services;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventsource.repository;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventsource.services;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.exceptions;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.repository;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.eventstream.services;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.shacl.entities;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.shacl.repository;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.shacl.services;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.validation;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.validation.dcat;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.service;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.exception;
exports be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.view.repository;

// LDES dependencies
requires ldes.domain;

// external dependencies
requires spring.boot;
requires spring.beans;
requires spring.context;
requires spring.boot.autoconfigure;
requires spring.boot.actuator;
requires spring.boot.actuator.autoconfigure;
requires org.apache.commons.lang3;
requires org.apache.tomcat.embed.core;
requires org.apache.jena.arq;
requires org.apache.jena.core;
requires org.apache.jena.shacl;
requires com.google.common;
requires org.slf4j;
requires org.jetbrains.annotations;
requires micrometer.observation;
requires micrometer.core;

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcatdataset.entities;

import be.vlaanderen.informatievlaanderen.ldes.server.admin.domain.dcat.dcatdataset.entities.DcatDataset;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

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

class DcatDatasetTest {

@Test
void when_CallingGetDatasetIriString_should_ReturnTheCorrectIriString() {
String result = new DcatDataset("collectionName").getDatasetIriString("http://localhost.dev");

assertEquals("http://localhost.dev/collectionName", result);
Assertions.assertEquals("http://localhost.dev/collectionName", result);
}

}
Loading