From 0afce3c68a03820fd5653f72fbfb39db9dd7f1af Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 20 Sep 2024 09:11:55 -0400 Subject: [PATCH 1/9] Allow plus signs in labels. --- src/schema/objects/formats.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/schema/objects/formats.yaml b/src/schema/objects/formats.yaml index 7de4345b2d..be09e790e7 100644 --- a/src/schema/objects/formats.yaml +++ b/src/schema/objects/formats.yaml @@ -10,7 +10,8 @@ label: display_name: Label description: | Freeform labels without special characters. - pattern: '[0-9a-zA-Z]+' + Plus signs (+) are allowed, typically used to separate labels. + pattern: '[0-9a-zA-Z+]+' # Metadata types boolean: display_name: Boolean From e32984cf9e68da77483be8277ed95e58eb425326 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 20 Sep 2024 09:18:03 -0400 Subject: [PATCH 2/9] Update test_rules.py --- tools/schemacode/bidsschematools/tests/test_rules.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/schemacode/bidsschematools/tests/test_rules.py b/tools/schemacode/bidsschematools/tests/test_rules.py index ca2c5b920e..126db3c69d 100644 --- a/tools/schemacode/bidsschematools/tests/test_rules.py +++ b/tools/schemacode/bidsschematools/tests/test_rules.py @@ -18,8 +18,8 @@ def test_entity_rule(schema_obj): nii_rule = rules._entity_rule(rule, schema_obj) assert nii_rule == { "regex": ( - r"sub-(?P[0-9a-zA-Z]+)/" - r"(?:ses-(?P[0-9a-zA-Z]+)/)?" + r"sub-(?P[0-9a-zA-Z+]+)/" + r"(?:ses-(?P[0-9a-zA-Z+]+)/)?" r"(?Panat)/" r"(?(subject)sub-(?P=subject)_)" r"(?(session)ses-(?P=session)_)" @@ -50,8 +50,8 @@ def test_entity_rule(schema_obj): json_rule = rules._entity_rule(rule, schema_obj) assert json_rule == { "regex": ( - r"(?:sub-(?P[0-9a-zA-Z]+)/)?" - r"(?:ses-(?P[0-9a-zA-Z]+)/)?" + r"(?:sub-(?P[0-9a-zA-Z+]+)/)?" + r"(?:ses-(?P[0-9a-zA-Z+]+)/)?" r"(?:(?Panat)/)?" r"(?(subject)sub-(?P=subject)_)" r"(?(session)ses-(?P=session)_)" From 97de148a586652e6dd615adf979bfd33a3257459 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 20 Sep 2024 09:26:20 -0400 Subject: [PATCH 3/9] Remove self from CODEOWNERS. --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 54d256bb49..fff5d95928 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,5 +16,5 @@ /src/derivatives/diffusion-derivatives.md @francopestilli @oesteban @Lestropie # The schema -/src/schema/ @tsalo @erdalkaraca -/tools/schemacode/ @tsalo @erdalkaraca +/src/schema/ @erdalkaraca +/tools/schemacode/ @erdalkaraca From 8400bc62337bf9e11c9133f5bc18a703d30f7ddd Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 20 Sep 2024 10:03:58 -0400 Subject: [PATCH 4/9] Update formats.yaml --- src/schema/objects/formats.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/schema/objects/formats.yaml b/src/schema/objects/formats.yaml index be09e790e7..68c5bfb4f2 100644 --- a/src/schema/objects/formats.yaml +++ b/src/schema/objects/formats.yaml @@ -9,8 +9,12 @@ index: label: display_name: Label description: | - Freeform labels without special characters. - Plus signs (+) are allowed, typically used to separate labels. + Free-form labels with alphanumeric and plus (+) characters. + + Plus signs MAY be used to concatenate multiple applicable labels, + but no relationship is established by a partial match. + In particular, the inheritance principle does not connect files + containing "ent-X+Y" and "ent-X" or "ent-Y". pattern: '[0-9a-zA-Z+]+' # Metadata types boolean: From a950d0810db5b1356fbab6d34d55826e1589298b Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Mon, 23 Sep 2024 11:05:39 -0400 Subject: [PATCH 5/9] Update src/schema/objects/formats.yaml Co-authored-by: Chris Markiewicz --- src/schema/objects/formats.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/schema/objects/formats.yaml b/src/schema/objects/formats.yaml index 68c5bfb4f2..b49da3d16b 100644 --- a/src/schema/objects/formats.yaml +++ b/src/schema/objects/formats.yaml @@ -14,7 +14,10 @@ label: Plus signs MAY be used to concatenate multiple applicable labels, but no relationship is established by a partial match. In particular, the inheritance principle does not connect files - containing "ent-X+Y" and "ent-X" or "ent-Y". + containing entities such as `-x+y` with either `-x` or `-y`. + For example, metadata stored in a file at the root of the dataset with name `/acq-6p_T2w.json` + does not apply to files with partially matching "acquisition" entity values + such as `/sub-1/anat/sub-1_acq-6p+s2_T2w.nii`. pattern: '[0-9a-zA-Z+]+' # Metadata types boolean: From 7ba5e3900b6bd69b63bfb6b9381bb6c6a85600ba Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 23 Sep 2024 11:20:16 -0400 Subject: [PATCH 6/9] [DATALAD RUNCMD] Replace more of label regexes present in various spots to gain + === Do not change lines below === { "chain": [], "cmd": "git-sedi '\\[0-9a-zA-Z\\]' '[0-9a-zA-Z+]'", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- src/schema/objects/columns.yaml | 10 ++++---- src/schema/objects/metadata.yaml | 2 +- .../data/expected_bids_validator_xs_write.log | 2 +- .../bidsschematools/tests/test_validator.py | 24 +++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/schema/objects/columns.yaml b/src/schema/objects/columns.yaml index cb02045e80..98988360ac 100644 --- a/src/schema/objects/columns.yaml +++ b/src/schema/objects/columns.yaml @@ -110,7 +110,7 @@ derived_from: `sample-