iri_migration

data.iri_migration

Rewrite the curated-record IRIs a spec names into their canonical tvbo:<folder>/<file stem> form.

A curated record’s IRI is scoped by the database folder it is filed in and ends in its file stem (:func:tvbo.data.registry.record_iri). The registry also answers to other spellings, and each is rewritten into that one. A singular scope (tvbo:observation/bold_tvb) maps to its folder. A scoped name that is the record’s name: or its stem in another case (tvbo:observation_models/BOLD_TVB, tvbo:atlases/DesikanKilliany) becomes its stem. An unscoped name (tvbo:Linear) is the record the slot it sits in resolves it to when that slot ranges over one curated class (network: {iri: tvbo:DesikanKilliany} is the structural connectome filed under that atlas), else the record of that name in the one folder that files it.

:func:migrate_text rewrites both in a YAML document, or in the fenced YAML blocks of a Markdown or Quarto page, and leaves every other byte as written. A name it cannot place is reported and left alone.

Classes

Name Description
Change One curated IRI the migration met: rewritten to new, or left as written with the reason why.

Change

data.iri_migration.Change(line, old, new=None, reason='')

One curated IRI the migration met: rewritten to new, or left as written with the reason why.

Functions

Name Description
migrate_text (rewritten text, changes, blocks skipped as not YAML) for a YAML document, or for a Markdown/Quarto page when path says it is one.
spec_files The YAML, Markdown and Quarto files at or under paths, sorted; a hidden directory under a searched one (.venv, .git, .quarto) is not entered.

migrate_text

data.iri_migration.migrate_text(text, path=None)

(rewritten text, changes, blocks skipped as not YAML) for a YAML document, or for a Markdown/Quarto page when path says it is one.

spec_files

data.iri_migration.spec_files(paths)

The YAML, Markdown and Quarto files at or under paths, sorted; a hidden directory under a searched one (.venv, .git, .quarto) is not entered.