Skip to content

Commit

Permalink
Merge pull request #230 from vitrivr/dev
Browse files Browse the repository at this point in the history
v3.4.0: Javalin 4, Improved Spatial Retrieval, Temporal Scoring for ImageSequences

Former-commit-id: 1f9257c
  • Loading branch information
sauterl authored Nov 5, 2021
2 parents d72993c + 740156b commit 7ef931d
Show file tree
Hide file tree
Showing 55 changed files with 554 additions and 1,233 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: nc -zv 127.0.0.1 1865
- name: Test with Gradle
timeout-minutes: 5
run: ./gradlew test --debug
run: ./gradlew test
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[![swagger-editor](https://img.shields.io/badge/open--API-in--editor-green.svg?style=flat&label=open-api-v2)](https://editor.swagger.io/?url=https://raw.githubusercontent.com/vitrivr/cineast/multi-module-openapi-support/docs/swagger.json)
[![Build Status](https://travis-ci.org/vitrivr/cineast.svg?branch=master)](https://travis-ci.org/vitrivr/cineast)
[![vitrivr - cineast](https://img.shields.io/static/v1?label=vitrivr&message=cineast&color=blue&logo=github)](https://github.com/vitrivr/cineast)
[![GitHub release](https://img.shields.io/github/release/vitrivr/cineast?include_prereleases=&sort=semver&color=2ea44f)](https://github.com/vitrivr/cineast/releases/)
[![License](https://img.shields.io/badge/License-MIT-blueviolet)](#license)
[![swagger-editor](https://img.shields.io/badge/open--API-in--editor-green.svg?style=flat&label=Open-Api%20(Release))](https://editor.swagger.io/?url=https://raw.githubusercontent.com/vitrivr/cineast/master/docs/openapi.json)
[![swagger-editor](https://img.shields.io/badge/open--API-in--editor-green.svg?style=flat&label=Open-Api%20(Dev))](https://editor.swagger.io/?url=https://raw.githubusercontent.com/vitrivr/cineast/master/docs/openapi.json)
[![Java CI with Gradle](https://github.com/vitrivr/cineast/workflows/Java%20CI%20with%20Gradle/badge.svg)](https://github.com/vitrivr/cineast/actions?query=workflow:"Java+CI+with+Gradle")

# Cineast
Cineast is a multi-feature content-based multimedia retrieval engine. It is capable of retrieving images, audio- and video sequences as well as 3d models based on edge or color sketches, sketch-based motion queries and example objects.
Expand Down Expand Up @@ -92,4 +96,4 @@ Please use the file supplied in the `docs/` folder

To automatically apply the styleguide in [IntelliJ IDEA](https://www.jetbrains.com/idea/) go to_File_ -> _Settings_ -> _Editor_ -> _Code Style_ -> _Java_ and import the supplied file via the gear icon.

You can also use [Eclipse](https://www.eclipse.org/) for development and use Google's [styleguide for eclipse](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml).
You can also use [Eclipse](https://www.eclipse.org/) for development and use Google's [styleguide for eclipse](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml).
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ allprojects {
/* Group name of our artifacts */
group = 'org.vitrivr'

/* Our current version */
version = '3.3.0'
/* Our current version, on dev branch this should always be release+1-SNAPSHOT */
version = '3.4.0-SNAPSHOT'

apply plugin: 'java-library'
apply plugin: 'maven-publish'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public Javalin dispatchService(boolean secure) {
final int port = this.validateAndNormalizePort(secure, config);

final Javalin service = Javalin.create(serviceConfig -> {
/* Default return mime */
serviceConfig.defaultContentType = "application/json";
/* Prefer 405 over 404 to not expose information */
serviceConfig.prefer405over404 = true;
/* Configure server (TLS, thread pool, etc.) */
serviceConfig.enableCorsForAllOrigins();
/* Configuration of the actual server */
Expand Down Expand Up @@ -317,10 +321,6 @@ public Javalin dispatchService(boolean secure) {
LOGGER.error(ex);
});

/* General settings */
service.config.defaultContentType = "application/json";
service.config.prefer405over404 = true;

/* Start javalin */
try {
if (port > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.vitrivr.cineast.core.data.query.containers.ModelQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.MotionQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.AbstractQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.ParameterisedLocationQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.SemanticMapQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.TagQueryTermContainer;
import org.vitrivr.cineast.core.data.query.containers.TextQueryTermContainer;
Expand All @@ -28,6 +29,7 @@ public enum QueryTermType {
MOTION(MotionQueryTermContainer.class),
MODEL3D(ModelQueryTermContainer.class),
LOCATION(LocationQueryTermContainer.class),
PARAMETERISED_LOCATION(ParameterisedLocationQueryTermContainer.class),
TIME(InstantQueryTermContainer.class),
TEXT(TextQueryTermContainer.class),
TAG(TagQueryTermContainer.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ public static OpenAPI getOpenApi(APIConfig config) {
/* Add the OAS tags */
OAS_TAGS.forEach(api::addTagsItem);

api.addServersItem(
new io.swagger.v3.oas.models.servers.Server()
.description("Cineast API Address")
.url(config.getApiAddress())
);

return api;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class FindSegmentFeaturesGetHandler implements
GetRestHandler<FeaturesAllCategoriesQueryResult> {

public static final String ROUTE = "find/feature/all/by/id/:" + ID_QUALIFIER;
public static final String ROUTE = "find/feature/all/by/id/{" + ID_QUALIFIER + "}";

@Override
public FeaturesAllCategoriesQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class FindSegmentTextGetHandler implements GetRestHandler<FeaturesTextCategoryQueryResult> {

public static final String ROUTE = "find/feature/text/by/:" + ID_QUALIFIER + "/:" + CATEGORY_NAME;
public static final String ROUTE = "find/feature/text/by/{" + ID_QUALIFIER + "}/{" + CATEGORY_NAME + "}";

@Override
public FeaturesTextCategoryQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class FindTagsForElementGetHandler implements GetRestHandler<TagIDsForElementQueryResult> {

public static final String ROUTE = "find/feature/tags/by/id/:" + ID_QUALIFIER;
public static final String ROUTE = "find/feature/tags/by/id/{" + ID_QUALIFIER+"}";

@Override
public TagIDsForElementQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

public class FindObjectAllGetHandler implements GetRestHandler<MediaObjectQueryResult> {

// TODO CAUTION: This route has a breaking change in response signature

public static final String TYPE_NAME = "type";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class FindObjectGetHandler implements GetRestHandler<MediaObjectQueryResu
public static final String ATTRIBUTE_NAME = "attribute";
public static final String VALUE_NAME = "value";

public static final String ROUTE = "find/object/by/:" + ATTRIBUTE_NAME + "/:" + VALUE_NAME;
public static final String ROUTE = "find/object/by/{" + ATTRIBUTE_NAME + "}/{" + VALUE_NAME+"}";

private static final Logger LOGGER = LogManager.getLogger(FindObjectGetHandler.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.vitrivr.cineast.api.rest.OpenApiCompatHelper;
import org.vitrivr.cineast.api.rest.handlers.interfaces.GetRestHandler;
import org.vitrivr.cineast.api.rest.services.MetadataRetrievalService;
import org.vitrivr.cineast.api.util.APIConstants;

/**
* Finds metadata of a given object id list (REST) / object id (Web) and returns only items in a certain domain.
Expand All @@ -20,7 +21,8 @@
public class FindObjectMetadataByDomainGetHandler implements GetRestHandler<MediaObjectMetadataQueryResult> {


public static final String ROUTE = "find/metadata/in/:" + DOMAIN_NAME + "/by/id/:" + FindObjectMetadataFullyQualifiedGetHandler.DOMAIN_NAME;
public static final String ROUTE = "find/metadata/in/{" + DOMAIN_NAME + "}/by/id/{" + APIConstants.ID_QUALIFIER
+ "}";

@Override
public MediaObjectMetadataQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class FindObjectMetadataByDomainPostHandler implements ParsingPostRestHandler<IdList, MediaObjectMetadataQueryResult> {

public static final String ROUTE = "find/metadata/in/:" + DOMAIN_NAME;
public static final String ROUTE = "find/metadata/in/{" + DOMAIN_NAME +"}";

@Override
public MediaObjectMetadataQueryResult performPost(IdList ids, Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class FindObjectMetadataByKeyGetHandler implements GetRestHandler<MediaObjectMetadataQueryResult> {

public static final String ROUTE = "find/metadata/with/:" + KEY_NAME + "/by/id/:" + OBJECT_ID_NAME;
public static final String ROUTE = "find/metadata/with/{" + KEY_NAME + "}/by/id/{" + OBJECT_ID_NAME + "}";

@Override
public MediaObjectMetadataQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class FindObjectMetadataByKeyPostHandler implements ParsingPostRestHandler<IdList, MediaObjectMetadataQueryResult> {

public static final String ROUTE = "find/metadata/with/:" + KEY_NAME;
public static final String ROUTE = "find/metadata/with/{" + KEY_NAME+"}";

@Override
public MediaObjectMetadataQueryResult performPost(IdList ids, Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class FindObjectMetadataFullyQualifiedGetHandler implements
public static final String DOMAIN_NAME = "domain";
public static final String KEY_NAME = "key";

public static final String ROUTE = "find/metadata/of/:" + OBJECT_ID_NAME + "/in/:" + DOMAIN_NAME + "/with/:" + KEY_NAME;
public static final String ROUTE = "find/metadata/of/{" + OBJECT_ID_NAME + "}/in/{" + DOMAIN_NAME + "}/with/{" + KEY_NAME +"}";

@Override
public MediaObjectMetadataQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class FindObjectMetadataGetHandler implements GetRestHandler<MediaObjectMetadataQueryResult> {

public static final String ROUTE = "find/metadata/by/id/:" + OBJECT_ID_NAME;
public static final String ROUTE = "find/metadata/by/id/{" + OBJECT_ID_NAME +"}";

@Override
public MediaObjectMetadataQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class FindSegmentMetadataGetHandler implements GetRestHandler<MediaSegmentMetadataQueryResult> {

public static final String ROUTE = "find/metadata/by/segmentid/:" + ID_QUALIFIER;
public static final String ROUTE = "find/metadata/by/segmentid/{" + ID_QUALIFIER +"}";

@Override
public MediaSegmentMetadataQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class FindSegmentsByIdGetHandler implements GetRestHandler<MediaSegmentQu

public static final String ID_NAME = "id";

public static final String ROUTE = "find/segments/by/id/:" + ID_NAME;
public static final String ROUTE = "find/segments/by/id/{" + ID_NAME+"}";

@Override
public MediaSegmentQueryResult doGet(Context ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

public class FindSegmentsByObjectIdGetHandler implements GetRestHandler<MediaSegmentQueryResult> {

// TODO CAUTION: This route has a breaking change in response signature

public static final String ID_NAME = "id";
public static final String ROUTE = "find/segments/all/object/:" + ID_NAME;
public static final String ROUTE = "find/segments/all/object/{" + ID_NAME +"}";


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class EndSessionHandler implements GetRestHandler<SessionState> {

public static final String ID_NAME = "id";

public static final String ROUTE = "session/end/:" + ID_NAME;
public static final String ROUTE = "session/end/{" + ID_NAME +"}";


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ValidateSessionHandler implements GetRestHandler<SessionState> {

private final static String ID_NAME = "id";

public static final String ROUTE = "session/validate/:" + ID_NAME;
public static final String ROUTE = "session/validate/{" + ID_NAME+"}";

public static SessionState validateSession(String sessionId) {
if (sessionId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

public class FindTagsAllGetHandler implements GetRestHandler<TagsQueryResult> {

// TODO CAUTION: This route has a breaking change in response signature

public static final String ROUTE = "find/tags/all";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

public class FindTagsByIdsPostHandler implements ParsingPostRestHandler<IdList, TagsQueryResult> {

// TODO CAUTION: This route has a breaking change in response signature

public static final String ROUTE = "tags/by/id"; // TODO only route not prefixed by find?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

public class FindTagsGetHandler implements GetRestHandler<TagsQueryResult> {

// TODO CAUTION: This route has a breaking change in response signature

public static final String ID_NAME = "id";
public static final String NAME_NAME = "name";
Expand All @@ -25,7 +24,7 @@ public class FindTagsGetHandler implements GetRestHandler<TagsQueryResult> {
public static final String ATTRIBUTE_NAME = "attribute";
public static final String VALUE_NAME = "value";

public static final String ROUTE = "find/tags/by/:" + ATTRIBUTE_NAME + "/:" + VALUE_NAME;
public static final String ROUTE = "find/tags/by/{" + ATTRIBUTE_NAME + "}/{" + VALUE_NAME+"}";

private static final Logger LOGGER = LogManager.getLogger(FindTagsGetHandler.class);

Expand Down
Loading

0 comments on commit 7ef931d

Please sign in to comment.