Skip to content

Add a CLI to parse and validate mapping specifications - #8

Open
matentzn wants to merge 23 commits into
mainfrom
add-cli
Open

Add a CLI to parse and validate mapping specifications#8
matentzn wants to merge 23 commits into
mainfrom
add-cli

Conversation

@matentzn

@matentzn matentzn commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Turns the repo from a schema definition into something you can point at a real mapping set. A
fair-mappings command parses SSSOM and LinkML-Map documents into FAIR Mappings Schema instances and
validates them against the schema.

  • parse transforms a source document into a .fms.yml instance, driven by declarative LinkML-Map
    transformation specs (sssom-to-fair, linkmlmap-to-fair) rather than hand-written field mapping.
  • validate checks an instance against the schema and exits non-zero with the errors on stderr.
  • -I/--mapping-type takes its permissible values from MappingSpecificationTypeEnum read out of the
    schema at runtime, so the CLI's accepted types cannot drift from the model.
  • parse_sssom_tsv accepts an iterable of lines as well as a path, so it can read the #-commented
    header off a streamed HTTP response without downloading the whole mapping set.
  • schema.py resolves the bundled schema, the SSSOM and LinkML-Map schemas from their installed
    packages, and the bundled transformation specs through importlib.resources, so everything works from
    an installed wheel and not just a checkout.

Adds linkml_map to MappingSpecificationTypeEnum. That is the only change to the published data model
in this PR.

The distribution is renamed to fair-mappings and gains a console script of the same name. 55 tests
cover parsing, the CLI, validation, schema resource resolution and the package API.

What is not here

An earlier version of this branch carried a FAIR scoring system: fair_weight annotations on every slot,
a score command, and a 0-1 score per specification. That has been removed — a single score invites
league tables and implies an authority over what FAIRness is that this schema should not claim. The
per-slot breakdown was the genuinely useful part of it, and I will open a separate issue proposing a
metadata completeness checker that keeps that and drops the grade.

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.2

🚀 View preview at
https://mapping-commons.github.io/fair-mappings-schema/pr-preview/pr-8/

Built to branch gh-pages at 2026-08-21 13:20 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@matentzn matentzn changed the title Establish canonical prefix and URI prefix for fair-mappings-schema model elements WIP Apr 21, 2026
@matentzn matentzn changed the title WIP Add a CLI to parse and validate mapping specifications Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant