Skip to content

Commit

Permalink
RF: Convert column description into a common definition
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 3, 2023
1 parent efd5e76 commit 4b1b882
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 137 deletions.
69 changes: 68 additions & 1 deletion bids-validator/validators/json/schemas/common_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
]
}
}
}
}
}
72 changes: 1 addition & 71 deletions bids-validator/validators/json/schemas/data_dictionary.json
Original file line number Diff line number Diff line change
@@ -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" }
}
}
66 changes: 1 addition & 65 deletions bids-validator/validators/json/schemas/events.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 4b1b882

Please sign in to comment.