From 7f63953f6b9b84aeb811352d1d1b03eb514ff3e7 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 1 Aug 2024 23:25:11 -0400 Subject: [PATCH 1/4] fix(metaschema): Require issues for checks --- src/metaschema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metaschema.json b/src/metaschema.json index c0462edcaf..f6e5a62d25 100644 --- a/src/metaschema.json +++ b/src/metaschema.json @@ -315,7 +315,7 @@ "$ref": "#/definitions/ruleTypes/expressionList" } }, - "required": ["checks", "selectors"], + "required": ["checks", "selectors", "issue"], "additionalProperties": false } } From e23714770c88590fffdb699eca599e3dd84d127d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 1 Aug 2024 23:26:07 -0400 Subject: [PATCH 2/4] fix(schema): Add issues for file reference checks --- src/schema/rules/checks/references.yaml | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/schema/rules/checks/references.yaml b/src/schema/rules/checks/references.yaml index b0f1dd6e9d..191dcb6d4f 100644 --- a/src/schema/rules/checks/references.yaml +++ b/src/schema/rules/checks/references.yaml @@ -1,5 +1,11 @@ --- SubjectRelativeIntendedForString: + issue: + code: INTENDED_FOR + message: | + 'IntendedFor' field needs to point to an existing file. + Files must be subject-relative paths or BIDS URIs. + level: error selectors: - datatype != "ieeg" - type(sidecar.IntendedFor) == "string" @@ -7,6 +13,12 @@ SubjectRelativeIntendedForString: - exists(sidecar.IntendedFor, "bids-uri") + exists(sidecar.IntendedFor, "subject") == 1 SubjectRelativeIntendedForArray: + issue: + code: INTENDED_FOR + message: | + 'IntendedFor' field needs to point to an existing file. + Files must be subject-relative paths or BIDS URIs. + level: error selectors: - datatype != "ieeg" - type(sidecar.IntendedFor) == "array" @@ -14,6 +26,12 @@ SubjectRelativeIntendedForArray: - exists(sidecar.IntendedFor, "bids-uri") + exists(sidecar.IntendedFor, "subject") == length(sidecar.IntendedFor) DatasetRelativeIntendedForString: + issue: + code: INTENDED_FOR + message: | + 'IntendedFor' field needs to point to an existing file. + Files must be dataset-relative paths or BIDS URIs. + level: error selectors: - datatype == "ieeg" - type(sidecar.IntendedFor) == "string" @@ -21,6 +39,12 @@ DatasetRelativeIntendedForString: - exists(sidecar.IntendedFor, "bids-uri") + exists(sidecar.IntendedFor, "dataset") == 1 DatasetRelativeIntendedForArray: + issue: + code: INTENDED_FOR + message: | + 'IntendedFor' field needs to point to an existing file. + Files must be dataset-relative paths or BIDS URIs. + level: error selectors: - datatype == "ieeg" - type(sidecar.IntendedFor) == "array" @@ -28,6 +52,12 @@ DatasetRelativeIntendedForArray: - exists(sidecar.IntendedFor, "bids-uri") + exists(sidecar.IntendedFor, "dataset") == length(sidecar.IntendedFor) AssociatedEmptyRoomString: + issue: + code: ASSOCIATED_EMPTY_ROOM + message: | + 'AssociatedEmptyRoom' field needs to point to an existing file. + Files must be dataset-relative paths or BIDS URIs. + level: error selectors: - datatype == "meg" - type(sidecar.AssociatedEmptyRoom) == "string" @@ -35,6 +65,12 @@ AssociatedEmptyRoomString: - exists(sidecar.AssociatedEmptyRoom, "bids-uri") + exists(sidecar.AssociatedEmptyRoom, "dataset") == 1 AssociatedEmptyRoomArray: + issue: + code: ASSOCIATED_EMPTY_ROOM + message: | + 'AssociatedEmptyRoom' field needs to point to an existing file. + Files must be dataset-relative paths or BIDS URIs. + level: error selectors: - datatype == "meg" - type(sidecar.AssociatedEmptyRoom) == "array" @@ -44,6 +80,12 @@ AssociatedEmptyRoomArray: == length(sidecar.AssociatedEmptyRoom) Sources: + issue: + code: SOURCE_FILE_EXIST + message: | + 'Sources' field needs to point to existing files. + Files must be dataset-relative paths or BIDS URIs. + level: error selectors: - dataset.dataset_description.DatasetType == "derivatives" - type(sidecar.Sources) != "null" From c5cb8eed6ef6179cc239a960d0fdf20f5c0d02f1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 1 Aug 2024 23:47:19 -0400 Subject: [PATCH 3/4] fix(schema): Add issues for resolution/density object checks --- src/schema/rules/checks/common_derivatives.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/schema/rules/checks/common_derivatives.yaml b/src/schema/rules/checks/common_derivatives.yaml index 723ddf0e59..6d9cd2eda7 100644 --- a/src/schema/rules/checks/common_derivatives.yaml +++ b/src/schema/rules/checks/common_derivatives.yaml @@ -1,18 +1,32 @@ --- ResInSidecar: + issue: + code: MISSING_RESOLUTION_DESCRIPTION + message: | + The Resolution metadata object does not contain an entry for the file's + res-