From 4b1b8820c221ab630114464eb63b00d8b67e9fca Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 3 Nov 2023 08:15:40 -0400 Subject: [PATCH] RF: Convert column description into a common definition --- .../json/schemas/common_definitions.json | 69 +++++++++++++++++- .../json/schemas/data_dictionary.json | 72 +------------------ .../validators/json/schemas/events.json | 66 +---------------- 3 files changed, 70 insertions(+), 137 deletions(-) diff --git a/bids-validator/validators/json/schemas/common_definitions.json b/bids-validator/validators/json/schemas/common_definitions.json index ad0e9bf40..5980ca3c2 100644 --- a/bids-validator/validators/json/schemas/common_definitions.json +++ b/bids-validator/validators/json/schemas/common_definitions.json @@ -122,6 +122,73 @@ "SoftwareVersions": { "type": "string" }, "TaskDescription": { "type": "string" }, "TaskName": { "type": "string", "minLength": 1 }, - "TriggerChannelCount": { "type": "integer", "minimum": 0 } + "TermURL": { + "title": "TermURL", + "description": "URL pointing to a formal definition in an ontology available on the web.", + "type": "string", + "format": "uri" + }, + "TriggerChannelCount": { "type": "integer", "minimum": 0 }, + "ColumnDescription": { + "type": "object", + "title": "Column", + "description": "Column of a corresponding tabular file.", + "properties": { + "LongName": { + "title": "LongName", + "description": " Long (unabbreviated) name of column.", + "type": "string" + }, + "Description": { + "title": "Description", + "description": "Description of the column.", + "type": "string" + }, + "Units": { + "title": "Units", + "description": "Measurement units.", + "type": "string" + }, + "Levels": { + "type": "object", + "title": "Levels", + "description": "For categorical variables: a dictionary of possible values (keys) and their descriptions (values).", + "patternProperties": { + "^.+$": { + "anyOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "Description": { "type": "string" }, + "TermURL": { "$ref": "#/definitions/TermURL" } + } + } + ] + } + } + }, + "TermURL": { "$ref": "#/definitions/TermURL" }, + "HED": { + "anyOf": [ + { + "type": "object", + "title": "HED", + "description": "For categorical variables: a dictionary of possible values (keys) and their HED strings (values).", + "patternProperties": { + "^.+$": { + "type": "string" + } + } + }, + { + "type": "string", + "title": "HED", + "description": "For value variables: a string with a single '#' character where the cell value is to be interpolated." + } + ] + } + } + } } } diff --git a/bids-validator/validators/json/schemas/data_dictionary.json b/bids-validator/validators/json/schemas/data_dictionary.json index 75322abac..f3bfc1921 100644 --- a/bids-validator/validators/json/schemas/data_dictionary.json +++ b/bids-validator/validators/json/schemas/data_dictionary.json @@ -1,76 +1,6 @@ { "type": "object", "patternProperties": { - "^.+$": { - "type": "object", - "title": "Column", - "description": "Column of a corresponding tabular file.", - "properties": { - "LongName": { - "title": "LongName", - "description": " Long (unabbreviated) name of column.", - "type": "string" - }, - "Description": { - "title": "Description", - "description": "Description of the column.", - "type": "string" - }, - "Units": { - "title": "Units", - "description": "Measurement units.", - "type": "string" - }, - "Levels": { - "type": "object", - "title": "Levels", - "description": "For categorical variables: a dictionary of possible values (keys) and their descriptions (values).", - "patternProperties": { - "^.+$": { - "anyOf": [ - { "type": "string" }, - { - "type": "object", - "properties": { - "Description": { "type": "string" }, - "TermURL": { - "title": "TermURL", - "description": "URL pointing to a formal definition in an ontology available on the web.", - "type": "string", - "format": "uri" - } - } - } - ] - } - } - }, - "TermURL": { - "title": "TermURL", - "description": "URL pointing to a formal definition in an ontology available on the web.", - "type": "string", - "format": "uri" - }, - "HED": { - "anyOf": [ - { - "type": "object", - "title": "HED", - "description": "For categorical variables: a dictionary of possible values (keys) and their HED strings (values).", - "patternProperties": { - "^.+$": { - "type": "string" - } - } - }, - { - "type": "string", - "title": "HED", - "description": "For value variables: a string with a single '#' character where the cell value is to be interpolated." - } - ] - } - } - } + "^.+$": { "$ref": "common_definitions.json#/definitions/ColumnDescription" } } } diff --git a/bids-validator/validators/json/schemas/events.json b/bids-validator/validators/json/schemas/events.json index 73d27e47d..bace2aa3a 100644 --- a/bids-validator/validators/json/schemas/events.json +++ b/bids-validator/validators/json/schemas/events.json @@ -1,71 +1,7 @@ { "type": "object", "patternProperties": { - "^.+$": { - "type": "object", - "title": "Column", - "description": "Column of a corresponding tabular file.", - "properties": { - "LongName": { - "title": "LongName", - "description": " Long (unabbreviated) name of column.", - "type": "string" - }, - "Description": { - "title": "Description", - "description": "Description of the column.", - "type": "string" - }, - "Units": { - "title": "Units", - "description": "Measurement units.", - "type": "string" - }, - "Levels": { - "type": "object", - "title": "Levels", - "description": "For categorical variables: a dictionary of possible values (keys) and their descriptions (values).", - "patternProperties": { - "^.+$": { - "anyOf": [ - { "type": "string" }, - { - "type": "object", - "properties": { - "Description": { "type": "string" }, - "TermURL": { - "title": "TermURL", - "description": "URL pointing to a formal definition in an ontology available on the web.", - "type": "string", - "format": "uri" - } - } - } - ] - } - } - }, - "HED": { - "anyOf": [ - { - "type": "object", - "title": "HED", - "description": "For categorical variables: a dictionary of possible values (keys) and their HED strings (values).", - "patternProperties": { - "^.+$": { - "type": "string" - } - } - }, - { - "type": "string", - "title": "HED", - "description": "For value variables: a string with a single '#' character where the cell value is to be interpolated." - } - ] - } - } - } + "^.+$": { "$ref": "common_definitions.json#/definitions/ColumnDescription" } }, "properties": { "StimulusPresentation": {