Adding a built-in profile¶
What a profile needs before it is published from this repository, and the test that fails when it is missing.
Where it goes depends on what it describes (ADR 007). A standard, such as MIAPPE or REMBI, goes into metaseed-profiles: its schema under packages/metaseed-profiles/src/metaseed_profiles/specs/ and its example under packages/metaseed-profiles/src/metaseed_profiles/examples/. The profile of a service metaseed has an adapter for travels with that adapter. Below, <specs> and <examples> stand for the two directories of the distribution the profile belongs to. Run make test after each step; a step without a named test is not yet gated and is checked by review.
The profile¶
| Requirement | Gate |
|---|---|
The schema is <specs>/<name>/<version>/profile.linkml.yaml (see LinkML, Editing a shipped profile). |
tests/test_specs/test_linkml.py loads every shipped file and converts it both ways. |
Every field that holds a value has an example that fits its type and constraints; a list or entity field naming another entity has none. |
tests/test_specs/test_every_field_has_an_example.py |
| Entities are listed containers first, so the Excel export and the graph never meet a child before its parent. | tests/test_specs/test_containment_order.py |
A field holding an NCBI Taxonomy identifier is a taxon field: ontology_term with ontologies: [ncbitaxon], example NCBITaxon:<number>. |
tests/test_specs/test_taxon_fields.py finds such fields by a description starting "NCBI Taxonomy ID" or "NCBI Taxonomy identifier". |
Presence rules (required, any_of, none_of) name fields the entity has, so they convert to native LinkML expressions. |
tests/test_specs/test_linkml_rules.py checks every converted rule; a rule naming a missing field is skipped rather than reported (#476). |
Ontology prefixes the profile's terms use are declared with their IRIs, so terms become class_uri and slot_uri. |
Not gated (#478). |
The example dataset¶
| Requirement | Gate |
|---|---|
One example under <examples>/<name>/<version>/, whose nested children carry their parent identifiers and every required list, and which loads through Load example. |
tests/test_examples.py |
Synthetic identities only: fictional names, @example.org addresses, no real phone numbers or street addresses, even when the source is a public archive record. |
tests/test_no_real_personal_data.py |
Documentation and public API¶
| Requirement | Gate |
|---|---|
A page docs/profiles/<name>.md, registered in PROFILE_DOCS and in the mkdocs.yml nav. |
tests/test_docs/test_profile_docs.py::test_every_shipped_profile_has_a_checked_page_in_the_nav |
The page's erDiagram names only real entities, fields and containment edges, mentions every entity, and its Python block runs. |
tests/test_docs/test_profile_docs.py |
| A row in the README profile table with the extra that installs it and the exact entity and field counts. | tests/test_docs/test_readme.py |
An accessor in metaseed/facade/profiles.py, exported from metaseed.facade and metaseed, and named in docs/specification/api-contract.md. Without its distribution installed it raises ProfileNotFoundError naming the extra. |
tests/test_public_api.py |
Order that avoids rework: the example first (pytest tests/test_examples.py -k <name>), then the docs page (pytest tests/test_docs -k <name>), then the README row and the accessor.