Commit 8cc100aa authored by Quentin David's avatar Quentin David
Browse files

Update to Models

parent 7a4a3fc6
......@@ -15,6 +15,7 @@ pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.code-workspace
*.suo
*.ntvs*
*.njsproj
......
......@@ -13,35 +13,67 @@ const Schema = mongoose.Schema;
/* Should there be documentId or corpusId? */
const OutputSchema = new Schema({
processId: { type: String, required: true},
content: { type: String, required: true}
moduleName: { type: String, required: true}, // Can be built from processId
content: {
title: { type: String },
description: { type: String },
data: { type: String, required: true}
}
});
// An annotation is the conjunction of a module and a document.
// It must contains all the informations needed for the visualisation tool to work.
const AnnotationSchema = new Schema({
documentId: { type: String, required: true},
documentId: { type: String, required: true}, // Needed ?
processId: { type: String, required: true},
content: { type: String },
colour: { type: String }
moduleName: { type: String, required: true}, // Can be built from processId
content: {
title: { type: String },
description: { type: String },
data: { type: String, required: true}
},
color: { type: String }
})
// Documents are build at the end of the pipeline
// It contains the source text and
// the annotations added by a pipeline
const DocumentSchema = new Schema({
corpusId: { type: String, required: true},
corpusId: { type: String, required: true}, // Needed ?
source: { type: String },
annotations: { type: [AnnotationSchema] }
})
// The content of a column with ConLLU-Plus style, each row corresponding to a token.
const ConLLuColumnSchema = new Schema({
columnId: {type: String }, // Needed ?
columnTitle: { type: String, required: true},
columnData: { type: String, required: true}
})
const MetadataSchema = new Schema({
author: {type: String },
title: {type: String },
description: {type: String },
date: {type: String },
type: {type: String },
size: {type: String },
userMetadata: [{
name: {type: String },
value: {type: String }
}]
})
// A corpus is composed of those attributes
const CorpusSchema = new Schema({
corpus_name: { type: String},
conllu: { type: String}, // ConLLu annotation file
corpusId: { type: String},
pipelineId: { type: String }, // What happens if there is two pipeline
conlluColumns: { type: [ConLLuColumnSchema]},
outputs: { type: [OutputSchema]},
documents: [{content: String}],
created_by: { type: String},
metadata: [{name: String, value: String}]
documents: { type: [DocumentSchema]},
createdBy: { type: String}, // userId or public
creationDate : { type: String },
metadata: { type: MetadataSchema }
});
// Let's compile as a model
const CorpusModel = mongoose.model('CorpusModel', CorpusSchema);
......
......@@ -10,17 +10,26 @@ const Schema = mongoose.Schema;
/* Should it contains corpusId? */
const ProcessSchema = new Schema({
moduleName: { type: String, required: true},
moduleParameter: { type: [{name: String, value: String}] }
moduleParameter: {
type:
[{
name: String,
value: String
}],
required: true
}
})
// A pipeline contains the instruction to apply one or several
// modules to a corpus.
const PipelineSchema = new Schema({
corpusId: String,
currentProcessingModule: String, // What module is currently processing the corpus?
corpusId: { type: String, required: true },
currentProcessingModule: { type: String }, // What module is currently processing the corpus?
status: {
type: String,
enum: ['Not started yet', 'Started', 'Finished', 'Failed']
},
processes: { type: [ProcessSchema] }
processes: { type: [ProcessSchema] , required: true},
creationDate: { type: String },
description: { type: String }
})
\ No newline at end of file
......@@ -10,13 +10,16 @@ const Schema = mongoose.Schema;
const UserSchema = new Schema({
name: { type: String},
mail: { type: String},
password: { type: String },
status: {
type: String,
enum: ['User','Admin']
},
password: { type: String },
profileCorpora: {type: [{ corpusId: String }]},
pipelines: { type: [{pipelineId: String, status: String}]},
config: {
sendMailWhenPipelineFinished: { type: Boolean, default: true}
}
});
// Let's compile as a model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment