Skip to content

Commit

Permalink
The fields id and retrievableId are now variable fields for Descriptors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Gasser committed May 29, 2024
1 parent 109c266 commit 0a176e7
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ typealias DescriptorId = UUID
*/
interface Descriptor : Persistable {
/** The [DescriptorId] held by this [Descriptor]. */
val id: DescriptorId
var id: DescriptorId

/** The [RetrievableId] of the [Retrievable] that is being described by this [Descriptor]. */
val retrievableId: RetrievableId?
var retrievableId: RetrievableId?

/** The [Schema.Field] backing this [Descriptor]. */
val field: Schema.Field<*, out Descriptor>?


/** */
/** Flag indicating whether this [Descriptor] is persistent or not. */
override val transient: Boolean
get() = this.field != null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class BooleanDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.Boolean,
override val field: Schema.Field<*, BooleanDescriptor>? = null
) : ScalarDescriptor<Value.Boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class DoubleDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.Double,
override val field: Schema.Field<*, DoubleDescriptor>? = null
) : ScalarDescriptor<Value.Double> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class FloatDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.Float,
override val field: Schema.Field<*, FloatDescriptor>? = null
) : ScalarDescriptor<Value.Float> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class IntDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.Int,
override val field: Schema.Field<*, IntDescriptor>? = null
) : ScalarDescriptor<Value.Int> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class LongDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.Long,
override val field: Schema.Field<*, LongDescriptor>? = null
) : ScalarDescriptor<Value.Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.vitrivr.engine.core.model.types.Value
*/

data class StringDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId?,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
override val value: Value.String,
override val field: Schema.Field<*, StringDescriptor>? = null
) : ScalarDescriptor<Value.String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import org.vitrivr.engine.core.model.types.Value
* @version 1.0.0
*/
data class LabelDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId?,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val label: Value.String,
val confidence: Value.Float,
override val field: Schema.Field<*, LabelDescriptor>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.vitrivr.engine.core.model.types.Type
import org.vitrivr.engine.core.model.types.Value

data class RasterDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val hist: List<Value.Float>,
val raster: List<Value.Float>,
override val field: Schema.Field<*, RasterDescriptor>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.vitrivr.engine.core.model.types.Type
import org.vitrivr.engine.core.model.types.Value

data class SkeletonDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val person: Value.Int,
val skeleton: List<Value.Float>,
val weights: List<Value.Float>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import java.util.*
* @version 1.0.0
*/
data class MediaDimensionsDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val width: Value.Int,
val height: Value.Int,
override val field: Schema.Field<*, MediaDimensionsDescriptor>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
* @version 1.0.0
*/
data class Rectangle2DMetadataDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val leftX: Value.Int,
val leftY: Value.Int,
val width: Value.Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
* @version 1.0.0
*/
data class TemporalMetadataDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId, //retrievable Id must come first, due to reflection
override var id: DescriptorId,
override var retrievableId: RetrievableId?, //retrievable Id must come first, due to reflection
val startNs: Value.Long,
val endNs: Value.Long,
override val field: Schema.Field<*, TemporalMetadataDescriptor>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
* @version 1.0.0
*/
data class FileSourceMetadataDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val path: Value.String,
val size: Value.Long,
override val field: Schema.Field<*, FileSourceMetadataDescriptor>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import org.vitrivr.engine.core.model.types.Value
import java.util.*

data class MapStructDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val columnTypes: Map<String, String>,
val columnValues: Map<String, Any?>,
override val transient: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
* @version 1.0.0
*/
class VideoSourceMetadataDescriptor(
override val id: DescriptorId,
override val retrievableId: RetrievableId,
override var id: DescriptorId,
override var retrievableId: RetrievableId?,
val width: Value.Int,
val height: Value.Int,
val fps: Value.Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
*/

data class BooleanVectorDescriptor(
override val id: UUID = UUID.randomUUID(),
override val retrievableId: RetrievableId? = null,
override var id: UUID = UUID.randomUUID(),
override var retrievableId: RetrievableId? = null,
override val vector: List<Value.Boolean>,
override val field: Schema.Field<*, BooleanVectorDescriptor>? = null
) : VectorDescriptor<Value.Boolean> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
*/

data class DoubleVectorDescriptor(
override val id: UUID = UUID.randomUUID(),
override val retrievableId: RetrievableId? = null,
override var id: UUID = UUID.randomUUID(),
override var retrievableId: RetrievableId? = null,
override val vector: List<Value.Double>,
override val field: Schema.Field<*, DoubleVectorDescriptor>? = null
) : VectorDescriptor<Value.Double> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import java.util.*
*/

data class FloatVectorDescriptor(
override val id: UUID = UUID.randomUUID(),
override val retrievableId: RetrievableId? = null,
override var id: UUID = UUID.randomUUID(),
override var retrievableId: RetrievableId? = null,
override val vector: List<Value.Float>,
override val field: Schema.Field<*, FloatVectorDescriptor>? = null
) : VectorDescriptor<Value.Float> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
*/

data class IntVectorDescriptor(
override val id: UUID = UUID.randomUUID(),
override val retrievableId: RetrievableId? = null,
override var id: UUID = UUID.randomUUID(),
override var retrievableId: RetrievableId? = null,
override val vector: List<Value.Int>,
override val field: Schema.Field<*, IntVectorDescriptor>? = null
) : VectorDescriptor<Value.Int> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
*/

data class LongVectorDescriptor(
override val id: UUID = UUID.randomUUID(),
override val retrievableId: RetrievableId? = null,
override var id: UUID = UUID.randomUUID(),
override var retrievableId: RetrievableId? = null,
override val vector: List<Value.Long>,
override val field: Schema.Field<*, LongVectorDescriptor>? = null
) : VectorDescriptor<Value.Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.vitrivr.engine.base.features.external.implementations
import org.vitrivr.engine.base.features.external.common.ApiWrapper
import org.vitrivr.engine.base.features.external.common.ExternalFesAnalyser
import org.vitrivr.engine.base.features.external.common.FesExtractor
import org.vitrivr.engine.base.features.fulltext.FulltextRetriever
import org.vitrivr.engine.core.context.IndexContext
import org.vitrivr.engine.core.context.QueryContext
import org.vitrivr.engine.core.model.content.Content
Expand All @@ -16,11 +15,15 @@ import org.vitrivr.engine.core.model.query.fulltext.SimpleFulltextQuery
import org.vitrivr.engine.core.model.retrievable.Retrievable
import org.vitrivr.engine.core.model.retrievable.RetrievableId
import org.vitrivr.engine.core.model.types.Value
import org.vitrivr.engine.core.model.types.Value.String as StringValue
import org.vitrivr.engine.core.operators.Operator
import org.vitrivr.engine.core.operators.ingest.Extractor
import org.vitrivr.engine.core.operators.retrieve.Retriever
import org.vitrivr.engine.module.features.feature.fulltext.FulltextRetriever
import java.util.*
import kotlin.IllegalArgumentException
import kotlin.String
import kotlin.require
import org.vitrivr.engine.core.model.types.Value.String as StringValue

/**
* Implementation of the [ASR] [ExternalFesAnalyser] that uses an external FES API to analyse audio content.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.vitrivr.engine.base.features.external.implementations

import org.vitrivr.engine.base.features.external.common.ApiWrapper
import org.vitrivr.engine.base.features.external.common.DenseRetriever
import org.vitrivr.engine.base.features.external.common.ExternalFesAnalyser
import org.vitrivr.engine.base.features.external.common.FesExtractor
import org.vitrivr.engine.core.context.IndexContext
Expand All @@ -19,6 +18,7 @@ import org.vitrivr.engine.core.model.types.Value
import org.vitrivr.engine.core.operators.Operator
import org.vitrivr.engine.core.operators.ingest.Extractor
import org.vitrivr.engine.core.operators.retrieve.Retriever
import org.vitrivr.engine.module.features.feature.external.common.DenseRetriever
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.vitrivr.engine.base.features.external.implementations
import org.vitrivr.engine.base.features.external.common.ApiWrapper
import org.vitrivr.engine.base.features.external.common.ExternalFesAnalyser
import org.vitrivr.engine.base.features.external.common.FesExtractor
import org.vitrivr.engine.base.features.fulltext.FulltextRetriever
import org.vitrivr.engine.core.context.IndexContext
import org.vitrivr.engine.core.context.QueryContext
import org.vitrivr.engine.core.model.content.element.ImageContent
Expand All @@ -18,6 +17,7 @@ import org.vitrivr.engine.core.model.types.Value
import org.vitrivr.engine.core.operators.Operator
import org.vitrivr.engine.core.operators.ingest.Extractor
import org.vitrivr.engine.core.operators.retrieve.Retriever
import org.vitrivr.engine.module.features.feature.fulltext.FulltextRetriever
import java.util.*


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package org.vitrivr.engine.base.features.external.implementations
import org.vitrivr.engine.base.features.external.common.ApiWrapper
import org.vitrivr.engine.base.features.external.common.ExternalFesAnalyser
import org.vitrivr.engine.base.features.external.common.FesExtractor
import org.vitrivr.engine.base.features.fulltext.FulltextRetriever
import org.vitrivr.engine.core.context.IndexContext
import org.vitrivr.engine.core.context.QueryContext
import org.vitrivr.engine.core.model.content.Content
import org.vitrivr.engine.core.model.content.element.ContentElement
import org.vitrivr.engine.core.model.content.element.ImageContent
import org.vitrivr.engine.core.model.content.element.TextContent
import org.vitrivr.engine.core.model.descriptor.scalar.StringDescriptor
Expand All @@ -20,6 +18,7 @@ import org.vitrivr.engine.core.model.types.Value
import org.vitrivr.engine.core.operators.Operator
import org.vitrivr.engine.core.operators.ingest.Extractor
import org.vitrivr.engine.core.operators.retrieve.Retriever
import org.vitrivr.engine.module.features.feature.fulltext.FulltextRetriever
import java.util.*

/**
Expand Down

1 comment on commit 0a176e7

@lucaro
Copy link
Member

@lucaro lucaro commented on 0a176e7 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this be variable?

Please sign in to comment.