Skip to content
Permalink
Browse files

Renamed some of the core entities (MediaObject, MediaSegment etc.) in…

… order to get consistent naming. In addition, the query process has been streamlined.
  • Loading branch information...
Ralph Gasser
Ralph Gasser committed Nov 1, 2018
1 parent dc8975c commit c57de81118aa00b56f93f29e659c95d06dcf557a
Showing with 907 additions and 921 deletions.
  1. +4 −1 cineast.json
  2. +5 −5 src/org/vitrivr/cineast/api/API.java
  3. +24 −24 src/org/vitrivr/cineast/api/JSONAPIThread.java
  4. +10 −10 src/org/vitrivr/cineast/api/JSONEncoder.java
  5. +14 −14 src/org/vitrivr/cineast/api/JSONUtils.java
  6. +8 −8 ...vitrivr/cineast/api/rest/handlers/actions/FindMetadataByDomainWithKeyByObjectIdActionHandler.java
  7. +14 −14 src/org/vitrivr/cineast/api/rest/handlers/actions/FindMetadataByKeyByObjectIdActionHandler.java
  8. +18 −18 src/org/vitrivr/cineast/api/rest/handlers/actions/FindMetadataByObjectIdActionHandler.java
  9. +16 −16 src/org/vitrivr/cineast/api/rest/handlers/actions/FindMetadataInDomainByObjectIdActionHandler.java
  10. +7 −7 src/org/vitrivr/cineast/api/rest/handlers/actions/FindObjectAllActionHandler.java
  11. +14 −14 src/org/vitrivr/cineast/api/rest/handlers/actions/FindObjectByActionHandler.java
  12. +0 −1 src/org/vitrivr/cineast/api/rest/handlers/actions/FindSegmentSimilarActionHandler.java
  13. +15 −15 src/org/vitrivr/cineast/api/rest/handlers/actions/FindSegmentsByIdActionHandler.java
  14. +9 −9 src/org/vitrivr/cineast/api/rest/handlers/actions/FindSegmentsByObjectIdActionHandler.java
  15. +2 −2 src/org/vitrivr/cineast/api/rest/handlers/actions/FindTagsActionHandler.java
  16. +6 −6 src/org/vitrivr/cineast/api/rest/resolvers/FileSystemObjectResolver.java
  17. +7 −7 src/org/vitrivr/cineast/api/websocket/handlers/MetadataLookupMessageHandler.java
  18. +69 −98 src/org/vitrivr/cineast/api/websocket/handlers/QueryMessageHandler.java
  19. +20 −20 src/org/vitrivr/cineast/api/websocket/handlers/queries/AbstractQueryMessageHandler.java
  20. +8 −12 src/org/vitrivr/cineast/api/websocket/handlers/queries/MoreLikeThisQueryMessageHandler.java
  21. +4 −4 src/org/vitrivr/cineast/api/websocket/handlers/queries/NeighbouringQueryMessageHandler.java
  22. +8 −14 src/org/vitrivr/cineast/api/websocket/handlers/queries/SimilarityQueryMessageHandler.java
  23. +5 −5 src/org/vitrivr/cineast/art/modules/FullVisualizationMedianColorSunburst.java
  24. +5 −5 src/org/vitrivr/cineast/art/modules/FullVisualizationMedianColorSunburstReal.java
  25. +13 −13 src/org/vitrivr/cineast/art/modules/VisualizationAverageColorStripeVariable.java
  26. +13 −13 src/org/vitrivr/cineast/art/modules/VisualizationDominantColorStripeVariable.java
  27. +13 −13 src/org/vitrivr/cineast/art/modules/VisualizationMedianColorStripeVariable.java
  28. +3 −3 src/org/vitrivr/cineast/art/modules/visualization/SegmentDescriptorComparator.java
  29. +3 −3 src/org/vitrivr/cineast/core/config/IdConfig.java
  30. +21 −21 ...vitrivr/cineast/core/data/entities/{MultimediaObjectDescriptor.java → MediaObjectDescriptor.java}
  31. +24 −24 ...neast/core/data/entities/{MultimediaMetadataDescriptor.java → MediaObjectMetadataDescriptor.java}
  32. +9 −9 src/org/vitrivr/cineast/core/data/entities/{SegmentDescriptor.java → MediaSegmentDescriptor.java}
  33. +12 −12 ...re/data/entities/{MultimediaMetadataSegmentDescriptor.java → MediaSegmentMetadataDescriptor.java}
  34. +1 −1 src/org/vitrivr/cineast/core/data/entities/SimpleFulltextFeatureDescriptor.java
  35. +3 −3 src/org/vitrivr/cineast/core/data/messages/components/AbstractMetadataFilterDescriptor.java
  36. +5 −4 src/org/vitrivr/cineast/core/data/messages/components/MetadataDomainFilter.java
  37. +5 −4 src/org/vitrivr/cineast/core/data/messages/components/MetadataKeyFilter.java
  38. +3 −8 src/org/vitrivr/cineast/core/data/messages/interfaces/MessageType.java
  39. +2 −4 src/org/vitrivr/cineast/core/data/messages/query/NeighboringSegmentQuery.java
  40. +5 −5 ...ineast/core/data/messages/result/{MetadataQueryResult.java → MediaObjectMetadataQueryResult.java}
  41. +3 −3 .../vitrivr/cineast/core/data/messages/result/{ObjectQueryResult.java → MediaObjectQueryResult.java}
  42. +30 −0 src/org/vitrivr/cineast/core/data/messages/result/MediaSegmentMetadataQueryResult.java
  43. +3 −3 ...itrivr/cineast/core/data/messages/result/{SegmentQueryResult.java → MediaSegmentQueryResult.java}
  44. +11 −11 ...vr/cineast/core/db/dao/{MultimediaMetadataSegmentHandler.java → MediaSegmentMetadataHandler.java}
  45. +1 −1 src/org/vitrivr/cineast/core/db/dao/reader/AbstractEntityReader.java
  46. +20 −20 ...trivr/cineast/core/db/dao/reader/{MultimediaMetadataReader.java → MediaObjectMetadataReader.java}
  47. +43 −43 src/org/vitrivr/cineast/core/db/dao/reader/{MultimediaObjectLookup.java → MediaObjectReader.java}
  48. +16 −16 ...neast/core/db/dao/reader/{MultimediaMetadataSegmentReader.java → MediaSegmentMetadataReader.java}
  49. +24 −24 src/org/vitrivr/cineast/core/db/dao/reader/{SegmentLookup.java → MediaSegmentReader.java}
  50. +6 −6 ...trivr/cineast/core/db/dao/writer/{MultimediaMetadataWriter.java → MediaObjectMetadataWriter.java}
  51. +6 −6 src/org/vitrivr/cineast/core/db/dao/writer/{MultimediaObjectWriter.java → MediaObjectWriter.java}
  52. +26 −0 src/org/vitrivr/cineast/core/db/dao/writer/MediaSegmentMetadataWriter.java
  53. +7 −7 src/org/vitrivr/cineast/core/db/dao/writer/{SegmentWriter.java → MediaSegmentWriter.java}
  54. +0 −26 src/org/vitrivr/cineast/core/db/dao/writer/MultimediaMetadataSegmentWriter.java
  55. +2 −2 src/org/vitrivr/cineast/core/decode/shotboundary/ShotBoundaryDecoder.java
  56. +5 −5 src/org/vitrivr/cineast/core/decode/shotboundary/TrecvidMasterShotReferenceDecoder.java
  57. +16 −16 src/org/vitrivr/cineast/core/evaluation/EvaluationRuntime.java
  58. +7 −2 src/org/vitrivr/cineast/core/features/ConceptMasksAde20k.java
  59. +4 −4 src/org/vitrivr/cineast/core/features/SpatialDistance.java
  60. +4 −4 src/org/vitrivr/cineast/core/features/TemporalDistance.java
  61. +13 −13 src/org/vitrivr/cineast/core/features/abstracts/MetadataFeatureModule.java
  62. +9 −9 src/org/vitrivr/cineast/core/features/listener/RetrievalResultCSVExporter.java
  63. +5 −5 src/org/vitrivr/cineast/core/importer/TRECVIDShotBoundaryImporter.java
  64. +5 −4 src/org/vitrivr/cineast/core/metadata/EXIFMetadataExtractor.java
  65. +3 −3 src/org/vitrivr/cineast/core/metadata/IPTCMetadataExtractor.java
  66. +4 −4 src/org/vitrivr/cineast/core/metadata/JsonMetaDataExtractor.java
  67. +3 −3 src/org/vitrivr/cineast/core/metadata/MetadataExtractor.java
  68. +3 −3 src/org/vitrivr/cineast/core/metadata/MetadataFeatureExtractor.java
  69. +9 −12 src/org/vitrivr/cineast/core/metadata/TechnicalVideoMetadataExtractor.java
  70. +16 −16 src/org/vitrivr/cineast/core/run/ExtractionItemContainer.java
  71. +46 −46 src/org/vitrivr/cineast/core/run/filehandler/AbstractExtractionFileHandler.java
  72. +46 −46 src/org/vitrivr/cineast/core/run/filehandler/GenericExtractionItemHandler.java
  73. +3 −2 src/org/vitrivr/cineast/core/run/path/SingletonContainerProvider.java
  74. +2 −2 src/org/vitrivr/cineast/core/run/path/TreeWalkContainerIteratorProvider.java
  75. +2 −4 src/org/vitrivr/cineast/core/segmenter/audio/ConstantLengthAudioSegmenter.java
  76. +2 −2 src/org/vitrivr/cineast/core/segmenter/general/PassthroughSegmenter.java
  77. +2 −6 src/org/vitrivr/cineast/core/segmenter/general/Segmenter.java
  78. +5 −5 src/org/vitrivr/cineast/core/segmenter/video/TRECVidMSRSegmenter.java
  79. +4 −4 src/org/vitrivr/cineast/core/segmenter/video/V3CMSBSegmenter.java
  80. +10 −10 src/org/vitrivr/cineast/core/segmenter/video/VideoHistogramSegmenter.java
  81. +27 −27 src/org/vitrivr/cineast/core/setup/ADAMproEntityCreator.java
  82. +6 −6 src/org/vitrivr/cineast/core/setup/EntityCreator.java
  83. +8 −8 src/org/vitrivr/cineast/core/util/ArtUtil.java
  84. +10 −10 src/org/vitrivr/cineast/core/util/ScoreFusion.java
  85. +3 −3 ...core/data/entities/{MultimediaObjectDescriptorJsonTest.java → MediaObjectDescriptorJsonTest.java}
@@ -1,6 +1,6 @@
{
"database": {
"host": "out/json",
"host": "/Users/gassra02/Downloads/json",
"selector": "JSON",
"port": 5890,
"plaintext": true
@@ -14,6 +14,9 @@
"maxResults": 200,
"resultsPerModule": 250,
"features": {
"semantic" : [
{"feature": "ConceptMasksAde20k", "weight" : 1.0}
],
"globalcolor": [
{"feature": "AverageColor", "weight": 2.3},
{"feature": "MedianColor", "weight": 1.2},
@@ -33,13 +33,13 @@
import org.vitrivr.cineast.core.config.Config;
import org.vitrivr.cineast.core.config.IngestConfig;
import org.vitrivr.cineast.core.config.QueryConfig;
import org.vitrivr.cineast.core.data.entities.MultimediaMetadataDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaObjectMetadataDescriptor;
import org.vitrivr.cineast.core.data.m3d.Mesh;
import org.vitrivr.cineast.core.data.score.SegmentScoreElement;
import org.vitrivr.cineast.core.data.tag.IncompleteTag;
import org.vitrivr.cineast.core.data.tag.Tag;
import org.vitrivr.cineast.core.db.dao.TagHandler;
import org.vitrivr.cineast.core.db.dao.reader.MultimediaMetadataReader;
import org.vitrivr.cineast.core.db.dao.reader.MediaObjectMetadataReader;
import org.vitrivr.cineast.core.evaluation.EvaluationConfig;
import org.vitrivr.cineast.core.evaluation.EvaluationException;
import org.vitrivr.cineast.core.evaluation.EvaluationRuntime;
@@ -547,10 +547,10 @@ public void run() {
break;
}
List<String> ids = commands.subList(1, commands.size());
Ordering<MultimediaMetadataDescriptor> ordering =
Ordering<MediaObjectMetadataDescriptor> ordering =
Ordering.explicit(ids).onResultOf(d -> d.getObjectId());
try (MultimediaMetadataReader r = new MultimediaMetadataReader()) {
List<MultimediaMetadataDescriptor> descriptors = r.lookupMultimediaMetadata(ids);
try (MediaObjectMetadataReader r = new MediaObjectMetadataReader()) {
List<MediaObjectMetadataDescriptor> descriptors = r.lookupMultimediaMetadata(ids);
descriptors.sort(ordering);
descriptors.forEach(System.out::println);
}
@@ -28,12 +28,12 @@
import org.vitrivr.cineast.core.config.QueryConfig;
import org.vitrivr.cineast.core.data.Position;
import org.vitrivr.cineast.core.data.StringDoublePair;
import org.vitrivr.cineast.core.data.entities.MultimediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.SegmentDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaSegmentDescriptor;
import org.vitrivr.cineast.core.data.query.containers.ImageQueryContainer;
import org.vitrivr.cineast.core.data.score.SegmentScoreElement;
import org.vitrivr.cineast.core.db.dao.reader.MultimediaObjectLookup;
import org.vitrivr.cineast.core.db.dao.reader.SegmentLookup;
import org.vitrivr.cineast.core.db.dao.reader.MediaObjectReader;
import org.vitrivr.cineast.core.db.dao.reader.MediaSegmentReader;
import org.vitrivr.cineast.core.util.ContinuousRetrievalLogic;
import org.vitrivr.cineast.core.util.LogHelper;
import org.vitrivr.cineast.explorative.PlaneHandler;
@@ -85,13 +85,13 @@ public void run() {
// String category = queryObject.get("category").asString();
String shotId = queryObject.get("shotid").asString();

SegmentLookup sl = new SegmentLookup();
SegmentDescriptor shot = sl.lookUpSegment(shotId).get();
MediaSegmentReader sl = new MediaSegmentReader();
MediaSegmentDescriptor shot = sl.lookUpSegment(shotId).get();
//List<ShotDescriptor> allShots = sl.lookUpVideo(shot.getObjectId());

//Send metadata
MultimediaObjectLookup vl = new MultimediaObjectLookup();
MultimediaObjectDescriptor descriptor = vl.lookUpObjectById(shot.getObjectId());
MediaObjectReader vl = new MediaObjectReader();
MediaObjectDescriptor descriptor = vl.lookUpObjectById(shot.getObjectId());

JsonObject resultobj = JSONEncoder.encodeVideo(descriptor);

@@ -112,8 +112,8 @@ public void run() {
case "shot": {
String shotId = clientJSON.get("shotid").asString();

SegmentLookup sl = new SegmentLookup();
SegmentDescriptor shot = sl.lookUpSegment(shotId).get();
MediaSegmentReader sl = new MediaSegmentReader();
MediaSegmentDescriptor shot = sl.lookUpSegment(shotId).get();

JsonObject resultobj = new JsonObject();
resultobj.add("type", "submitShot").add("videoId", shot.getObjectId()).add("start", shot.getStart()).add("end", shot.getEnd());
@@ -341,8 +341,8 @@ public void run() {
JsonObject query = clientJSON.get("query").asObject();
JsonArray shotidlist = query.get("shotidlist").asArray();
int limit = query.get("limit") == null ? 5 : query.get("limit").asInt();
SegmentLookup sl = new SegmentLookup();
// SegmentLookup.SegmentDescriptor descriptor;
MediaSegmentReader sl = new MediaSegmentReader();
// MediaSegmentReader.MediaSegmentDescriptor descriptor;
this.printer.print('[');


@@ -355,15 +355,15 @@ public void run() {

JsonValue val = shotidlist.get(i);
String shotid = val.asString();
SegmentDescriptor descriptor = sl.lookUpSegment(shotid).get();
MediaSegmentDescriptor descriptor = sl.lookUpSegment(shotid).get();

String video = descriptor.getObjectId();
int startSegment = Math.max(1, descriptor.getSequenceNumber() - limit);
int endSegment = descriptor.getSequenceNumber() + limit;

List<SegmentDescriptor> all = sl.lookUpSegmentsOfObject(video);
List<MediaSegmentDescriptor> all = sl.lookUpSegmentsOfObject(video);

for(SegmentDescriptor sd : all){
for(MediaSegmentDescriptor sd : all){
if(sd.getSequenceNumber() >= startSegment && sd.getSequenceNumber() <= endSegment){
array.add(JSONEncoder.encodeShot(sd));
}
@@ -402,10 +402,10 @@ public void run() {
// }

case "getMultimediaobjects":{
List<MultimediaObjectDescriptor> multimediaobjectIds = new MultimediaObjectLookup().getAllObjects();
List<MediaObjectDescriptor> multimediaobjectIds = new MediaObjectReader().getAllObjects();

JsonArray movies = new JsonArray();
for(MultimediaObjectDescriptor descriptor: multimediaobjectIds){
for(MediaObjectDescriptor descriptor: multimediaobjectIds){
JsonObject resultobj = JSONEncoder.encodeVideo(descriptor);
movies.add(resultobj);
}
@@ -416,11 +416,11 @@ public void run() {

case "getSegments":{
String multimediaobjectId = clientJSON.get("multimediaobjectId").asString();
List<SegmentDescriptor> segments = new SegmentLookup().lookUpSegmentsOfObject(multimediaobjectId);
List<MediaSegmentDescriptor> segments = new MediaSegmentReader().lookUpSegmentsOfObject(multimediaobjectId);
Collections.sort(segments, new SegmentDescriptorComparator());

JsonArray list = new JsonArray();
for (SegmentDescriptor segment: segments) {
for (MediaSegmentDescriptor segment: segments) {
list.add(segment.getSegmentId());
}

@@ -519,17 +519,17 @@ public void run() {
for(JsonValue v : idList){
ids.add(v.asString());
}
SegmentLookup lookup = new SegmentLookup();
Map<String, SegmentDescriptor> segments = lookup.lookUpSegments(ids);
MediaSegmentReader lookup = new MediaSegmentReader();
Map<String, MediaSegmentDescriptor> segments = lookup.lookUpSegments(ids);
lookup.close();

HashSet<String> mmobjectIds = new HashSet<>();
for(SegmentDescriptor descriptor : segments.values()){
for(MediaSegmentDescriptor descriptor : segments.values()){
mmobjectIds.add(descriptor.getObjectId());
}

MultimediaObjectLookup mmlookup = new MultimediaObjectLookup();
Map<String, MultimediaObjectDescriptor> mmobjects = mmlookup.lookUpObjects(mmobjectIds);
MediaObjectReader mmlookup = new MediaObjectReader();
Map<String, MediaObjectDescriptor> mmobjects = mmlookup.lookUpObjects(mmobjectIds);
mmlookup.close();

printer.print(JSONEncoder.encodeVideoBatch(mmobjects.values()));
@@ -3,8 +3,8 @@
import java.util.List;

import org.vitrivr.cineast.core.data.StringDoublePair;
import org.vitrivr.cineast.core.data.entities.MultimediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.SegmentDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaSegmentDescriptor;

import com.eclipsesource.json.JsonArray;
import com.eclipsesource.json.JsonObject;
@@ -53,24 +53,24 @@ public static final JsonObject encodeShot(String shotId, String videoId, long st
return _return;
}

public static JsonObject encodeShot(SegmentDescriptor sd, boolean includeType){
public static JsonObject encodeShot(MediaSegmentDescriptor sd, boolean includeType){
return encodeShot(sd.getSegmentId(), sd.getObjectId(), sd.getStart(), sd.getEnd(), includeType);
}

public static final JsonObject encodeShot(String shotId, String videoId, long startFrame, long endFrame){
return encodeShot(shotId, videoId, startFrame, endFrame, true);
}

public static final JsonObject encodeShot(SegmentDescriptor sd){
public static final JsonObject encodeShot(MediaSegmentDescriptor sd){
return encodeShot(sd, true);
}

public static final JsonObject encodeShotBatch(Iterable<SegmentDescriptor> sdList){
public static final JsonObject encodeShotBatch(Iterable<MediaSegmentDescriptor> sdList){
JsonObject _return = new JsonObject();
_return.add("type", "batch");
_return.add("inner", "shot");
JsonArray array = new JsonArray();
for(SegmentDescriptor sd : sdList){
for(MediaSegmentDescriptor sd : sdList){
array.add(encodeShot(sd, false));
}
_return.add("array", array);
@@ -96,20 +96,20 @@ public static final JsonObject encodeVideo(String name, String videoId, String p



public static final JsonObject encodeVideo(MultimediaObjectDescriptor vd, boolean includeType){
public static final JsonObject encodeVideo(MediaObjectDescriptor vd, boolean includeType){
return encodeVideo(vd.getName(), vd.getObjectId(), vd.getPath(), includeType);
}

public static final JsonObject encodeVideo(MultimediaObjectDescriptor vd){
public static final JsonObject encodeVideo(MediaObjectDescriptor vd){
return encodeVideo(vd, true);
}

public static final JsonObject encodeVideoBatch(Iterable<MultimediaObjectDescriptor> vdList){
public static final JsonObject encodeVideoBatch(Iterable<MediaObjectDescriptor> vdList){
JsonObject _return = new JsonObject();
_return.add("type", "batch");
_return.add("inner", "video");
JsonArray array = new JsonArray();
for(MultimediaObjectDescriptor vd : vdList){
for(MediaObjectDescriptor vd : vdList){
array.add(encodeVideo(vd, false));
}
_return.add("array", array);
@@ -14,11 +14,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vitrivr.cineast.core.data.*;
import org.vitrivr.cineast.core.data.entities.MultimediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.SegmentDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaObjectDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaSegmentDescriptor;
import org.vitrivr.cineast.core.data.query.containers.ImageQueryContainer;
import org.vitrivr.cineast.core.db.dao.reader.MultimediaObjectLookup;
import org.vitrivr.cineast.core.db.dao.reader.SegmentLookup;
import org.vitrivr.cineast.core.db.dao.reader.MediaObjectReader;
import org.vitrivr.cineast.core.db.dao.reader.MediaSegmentReader;
import org.vitrivr.cineast.core.decode.subtitle.SubtitleItem;
import org.vitrivr.cineast.core.util.LogHelper;
import org.vitrivr.cineast.core.util.web.ImageParser;
@@ -180,19 +180,19 @@ public static void printResultsBatched(PrintStream printer, List<StringDoublePai
}

public static HashSet<String> printShotsBatched(PrintStream printer, List<StringDoublePair> resultlist, HashSet<String> shotids) {
ArrayList<SegmentDescriptor> sdList = new ArrayList<>(resultlist.size());
SegmentLookup sl = new SegmentLookup();
ArrayList<MediaSegmentDescriptor> sdList = new ArrayList<>(resultlist.size());
MediaSegmentReader sl = new MediaSegmentReader();

String[] ids = new String[resultlist.size()];
int i = 0;
for(StringDoublePair sdp : resultlist){
ids[i++] = sdp.key;
}

Map<String, SegmentDescriptor> map = sl.lookUpSegments(Arrays.asList(ids));
Map<String, MediaSegmentDescriptor> map = sl.lookUpSegments(Arrays.asList(ids));

for(String id : ids){
SegmentDescriptor sd = map.get(id);
MediaSegmentDescriptor sd = map.get(id);
if(sd != null){
sdList.add(sd);
}
@@ -217,20 +217,20 @@ public static void printResultsBatched(PrintStream printer, List<StringDoublePai
}

public static HashSet<String> printVideosBatched(PrintStream printer, List<StringDoublePair> resultlist, HashSet<String> videoids) {
SegmentLookup sl = new SegmentLookup();
MultimediaObjectLookup vl = new MultimediaObjectLookup();
MediaSegmentReader sl = new MediaSegmentReader();
MediaObjectReader vl = new MediaObjectReader();

String[] ids = new String[resultlist.size()];
int i = 0;
for(StringDoublePair sdp : resultlist){
ids[i++] = sdp.key;
}

Map<String, SegmentDescriptor> map = sl.lookUpSegments(Arrays.asList(ids));
Map<String, MediaSegmentDescriptor> map = sl.lookUpSegments(Arrays.asList(ids));

HashSet<String> videoIds = new HashSet<>();
for(String id : ids){
SegmentDescriptor sd = map.get(id);
MediaSegmentDescriptor sd = map.get(id);
if(sd == null){
continue;
}
@@ -243,9 +243,9 @@ public static void printResultsBatched(PrintStream printer, List<StringDoublePai
vids[i++] = vid;
}

ArrayList<MultimediaObjectDescriptor> vdList = new ArrayList<>(vids.length);
ArrayList<MediaObjectDescriptor> vdList = new ArrayList<>(vids.length);

Map<String, MultimediaObjectDescriptor> vmap = vl.lookUpObjects(vids);
Map<String, MediaObjectDescriptor> vmap = vl.lookUpObjects(vids);

for(String vid : vids){
vdList.add(vmap.get(vid));
@@ -5,10 +5,10 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.vitrivr.cineast.api.rest.handlers.abstracts.ParsingActionHandler;
import org.vitrivr.cineast.core.data.entities.MultimediaMetadataDescriptor;
import org.vitrivr.cineast.core.data.entities.MediaObjectMetadataDescriptor;
import org.vitrivr.cineast.core.data.messages.general.AnyMessage;
import org.vitrivr.cineast.core.data.messages.result.MetadataQueryResult;
import org.vitrivr.cineast.core.db.dao.reader.MultimediaMetadataReader;
import org.vitrivr.cineast.core.data.messages.result.MediaObjectMetadataQueryResult;
import org.vitrivr.cineast.core.db.dao.reader.MediaObjectMetadataReader;

/**
* This class handles GET requests with an object id, domain and key and returns all matching
@@ -29,8 +29,8 @@
public static final String DOMAIN_NAME = ":domain";
public static final String KEY_NAME = ":key";

private static Predicate<MultimediaMetadataDescriptor> createDomainAndKeyFilter(String domain,
String key) {
private static Predicate<MediaObjectMetadataDescriptor> createDomainAndKeyFilter(String domain,
String key) {
return (m) -> m.getKey().toLowerCase().equals(key.toLowerCase()) && m.getDomain().toLowerCase()
.equals(domain.toLowerCase());
}
@@ -40,11 +40,11 @@ public Object doGet(Map<String, String> parameters) {
final String objectId = parameters.get(OBJECT_ID_NAME);
final String domain = parameters.get(DOMAIN_NAME);
final String key = parameters.get(KEY_NAME);
final MultimediaMetadataReader reader = new MultimediaMetadataReader();
final List<MultimediaMetadataDescriptor> descriptors = reader
final MediaObjectMetadataReader reader = new MediaObjectMetadataReader();
final List<MediaObjectMetadataDescriptor> descriptors = reader
.lookupMultimediaMetadata(objectId);
reader.close();
return new MetadataQueryResult("",
return new MediaObjectMetadataQueryResult("",
descriptors.stream().filter(createDomainAndKeyFilter(domain, key))
.collect(Collectors.toList()));
}

0 comments on commit c57de81

Please sign in to comment.
You can’t perform that action at this time.