feat(db): add incremental upsert seed script for WordNet vocabulary
Implements packages/db/src/seed.ts — reads all JSON files from scripts/datafiles/, validates filenames against supported language codes and POS, and upserts synsets into and via onConflictDoNothing. Safe to re-run; produces 0 writes on a duplicate run.
This commit is contained in:
parent
55885336ba
commit
2b177aad5b
12 changed files with 1349 additions and 10 deletions
36
scripts/datafiles/test.json
Normal file
36
scripts/datafiles/test.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[
|
||||
{
|
||||
"synset_id": "ili:i35545",
|
||||
"pos": "noun",
|
||||
"translations": { "en": ["entity"], "it": ["cosa", "entità"] }
|
||||
},
|
||||
{
|
||||
"synset_id": "ili:i35547",
|
||||
"pos": "noun",
|
||||
"translations": {
|
||||
"en": ["abstraction", "abstract entity"],
|
||||
"it": ["astrazione"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"synset_id": "ili:i35549",
|
||||
"pos": "noun",
|
||||
"translations": {
|
||||
"en": ["object", "physical object"],
|
||||
"it": ["oggetto", "cosa"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"synset_id": "ili:i35550",
|
||||
"pos": "noun",
|
||||
"translations": { "en": ["whole", "unit"], "it": ["insieme", "tutto"] }
|
||||
},
|
||||
{
|
||||
"synset_id": "ili:i35553",
|
||||
"pos": "noun",
|
||||
"translations": {
|
||||
"en": ["organism", "being"],
|
||||
"it": ["essere vivente", "organismo", "organismo vivente"]
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue