-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: 1dfa055
- Loading branch information
Showing
17 changed files
with
515 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
cineast-api/src/main/java/org/vitrivr/cineast/api/messages/query/QueryComponent.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...itrivr/cineast/api/rest/handlers/actions/segment/FindSegmentSimilarStagedPostHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.vitrivr.cineast.api.rest.handlers.actions.segment; | ||
|
||
import io.javalin.http.Context; | ||
import io.javalin.plugin.openapi.dsl.OpenApiBuilder; | ||
import io.javalin.plugin.openapi.dsl.OpenApiDocumentation; | ||
import org.vitrivr.cineast.api.messages.query.StagedSimilarityQuery; | ||
import org.vitrivr.cineast.api.messages.result.SimilarityQueryResultBatch; | ||
import org.vitrivr.cineast.api.rest.handlers.interfaces.ParsingPostRestHandler; | ||
import org.vitrivr.cineast.api.util.QueryUtil; | ||
import org.vitrivr.cineast.standalone.config.ConstrainedQueryConfig; | ||
import org.vitrivr.cineast.standalone.util.ContinuousRetrievalLogic; | ||
|
||
public class FindSegmentSimilarStagedPostHandler implements ParsingPostRestHandler<StagedSimilarityQuery, SimilarityQueryResultBatch> { | ||
|
||
public static final String ROUTE = "find/segments/similar/staged"; | ||
private final ContinuousRetrievalLogic continuousRetrievalLogic; | ||
|
||
public FindSegmentSimilarStagedPostHandler(ContinuousRetrievalLogic continuousRetrievalLogic) { | ||
this.continuousRetrievalLogic = continuousRetrievalLogic; | ||
} | ||
|
||
|
||
@Override | ||
public OpenApiDocumentation docs() { | ||
return OpenApiBuilder.document() | ||
.operation(op -> { | ||
op.summary("Find similar segments based on the given staged query"); | ||
op.description("Performs a similarity search based on the formulated query stages, executing each subsequent stage on the results of the previous stage"); | ||
op.operationId("findSegmentSimilarStaged"); | ||
op.addTagsItem("Segments"); | ||
}) | ||
.body(inClass()) | ||
.json("200", outClass()); | ||
} | ||
|
||
@Override | ||
public SimilarityQueryResultBatch performPost(StagedSimilarityQuery query, Context ctx) { | ||
ConstrainedQueryConfig config = ConstrainedQueryConfig.getApplyingConfig(query.getConfig()); | ||
|
||
var results = QueryUtil.findSegmentsSimilarStaged(continuousRetrievalLogic, query.getStages(), config); | ||
|
||
return new SimilarityQueryResultBatch(results, config.getQueryId().toString()); | ||
} | ||
|
||
@Override | ||
public Class<StagedSimilarityQuery> inClass() { | ||
return StagedSimilarityQuery.class; | ||
} | ||
|
||
@Override | ||
public Class<SimilarityQueryResultBatch> outClass() { | ||
return SimilarityQueryResultBatch.class; | ||
} | ||
|
||
@Override | ||
public String route() { | ||
return ROUTE; | ||
} | ||
} |
Oops, something went wrong.