Skip to content

Commit

Permalink
Zero-Config REST Temporal Queries (#317)
Browse files Browse the repository at this point in the history
Former-commit-id: 103fcc1
  • Loading branch information
Spiess committed May 19, 2022
1 parent d941bd2 commit 0d071a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<StagedSimilarityQuery> queries, List<MetadataAccessSpecification> metadataAccessSpec, TemporalQueryConfig config, @JsonProperty(required = true) MessageType messageType) implements Query {
public record TemporalQuery(@JsonProperty(required = true) List<StagedSimilarityQuery> queries, List<MetadataAccessSpecification> metadataAccessSpec, TemporalQueryConfig config, MessageType messageType) implements Query {

/**
* Convenience getter for timeDistances.
Expand All @@ -19,7 +20,7 @@ public record TemporalQuery(@JsonProperty(required = true) List<StagedSimilarity
*/
@JsonIgnore
public List<Float> getTimeDistances() {
return config().timeDistances;
return config == null ? new ArrayList<>() : config().timeDistances;
}

/**
Expand All @@ -29,7 +30,7 @@ public List<Float> getTimeDistances() {
*/
@JsonIgnore
public Float getMaxLength() {
return config().maxLength;
return config == null ? null : config().maxLength;
}

}

0 comments on commit 0d071a6

Please sign in to comment.