diff --git a/src/schema/meta/context.yaml b/src/schema/meta/context.yaml index 8783b46371..5f120d877e 100644 --- a/src/schema/meta/context.yaml +++ b/src/schema/meta/context.yaml @@ -67,20 +67,20 @@ properties: description: 'Collections of subjects in dataset' type: object required: - - sub_dirs + - dirs additionalProperties: false properties: - sub_dirs: + dirs: description: 'Subjects as determined by sub-* directories' type: array items: type: string - participant_id: + ids: description: 'The participant_id column of participants.tsv' type: array items: type: string - phenotype: + ids_phenotype: description: 'The union of participant_id columns in phenotype files' type: array items: @@ -96,20 +96,20 @@ properties: description: 'Collections of sessions in subject' type: object required: - - ses_dirs + - dirs additionalProperties: false properties: - ses_dirs: + dirs: description: 'Sessions as determined by ses-* directories' type: array items: type: string - session_id: + ids: description: 'The session_id column of sessions.tsv' type: array items: type: string - phenotype: + ids_phenotype: description: 'The union of session_id columns in phenotype files' type: array items: diff --git a/src/schema/rules/checks/dataset.yaml b/src/schema/rules/checks/dataset.yaml index 69444aed9e..79c2956dbc 100644 --- a/src/schema/rules/checks/dataset.yaml +++ b/src/schema/rules/checks/dataset.yaml @@ -11,7 +11,7 @@ SubjectFolders: selectors: - path == '/dataset_description.json' checks: - - length(dataset.subjects.sub_dirs) > 0 + - length(dataset.subjects.dirs) > 0 # 49 ParticipantIDMismatch: @@ -24,7 +24,7 @@ ParticipantIDMismatch: selectors: - path == '/participants.tsv' checks: - - allequal(sorted(columns.participant_id), sorted(dataset.subjects.sub_dirs)) + - allequal(sorted(columns.participant_id), sorted(dataset.subjects.dirs)) # 51 PhenotypeSubjectsMissing: @@ -35,9 +35,9 @@ PhenotypeSubjectsMissing: level: error selectors: - path == '/dataset_description.json' - - type(dataset.subjects.phenotype) != 'null' + - type(dataset.subjects.ids_phenotype) != 'null' checks: - - allequal(sorted(dataset.subjects.phenotype), sorted(dataset.subjects.sub_dirs)) + - allequal(sorted(dataset.subjects.ids_phenotype), sorted(dataset.subjects.dirs)) # 214 SamplesTSVMissing: diff --git a/tools/typescript/generate.test.ts b/tools/typescript/generate.test.ts index dc9342f7f3..296c14c07a 100644 --- a/tools/typescript/generate.test.ts +++ b/tools/typescript/generate.test.ts @@ -53,14 +53,14 @@ Deno.test('generateTypes() supports generic array type', () => { Deno.test('generateTypes() supports typed array type', () => { const file = createSourceFile('test.ts') file.statements = generateTypes({ - sub_dirs: { + dirs: { description: 'Subjects as determined by sub-*/ directories', type: 'array', items: { type: 'string' }, }, }) - assertEquals(print(file), 'sub_dirs: string[];\n') + assertEquals(print(file), 'dirs: string[];\n') }) // Object without defined properties @@ -134,7 +134,7 @@ Deno.test('generateTypes() supports object trees', () => { description: 'Collections of subjects in dataset', type: 'object', properties: { - sub_dirs: { + dirs: { description: 'Subjects as determined by sub-*/ directories', type: 'array', items: { type: 'string' }, @@ -148,7 +148,7 @@ Deno.test('generateTypes() supports object trees', () => { assertEquals( print(file), `export interface DatasetSubjects { - sub_dirs: string[]; + dirs: string[]; } export interface Dataset { dataset_description: object;