From 0d071a652d9ba2a8b422073bf59f0e0c2062917b Mon Sep 17 00:00:00 2001 From: Florian Spiess Date: Thu, 19 May 2022 15:45:57 +0200 Subject: [PATCH] Zero-Config REST Temporal Queries (#317) Former-commit-id: 103fcc1af4a74c52db90a3cbcf9f1bb0f1f2b5d8 --- build.gradle | 2 +- .../vitrivr/cineast/api/messages/query/TemporalQuery.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index f28059de2..2a677d0c7 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ allprojects { group = 'org.vitrivr' /* Our current version, on dev branch this should always be release+1-SNAPSHOT */ - version = '3.11.5' + version = '3.11.6' apply plugin: 'java-library' apply plugin: 'maven-publish' diff --git a/cineast-api/src/main/java/org/vitrivr/cineast/api/messages/query/TemporalQuery.java b/cineast-api/src/main/java/org/vitrivr/cineast/api/messages/query/TemporalQuery.java index 480294327..a7d28a315 100644 --- a/cineast-api/src/main/java/org/vitrivr/cineast/api/messages/query/TemporalQuery.java +++ b/cineast-api/src/main/java/org/vitrivr/cineast/api/messages/query/TemporalQuery.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; import java.util.List; import org.vitrivr.cineast.api.messages.interfaces.MessageType; import org.vitrivr.cineast.api.messages.interfaces.Query; @@ -10,7 +11,7 @@ /** * This object represents a temporal-query message of temporal query version 2, i.e. a request for a temporally staged similarity-search. */ -public record TemporalQuery(@JsonProperty(required = true) List queries, List metadataAccessSpec, TemporalQueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query { +public record TemporalQuery(@JsonProperty(required = true) List queries, List metadataAccessSpec, TemporalQueryConfig config, MessageType messageType) implements Query { /** * Convenience getter for timeDistances. @@ -19,7 +20,7 @@ public record TemporalQuery(@JsonProperty(required = true) List getTimeDistances() { - return config().timeDistances; + return config == null ? new ArrayList<>() : config().timeDistances; } /** @@ -29,7 +30,7 @@ public List getTimeDistances() { */ @JsonIgnore public Float getMaxLength() { - return config().maxLength; + return config == null ? null : config().maxLength; } }