Commit 58bb7511 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add support of DDI Codebook 2.5.

parent 30625761
......@@ -106,14 +106,15 @@ npx babel-node --extensions ".ts" -- src/scripts/index_words.ts
In `data-catalogue` directory:
```bash
npx babel-node --extensions ".ts" --max-old-space-size=10240 src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ ../public_data/cdsp-ddi/ ../public_data/ined-ddi/
npx babel-node --extensions ".ts" --max-old-space-size=10240 -- src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ ../public_data/cdsp-ddi/ ../public_data/ined-ddi/ ../public_data/sciences-po-ddi/
npx babel-node --extensions ".ts" --max-old-space-size=10240 -- src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ ../public_data/cdsp-ddi/ ../public_data/ined-ddi/ --version=1.2.2
npx babel-node --extensions ".ts" -- src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ ../public_data/cdsp-ddi/ ../public_data/ined-ddi/ --version=1.3
npx babel-node --extensions ".ts" -- src/scripts/raw_types_from_ddi_files.ts ../public_data/sciences-po-ddi/ --version=2.5
npx babel-node --extensions ".ts" --max-old-space-size=8192 src/scripts/raw_types_from_ddi_files.ts ../public_data/xml-ddi-adisp/ --target=src/raw_types/enquetes_adisp_fournies.ts
npx babel-node --extensions ".ts" --max-old-space-size=8192 src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ --target=src/raw_types/enquetes_adisp.ts
npx babel-node --extensions ".ts" src/scripts/raw_types_from_ddi_files.ts ../public_data/cdsp-ddi/ --target=src/raw_types/enquetes_cdsp.ts
npx babel-node --extensions ".ts" src/scripts/raw_types_from_ddi_files.ts ../public_data/ined-ddi/ --target=src/raw_types/enquetes_ined.ts
npx babel-node --extensions ".ts" --max-old-space-size=8192 -- src/scripts/raw_types_from_ddi_files.ts ../public_data/xml-ddi-adisp/ --target=src/raw_types/enquetes_adisp_fournies.ts
npx babel-node --extensions ".ts" --max-old-space-size=8192 -- src/scripts/raw_types_from_ddi_files.ts ../public_data/adisp-ddi/ --target=src/raw_types/enquetes_adisp.ts
npx babel-node --extensions ".ts" -- src/scripts/raw_types_from_ddi_files.ts ../public_data/cdsp-ddi/ --target=src/raw_types/enquetes_cdsp.ts
npx babel-node --extensions ".ts" -- src/scripts/raw_types_from_ddi_files.ts ../public_data/ined-ddi/ --target=src/raw_types/enquetes_ined.ts
# Prettify generated TypeScript files:
npm run prettier
......
......@@ -88,7 +88,11 @@ export function* iterProducers(
export function* iterStudyKeywords(
codeBook: CodeBook,
): Generator<string, void, void> {
for (const keyword of codeBook.stdyDscr.stdyInfo.subject?.keyword ?? []) {
let keywords = codeBook.stdyDscr.stdyInfo.subject?.keyword ?? []
if (!Array.isArray(keywords)) {
keywords = [keywords]
}
for (const keyword of keywords) {
const label =
typeof keyword === "number"
? keyword.toString()
......
This diff is collapsed.
This diff is collapsed.
......@@ -93,7 +93,7 @@ export function auditCommandLineOptions(audit: Audit, data: any): [any, any] {
errors,
remainingKeys,
auditTrimString,
auditOptions(["1.2.2", "1.3"]),
auditOptions(["1.2.2", "1.3", "2.5"]),
)
audit.attribute(
data,
......
Supports Markdown
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