Draft
Conversation
Covers class hierarchy design, validation continuity, Python/TypeScript code generation, and CI integration. Scoped to metaschema replacement only — the BIDS schema YAML files are not modified. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add bids_metaschema.yaml with: - RequirementLevel enum (required/recommended/optional/deprecated) - FormatType enum (17 format identifiers matching current metaschema) - IssueSeverity enum (error/warning) - GeneralTerm base class (display_name, description) Also add linkml_design_steps.md with detailed Phase 1 substeps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add class hierarchy for all BIDS schema object types: - ValueTerm -> Datatype, Extension, Suffix, EnumValue - NameValueTerm -> Entity, MetadataField, Column - Format, FileObject (independent GeneralTerm subclasses) - PrivateEnum (underscore-prefixed enum definitions) - JsonSchema (loosely-typed container for embedded JSON Schema) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add rule classes: - SuffixRule, PathRule, StemRule (file naming rules) - SidecarRule (JSON sidecar field rules) - TabularDataRule (TSV column rules) - CheckRule (validation check rules) - FieldSpec, EntityOverride (rule sub-components) - Issue, ErrorDefinition (validation messages) - ModalityMapping, DirectoryEntry (supporting types) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add meta classes: - Association + AssociationTarget (file association rules) - ExpressionTest (expression language test cases) - Template (reusable partial rule fragments) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add container classes completing the schema structure: - BidsSchema (tree_root): meta, objects, rules, versions - MetaSection: associations, context, expression_tests, templates - ObjectsSection: all 12 object sub-namespace maps - RulesSection: checks, files, sidecars, tabular_data, etc. - FileRulesSection: common/raw/deriv file rule groups Total: 38 LinkML class and enum definitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add patch_metaschema.py to post-process LinkML-generated JSON Schema, adding map types (additionalProperties) that LinkML cannot express natively. Fix Template to allow suffixes/extensions fields. The pipeline: gen-json-schema | patch_metaschema.py produces a JSON Schema that successfully validates the compiled BIDS schema, achieving parity with the existing src/metaschema.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Categorize all 43 JSON Schema patches into 6 groups and analyze how LinkML's extra_slots feature (not yet implemented in gen-json-schema) could eliminate most of them once it ships. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Using the draft extra_slots implementation from sneakers-the-rat/linkml@jsonschema-extra (linkml/linkml#2940), replace 35 of 43 post-processing patches with native LinkML declarations: - Category 4 (8 patches): extra_slots: {allowed: true} on open classes (MetadataField, Column, Suffix, etc.) - Category 1 (16 patches): 13 typed map wrapper classes with extra_slots: {range_expression: {range: X}} - Category 2 (9 patches): 12 nested map wrapper classes (CheckRuleGroupMap -> CheckRuleMap -> CheckRule, etc.) - Category 3 (4 patches): 3 union map classes with any_of in range_expression (EntityRequirementMap, FieldRequirementMap, etc.) Remaining 8 patches: 5 slot-level type coercions, 2 sidecars/ tabular_data derivatives nesting overrides, 1 root $ref. Key divergence in PR 2940: extra_slots generates spurious {type: null} in additionalProperties anyOf for class-ranged maps. This does not break validation but is less strict than intended. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…data dir - Create gen_class_diagram.py: generates Mermaid classDiagram from bids_metaschema.yaml showing 35 data model classes, 3 enums, inheritance and composition relationships (excludes 29 map wrappers) - Create class_diagram.md: auto-generated Mermaid diagram output - Update linkml_design_plan.md: add Class Hierarchy Diagram section - Move bids_metaschema.yaml from src/schema/ to src/ to prevent _read_yaml_dir from loading it as schema data (broke load_schema) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
while we reviewed rendering of classes diagram
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ongoing work with @effigies and claude code.