Add Frictionless Data Table Schema for libBIDS.sh output#26
Conversation
Define a comprehensive table_schema.json following the Frictionless Data Table Schema specification, enriched with metadata from the official BIDS schema (bids-standard/bids-schema). Includes titles, descriptions, format annotations (label/index), and constraints (enum, pattern, required, unique) for all 36 output fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
table_schema.json (2)
8-14: Consider adding pattern constraint forderivatives.The
derivativesfield currently has no pattern constraint. For consistency with other label-type fields and to ensure valid pipeline names, consider adding an alphanumeric pattern constraint.📋 Proposed enhancement
{ "name": "derivatives", "title": "Derivative Pipeline", "type": "string", - "description": "Pipeline name extracted from the derivatives/ folder path. NA if the file is not in a derivatives directory." + "description": "Pipeline name extracted from the derivatives/ folder path. NA if the file is not in a derivatives directory.", + "constraints": { + "pattern": "^[a-zA-Z0-9]+$" + } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@table_schema.json` around lines 8 - 14, The "derivatives" field in the schema has no pattern constraint; update the field object for "derivatives" (inside the "fields" array) to include a "pattern" property that enforces valid pipeline names (e.g., an alphanumeric pattern such as "^[A-Za-z0-9_-]+$" or your preferred variant) and optionally add a "patternMessage" or "error" description to explain invalid values; ensure the "type": "string" remains and that the new pattern aligns with other label-type fields in the schema.
45-45: Replace non-standardformatvalues with custom properties or document the extension.The schema uses
"format": "label"(25 fields) and"format": "index"(6 fields) throughout, but these are not standard Frictionless Data Table Schema format values. The official specification defines formats likedefault,uri,binary, anduuid. While non-standard formats may be ignored by Frictionless validators rather than causing errors, using custom properties (e.g.,"bidsFormat": "label") or explicitly documenting this extension would improve clarity and standards compliance.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@table_schema.json` at line 45, The schema uses non-standard "format" values ("label"/"index") across many field definitions; replace those custom usages with a namespaced custom property (e.g., "bidsFormat": "label" or "x-format": "label") wherever the "format" key is currently set, and update any code that reads these fields to look for the new property instead of "format"; alternatively, if you must keep "format", add a top-level schema extension comment or metadata entry documenting this non-standard extension so validators/users know "label" and "index" are custom conventions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@table_schema.json`:
- Around line 358-376: The suffix enum in the JSON schema is missing three valid
BIDS suffixes; update the "enum" array (the suffix enumeration block shown) to
include "description", "emg", and "physioevents" so it matches the official BIDS
suffixes (referenced in src/schema/objects/suffixes.yaml); ensure you add the
three strings to the existing list alongside entries like "descriptions" and
"physio".
---
Nitpick comments:
In `@table_schema.json`:
- Around line 8-14: The "derivatives" field in the schema has no pattern
constraint; update the field object for "derivatives" (inside the "fields"
array) to include a "pattern" property that enforces valid pipeline names (e.g.,
an alphanumeric pattern such as "^[A-Za-z0-9_-]+$" or your preferred variant)
and optionally add a "patternMessage" or "error" description to explain invalid
values; ensure the "type": "string" remains and that the new pattern aligns with
other label-type fields in the schema.
- Line 45: The schema uses non-standard "format" values ("label"/"index") across
many field definitions; replace those custom usages with a namespaced custom
property (e.g., "bidsFormat": "label" or "x-format": "label") wherever the
"format" key is currently set, and update any code that reads these fields to
look for the new property instead of "format"; alternatively, if you must keep
"format", add a top-level schema extension comment or metadata entry documenting
this non-standard extension so validators/users know "label" and "index" are
custom conventions.
… derivatives - Add three missing BIDS suffixes: description, emg, physioevents - Add pattern constraint for derivatives field (alphanumeric, hyphens, underscores) - Rename non-standard "format" to "bidsType" for Frictionless spec compliance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix extension enum: remove leading dots to match actual output
(code uses ${filename#*.} which produces "nii.gz" not ".nii.gz")
- Change index fields (run, echo, flip, inversion, split, chunk)
from type string+pattern to type integer+minimum, matching BIDS
semantics (missingValues handles NA→null before type casting)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Define a comprehensive table_schema.json following the Frictionless Data Table Schema specification, enriched with metadata from the official BIDS schema (bids-standard/bids-schema). Includes titles, descriptions, format annotations (label/index), and constraints (enum, pattern, required, unique) for all 36 output fields.
Fixes #14
Summary by CodeRabbit