Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jorge Garcia flores
ChêneTAL
Commits
8cc100aa
Commit
8cc100aa
authored
Oct 05, 2020
by
Quentin David
Browse files
Update to Models
parent
7a4a3fc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
8cc100aa
...
...
@@ -15,6 +15,7 @@ pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.code-workspace
*.suo
*.ntvs*
*.njsproj
...
...
server/models/Corpus.js
View file @
8cc100aa
...
...
@@ -12,36 +12,68 @@ const Schema = mongoose.Schema;
// Can be a text file or something else like a model.
/* Should there be documentId or corpusId? */
const
OutputSchema
=
new
Schema
({
processId
:
{
type
:
String
,
required
:
true
},
content
:
{
type
:
String
,
required
:
true
}
processId
:
{
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
},
processId
:
{
type
:
String
,
required
:
true
},
content
:
{
type
:
String
},
colour
:
{
type
:
String
}
documentId
:
{
type
:
String
,
required
:
true
},
// Needed ?
processId
:
{
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
}
},
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
},
source
:
{
type
:
String
},
annotations
:
{
type
:
[
AnnotationSchema
]
}
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
outputs
:
{
type
:
[
OutputSchema
]},
documents
:
[{
content
:
String
}],
created_by
:
{
type
:
String
},
metadata
:
[{
name
:
String
,
value
:
String
}]
corpusId
:
{
type
:
String
},
pipelineId
:
{
type
:
String
},
// What happens if there is two pipeline
conlluColumns
:
{
type
:
[
ConLLuColumnSchema
]},
outputs
:
{
type
:
[
OutputSchema
]},
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
);
...
...
server/models/Pipeline.js
View file @
8cc100aa
...
...
@@ -9,18 +9,27 @@ const Schema = mongoose.Schema;
// A process contains the information needed for a module to be executed
/* Should it contains corpusId? */
const
ProcessSchema
=
new
Schema
({
moduleName
:
{
type
:
String
,
required
:
true
},
moduleParameter
:
{
type
:
[{
name
:
String
,
value
:
String
}]
}
moduleName
:
{
type
:
String
,
required
:
true
},
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?
status
:
{
type
:
String
,
enum
:
[
'
Not started yet
'
,
'
Started
'
,
'
Finished
'
,
'
Failed
'
]
},
processes
:
{
type
:
[
ProcessSchema
]
}
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
]
,
required
:
true
},
creationDate
:
{
type
:
String
},
description
:
{
type
:
String
}
})
\ No newline at end of file
server/models/User.js
View file @
8cc100aa
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment