Skip to content

Commit

Permalink
ci: finalize release 2.8.0 (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
pj-cegeka authored Jul 2, 2024
2 parents 401f794 + c063b43 commit cfca5f3
Show file tree
Hide file tree
Showing 105 changed files with 836 additions and 185 deletions.
8 changes: 5 additions & 3 deletions docs/_ldio/ldio-transformers/ldio-version-object-creator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ The Version Object Creator will transform a State Object to a Version Object.
| Property | Description | Required | Default | Example | Supported values |
|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:---------|:------------------------------------------|:------------------------------------------|:-----------------|
| _date-observed-property_ | Property path (IRI format '<>') that points to a literal which should be used as timestampPath. Defaults to current timestamp. | No | Current Timestamp | \<https://example.org/ObservedAt\> | String |
| _member-type_ | Defines the RDF type of the version object | No | N/A | https://example.org/Person | String |
| _member-type_ | Defines the RDF type of the object to be transformed to a version object. | Yes | N/A | https://example.org/Person | String |
| _delimiter_ | Defines how the version object id will be constructed. (versionOf + delimiter + dateObserved) | No | / | / | String |
| _generatedAt-property_ | A statement will be added to the model with the observedAt value and the given property. | No | http://www.w3.org/ns/prov#generatedAtTime | http://www.w3.org/ns/prov#generatedAtTime | String |
| _generatedAt-property_ | A statement will be added to the model with the generatedAt value and the given property. | No | http://www.w3.org/ns/prov#generatedAtTime | http://www.w3.org/ns/prov#generatedAtTime | String |
| _versionOf-property_ | A statement will be added to the model with the versionOf value and the given property. | No | http://purl.org/dc/terms/isVersionOf | http://purl.org/dc/terms/isVersionOf | String |

## Example
Expand Down Expand Up @@ -82,7 +82,9 @@ The YAML configuration of this example would be as follows:
transformers:
- name: Ldio:VersionObjectCreator
config:
member-type: http://example.org/Something
member-type:
- http://example.org/Something
- http://example.org/SomethingElse
delimiter: "#"
date-observed-property: <http://example.org/created>/<http://www.w3.org/2006/time#inXSDDateTimeStamp>
generatedAt-property: http://www.w3.org/ns/prov#generatedAtTime
Expand Down
2 changes: 1 addition & 1 deletion ldi-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes</groupId>
<artifactId>linked-data-interactions</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/change-detection-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>change-detection-filter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/file-archiving/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>file-archiving</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/geojson-to-wkt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>geojson-to-wkt</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/json-to-ld-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>json-to-ld-adapter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldes-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldes-client/starting-node/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-client</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.client</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>starting-node</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldes-client/tree-node-fetcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-client</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.client</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldes-client/tree-node-relations-fetcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-client</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.client</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldes-client/tree-node-supplier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldes-client</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.client</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tree-node-supplier</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;

import static java.lang.Thread.sleep;
import static ldes.client.treenodesupplier.domain.valueobject.ClientStatus.*;

public class TreeNodeProcessor {

Expand All @@ -25,13 +28,16 @@ public class TreeNodeProcessor {
private final TreeNodeFetcher treeNodeFetcher;
private final LdesMetaData ldesMetaData;
private final RequestExecutor requestExecutor;
private final Consumer<ClientStatus> clientStatusConsumer;
private MemberRecord memberRecord;

public TreeNodeProcessor(LdesMetaData ldesMetaData, StatePersistence statePersistence,
RequestExecutor requestExecutor, TimestampExtractor timestampExtractor) {
RequestExecutor requestExecutor, TimestampExtractor timestampExtractor,
Consumer<ClientStatus> clientStatusConsumer) {
this.treeNodeRecordRepository = statePersistence.getTreeNodeRecordRepository();
this.memberRepository = statePersistence.getMemberRepository();
this.requestExecutor = requestExecutor;
this.clientStatusConsumer = clientStatusConsumer;
this.treeNodeFetcher = new TreeNodeFetcher(requestExecutor, timestampExtractor);
this.ldesMetaData = ldesMetaData;
}
Expand Down Expand Up @@ -99,11 +105,24 @@ private void saveNewRelations(TreeNodeResponse treeNodeResponse) {
}

private TreeNodeRecord getNextTreeNode() {
return treeNodeRecordRepository
TreeNodeRecord treeNodeRecord = treeNodeRecordRepository
.getTreeNodeRecordWithStatusAndEarliestNextVisit(TreeNodeStatus.IMMUTABLE_WITH_UNPROCESSED_MEMBERS)
.orElseGet(() -> treeNodeRecordRepository.getTreeNodeRecordWithStatusAndEarliestNextVisit(TreeNodeStatus.NOT_VISITED)
.orElseGet(() -> treeNodeRecordRepository.getTreeNodeRecordWithStatusAndEarliestNextVisit(TreeNodeStatus.MUTABLE_AND_ACTIVE)
.orElseThrow(() -> new EndOfLdesException("No fragments to mutable or new fragments to process -> LDES ends."))));
.orElseThrow(() -> {
clientStatusConsumer.accept(COMPLETED);
return new EndOfLdesException("No fragments to mutable or new fragments to process -> LDES ends.");
})));

if (Objects.requireNonNull(treeNodeRecord.getTreeNodeStatus()) == TreeNodeStatus.IMMUTABLE_WITH_UNPROCESSED_MEMBERS ||
treeNodeRecord.getTreeNodeStatus() == TreeNodeStatus.IMMUTABLE_WITHOUT_UNPROCESSED_MEMBERS ||
treeNodeRecord.getTreeNodeStatus() == TreeNodeStatus.NOT_VISITED) {
clientStatusConsumer.accept(REPLICATING);
} else if (treeNodeRecord.getTreeNodeStatus() == TreeNodeStatus.MUTABLE_AND_ACTIVE) {
clientStatusConsumer.accept(SYNCHRONISING);
}

return treeNodeRecord;
}

private void waitUntilNextVisit(TreeNodeRecord treeNodeRecord) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ldes.client.treenodesupplier.domain.valueobject;

public enum ClientStatus {
REPLICATING, SYNCHRONISING, COMPLETED, ERROR
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import ldes.client.treenodesupplier.repository.MemberVersionRepository;
import ldes.client.treenodesupplier.repository.TreeNodeRecordRepository;
import org.apache.jena.riot.Lang;
import org.mockito.Mockito;
import org.testcontainers.containers.PostgreSQLContainer;

import java.util.List;
import java.util.function.Consumer;

class TreeNodeProcessorFactory {

Expand All @@ -36,7 +38,7 @@ TreeNodeProcessor createTreeNodeProcessor(StatePersistenceStrategy statePersiste
};
final RequestExecutor requestExecutor = requestExecutorFactory.createNoAuthExecutor();
final TimestampExtractor timestampExtractor = new TimestampFromCurrentTimeExtractor();
return new TreeNodeProcessor(ldesMetaData, statePersistence, requestExecutor, timestampExtractor);
return new TreeNodeProcessor(ldesMetaData, statePersistence, requestExecutor, timestampExtractor, Mockito.mock(Consumer.class));
}

private PostgreSQLContainer startPostgresContainer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import ldes.client.treenodesupplier.domain.services.MemberRepositoryFactory;
import ldes.client.treenodesupplier.domain.services.MemberVersionRepositoryFactory;
import ldes.client.treenodesupplier.domain.services.TreeNodeRecordRepositoryFactory;
import ldes.client.treenodesupplier.domain.valueobject.LdesMetaData;
import ldes.client.treenodesupplier.domain.valueobject.StatePersistence;
import ldes.client.treenodesupplier.domain.valueobject.SuppliedMember;
import ldes.client.treenodesupplier.domain.valueobject.TreeNodeStatus;
import ldes.client.treenodesupplier.domain.valueobject.*;
import ldes.client.treenodesupplier.filters.ExactlyOnceFilter;
import ldes.client.treenodesupplier.filters.LatestStateFilter;
import ldes.client.treenodesupplier.filters.MemberFilter;
Expand All @@ -31,9 +28,11 @@
import ldes.client.treenodesupplier.repository.TreeNodeRecordRepository;
import org.apache.jena.riot.Lang;
import org.junit.After;
import org.mockito.Mockito;
import org.testcontainers.containers.PostgreSQLContainer;

import java.util.List;
import java.util.function.Consumer;

import static org.apache.jena.rdf.model.ResourceFactory.createProperty;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -50,6 +49,7 @@ public class MemberSupplierSteps {
private LdesMetaData ldesMetaData;
private SuppliedMember suppliedMember;
private PostgreSQLContainer<?> postgreSQLContainer;
private final Consumer<ClientStatus> clientStatusConsumer = Mockito.mock(Consumer.class);

// Multi MemberSupplier
private final MemberSupplier[] memberSuppliers = new MemberSupplier[2];
Expand Down Expand Up @@ -105,7 +105,8 @@ public void iCreateAProcessor() {
treeNodeProcessor = new TreeNodeProcessor(ldesMetaData,
new StatePersistence(memberRepository, memberIdRepository, treeNodeRecordRepository, memberVersionRepository),
requestExecutorFactory.createNoAuthExecutor(),
timestampPath.isEmpty() ? new TimestampFromCurrentTimeExtractor() : new TimestampFromPathExtractor(createProperty(timestampPath)));
timestampPath.isEmpty() ? new TimestampFromCurrentTimeExtractor() : new TimestampFromPathExtractor(createProperty(timestampPath)),
clientStatusConsumer);
}

@Then("Member {string} is processed")
Expand Down Expand Up @@ -206,11 +207,11 @@ public void aStatePersistenceStrategyProcessorAndAStatePersistenceStrategyProces
memberSuppliers[0] = new MemberSupplierImpl(new TreeNodeProcessor(ldesMetaData,
defineStatePersistence(arg0),
requestExecutorFactory.createNoAuthExecutor(),
new TimestampFromPathExtractor(createProperty(timestampPath))), false);
new TimestampFromPathExtractor(createProperty(timestampPath)), clientStatusConsumer), false);
memberSuppliers[1] = new MemberSupplierImpl(new TreeNodeProcessor(ldesMetaData,
defineStatePersistence(arg1),
requestExecutorFactory.createNoAuthExecutor(),
new TimestampFromPathExtractor(createProperty(timestampPath))), false);
new TimestampFromPathExtractor(createProperty(timestampPath)), clientStatusConsumer), false);
}

@When("I request one member from the MemberSuppliers")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.jena.rdf.model.ModelFactory;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;

class SuppliedMemberTest {

Expand All @@ -13,8 +13,9 @@ void when_SuppliedMemberIsCreated_ModelIsDeepCopied() {
Model model = ModelFactory.createDefaultModel();
SuppliedMember suppliedMember = new SuppliedMember("id", model);

model = null;
assertNotNull(suppliedMember.getModel());
assertThat(suppliedMember.getModel())
.isNotNull()
.matches(Model::isEmpty);
}

}
2 changes: 1 addition & 1 deletion ldi-core/ldi-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>ldi-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ldi-infra-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>ldi-infra-sql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/ngsiv2-to-ld-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<artifactId>ngsiv2-to-ld-adapter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>linked-data-interactions</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/rdf-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldi-core</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/repository-materialiser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.Update;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryException;
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/request-executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldi-core</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>request-executor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ public void iHaveARequestExecutorWithRateLimiter() {

@Then("It takes approximately {int} ms to execute the request {int} times")
public void itTakesSecondsToExecuteTheRequestTimes(int ms, int requestCount) {
LocalDateTime start = LocalDateTime.now();
LocalDateTime startTime = LocalDateTime.now();
for (int i = 0; i < requestCount; i++) {
response = requestExecutor.execute(request);
}
LocalDateTime end = LocalDateTime.now();
LocalDateTime endTime = LocalDateTime.now();

assertTrue(Duration.between(start, end).toMillis() > ms - 250);
assertTrue(Duration.between(start, end).toMillis() < ms + 250);
assertTrue(Duration.between(startTime, endTime).toMillis() > ms - 250);
assertTrue(Duration.between(startTime, endTime).toMillis() < ms + 250);
}

@Given("I have a requestExecutor which does {int} retries with custom http status code {int} and limits requests")
Expand Down
2 changes: 1 addition & 1 deletion ldi-core/rml-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ldi-core</artifactId>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ldi-core/sparql-construct/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
<artifactId>ldi-core</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit cfca5f3

Please sign in to comment.