Skip to content

Commit

Permalink
Changed schema to a named block approach
Browse files Browse the repository at this point in the history
  • Loading branch information
v0idness committed Aug 5, 2024
1 parent 74ebaa8 commit cee071b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
27 changes: 18 additions & 9 deletions config-schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"schemas": [
{
"name": "vitrivr",
"schemas": {
"vitrivr": {
"connection": {
"database": "CottontailConnectionProvider",
"parameters": {
Expand All @@ -10,10 +9,18 @@
}
},
"fields": {
"averagecolor": { "factory": "AverageColor" },
"file": { "factory": "FileSourceMetadata" },
"time": { "factory": "TemporalMetadata" },
"video": { "factory": "VideoSourceMetadata" }
"averagecolor": {
"factory": "AverageColor"
},
"file": {
"factory": "FileSourceMetadata"
},
"time": {
"factory": "TemporalMetadata"
},
"video": {
"factory": "VideoSourceMetadata"
}
},
"resolvers": {
"disk": {
Expand Down Expand Up @@ -43,8 +50,10 @@
}
},
"extractionPipelines": {
"ingestion": { "path": "./config-ingestion.json" }
"ingestion": {
"path": "./config-ingestion.json"
}
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import java.nio.file.Paths
@Serializable
data class SchemaConfig(
/** Name of the [Schema]. */
val name: String = "vitrivr",
var name: String = "vitrivr",

/** The (database) [ConnectionConfig] for this [SchemaConfig]. */
val connection: ConnectionConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ fun main(args: Array<String>) {

/* Setup schema manager. */
val manager = SchemaManager()
for (schema in config.schemas) {
for ((name, schema) in config.schemas) {
schema.name = name
manager.load(schema)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data class ServerConfig(
val api: ApiConfig = ApiConfig(),

/** List of [SchemaConfig] managed by this [ServerConfig]. */
val schemas: List<SchemaConfig>
val schemas: Map<String, SchemaConfig>
) {
companion object {
/** Default path to fall back to. */
Expand Down

0 comments on commit cee071b

Please sign in to comment.