Command Line wrapper for Proskomma Sofria
npm installThis client will create and populate the tables: tableContents and verses into a sqlite DB using a folder of USX files.
- The
tableContentstable will store data related to each book and the fields are:
tableContents(code, heading, title, name, chapters)- The
codefield is the Book Code - The
headingfield is thehtag that belongs USX file - The
titlefield is thetoctag that belongs USX file - The
namefield is the Book name ("toc2" tag) - The
chaptersfield is a string with each chapter that belongs to a specific book separated by commas e.g.1,2,3,4,...,23
- The
versestable will store data related to each verse for each book and the fields are:
verses(reference, verse_sequence, text)- The
referencefield is a string related to book code, chapter number and verse range e.g.ACT:13:38-39. The reference value has the following format:
BOOK_CODE:CHAPTER_NUMBER:VERSE_RANGE-
The
textfield is verse content. -
The
verse_sequencefield is a number column to guarantece that the verses records can be sorted correctly from biblebrain when it (biblebrain) pulls these records. Occasionally, a verse range is represented as NUMBER + Letter e.g. "3a" so, we need to separate the NUMBER to store it into an number column for sorting. This number will be stored intoverse_sequencefield
node sofria_mediaId.js Abidji_N2ABIWBT_USXUse two test cases:
- Spanish_N2SPNTLA_USX
# clean output folder:
rm -rf output/Spanish_N2SPNTLA_USX-json/*.*
# run sofria cli
node biblebrain_uploader.js run test/input/Spanish_N2SPNTLA_USX/ --generate-json=./output/Spanish_N2SPNTLA_USX-jsonThe above test should create 150 .json files
ls -1 output/Spanish_N2SPNTLA_USX-json/ | wc -l- Akawaio_N2AKEBSS_USX
# clean output folder:
rm -rf output/Akawaio_N2AKEBSS_USX-json/*.*
# run sofria cli
node biblebrain_uploader.js run test/input/Akawaio_N2AKEBSS_USX/ --generate-json=./output/Akawaio_N2AKEBSS_USX-jsonThe above test should create 28 .json files
ls -1 output/Akawaio_N2AKEBSS_USX-json/ | wc -l- ENGNKJO1ET
# clean output folder:
rm -rf output/ENGNKJO1ET-json/*.*
# run sofria cli
node biblebrain_uploader.js run test/input/ENGNKJO1ET/ --generate-json=./output/ENGNKJO1ET-jsonThe above test should create 200 .json files
ls -1 output/ENGNKJO1ET-json/ | wc -lnode tests/gqlquery_verses_by_usx.test.js# clean JSON output folder:
rm -rf output/Akawaio_N2AKEBSS_USX-json/*.*# clean output folder:
rm -rf ./output/Akawaio_N2AKEBSS_USX-db# create output folder:
mkdir ./output/Akawaio_N2AKEBSS_USX-db# create db file:
touch ./output/Akawaio_N2AKEBSS_USX-db/Akawaio_N2AKEBSS_USX.dbnode biblebrain_uploader.js run test/input/Akawaio_N2AKEBSS_USX/ --populate-db=./output/Akawaio_N2AKEBSS_USX-db/Akawaio_N2AKEBSS_USX.db --generate-json=./output/Akawaio_N2AKEBSS_USX-json- Outcome
Generate JSON filese - Start process..
Populate DB - Start process..
Complete: MAꞌSIU
success
File list (1) processing completed
Complete USX File: test/input/Akawaio_N2AKEBSS_USX/040MAT.usx
load verses success, rowcount 1069
load tableContents success, rowcount 1The above test should create 28 .json files as well
ls -1 output/Akawaio_N2AKEBSS_USX-json/ | wc -l# clean JSON output folder:
rm -rf output/TXQWYIN_ET-json/*.*# clean output folder:
rm -rf ./output/TXQWYIN1ET-db# create output folder:
mkdir ./output/TXQWYIN1ET-db# create db file:
touch ./output/TXQWYIN1ET-db/TXQWYIN1ET.dbnode biblebrain_uploader.js run test/input/TXQWYIN1ET/ --populate-db=./output/TXQWYIN1ET-db/TXQWYIN_ET.db --generate-json=./output/TXQWYIN_ET-json- Outcome
Generate JSON => Generate JSON filese - Start process..
Populate DB - Start process..
Populate DB => Complete: Markus
Populate DB => success
Generate JSON => File list (1) processing completed
Generate JSON => Complete USX File: test/input/TXQWYIN1ET/041MRK.usx
load verses success, rowcount 634
load tableContents success, rowcount 1The above test should create 16 .json files as well
ls -1 output/TXQWYIN_ET-json/ | wc -l# clean JSON output folder:
rm -rf ./output/SPNBDAO_ET-json/*.*# clean output folder:
rm -rf ./output/SPNBDAO_ET-db# create output folder:
mkdir ./output/SPNBDAO_ET-db# create db file:
touch ./output/SPNBDAO_ET-db/SPNBDAO_ET.dbnode biblebrain_uploader.js run test/input/Spanish_N2SPNBDA_USX/ --populate-db=./output/SPNBDAO_ET-db/SPNBDAO_ET.db --generate-json=./output/SPNBDAO_ET-json --missing-verses-allowed="{ \"MAT\": { \"17\" : [21], \"18\" : [11], \"23\" : [14] } }"- Outcome
Generate JSON => Generate JSON filese - Start process..
Populate DB - Start process..
Populate DB => Complete: Mateo
Populate DB => success
Generate JSON => File list (1) processing completed
Generate JSON => Complete USX File: test/input/Spanish_N2SPNBDA_USX/040MAT.usx
load verses success, rowcount 1068
load tableContents success, rowcount 1The above test should create 28 .json files as well
ls -1 output/SPNBDAO_ET-json/ | wc -l- Execute prettier command before each commit
./node_modules/.bin/prettier --write "./**/*.{js,jsx,ts,tsx,md}"