Skip to content

Add the BER feature model as an imported module - #5

Draft
turbomam wants to merge 9 commits into
ber-data:mainfrom
turbomam:genome-features-module
Draft

turbomam wants to merge 9 commits into
ber-data:mainfrom
turbomam:genome-features-module

Conversation

@turbomam

@turbomam turbomam commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

This adds the BER feature model (contigs, genome features, their locations and attributes) to the central schema as an imported module, with valid example data. The dialect schemas, conversion profiles, converters and validator stay in https://github.com/turbomam/feature-table-corpus and are deferred; this branch carries none of them (turbomam/feature-table-corpus#131). It follows the pattern of the measurements module from #2. Draft for discussion at the GenomeFeatures review on 2026-10-02.

What changed

Example data

All public, all converted with the model's own tools:

Validation

just test passes locally: 7 data tests and the examples run. linkml-validate against the root schema accepts all four valid Datasets and rejects each invalid example for exactly the fault its name gives (checked 2026-10-06).

Open questions

  • "Enumerate them": should the model reuse linkml/valuesets enums (ContigCollectionType has the same seven values, uppercased (ISOLATE, MAG, ...), so reusing it means mapping our lowercase values; StrandType and CdsPhaseType cover the same meanings with different spellings), or does this mean listing the model's elements?
  • Is renaming name to display_name with an alias acceptable, or should the root's name and the model's be reconciled into one slot?
  • KBase's CDM (https://github.com/kbase/cdm-schema, src/linkml/cdm_bioentity.yaml) already defines Contig, ContigCollection, Feature, StrandType, CdsPhaseType and ContigCollectionType. Should this module reuse those classes, map to them, or stay separate? ContigCollection already notes the mapping.

Copied from turbomam/feature-table-corpus at 4aaca94 (ber_feature_model.yaml 0.1.0 and
attributes.yaml), following the measurements module's pattern. Two changes from the copy, both
needed for this repository's build: the name slot becomes display_name with alias name, since
the root schema defines name; and the EDAM.DATA prefix becomes EDAM, which gen-python can emit.
MIXS and EDAM are also declared in the root so the generated Python defines them.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The name alias does not preserve instance-data compatibility, and copied documentation contains broken repository-relative references.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds the BER genome feature model as a central-schema module with validation examples.

Changes:

  • Imports the feature and reusable-attribute schemas.
  • Adds required MIXS and EDAM prefixes.
  • Adds valid and invalid feature datasets.
File Description
ber_central_schema.yaml Imports the feature model.
ber_feature_model.yaml Defines genomic feature entities and enums.
attributes.yaml Defines reusable attributes.
tests/​data/​valid/​Dataset-001.yaml Adds valid NMDC feature data.
tests/​data/​invalid/​Dataset-001.yaml Tests rejection of undeclared fields.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ber_central_schema/schema/ber_feature_model.yaml
Comment thread src/ber_central_schema/schema/ber_feature_model.yaml Outdated
Remove notes, comments and description wording that describe the
feature-table-corpus conversion tooling or cite files in that repository,
which do not exist here. Keep short notes that define the model itself,
and point to the v0.1.0 release for the evidence behind each element.

Drop tree_root from Dataset so the imported module does not set the root
class for the whole central schema.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The substantial public schema addition retains unresolved naming and model-reuse decisions requiring human review.

Review effort: Balanced
Findings: None

Resolved since last review (2)

…FF symbols as deliberate in lint

feature-table-corpus spells the prefix EDAM_DATA since turbomam/feature-table-corpus#163; the IRIs
are unchanged. .linkmllint.yaml excludes the four GFF3 strand symbols from standard_naming.
Lint still reports EDAM_DATA, because the canonical EDAM.DATA can't be emitted by gen-python
(linkml/linkml#3458).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Several collections documented as order-sensitive are modeled as unordered, and the compatibility alias lacks regression coverage.

Review effort: Balanced
Findings: None

Previously missed (2)

In code that hasn't changed since last review

Medium severity Preserve source order for repeated Note values

src/​ber_central_schema/​schema/​ber_feature_model.yaml:306

The description promises that repeated Note values remain in source order, while this multivalued slot is unordered in the LinkML model. Add list_elements_ordered so generated representations can preserve the documented ordering.

This issue also appears in the following locations of the same file:

  • line 314
  • line 323
  • line 335
Low severity Add name alias coverage to a valid example

src/​ber_central_schema/​schema/​ber_feature_model.yaml:297

The display_name/name alias is an integration-specific compatibility behavior, but none of the Dataset examples contains a name field, so the automated runtime/example tests do not protect the behavior verified manually in the review thread. Add name to a valid Feature or ContigCollection example to make this a regression test.

@turbomam

turbomam commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Answering the two previously-missed items in Copilot's review of bfd6712 (#5 (review)):

  • Alias coverage: fixed in 3422d4d. The first Pfam hit in tests/data/valid/Dataset-001.yaml now has name: DDE_3, from its own Name attribute, so just test loads a name key through alias: name. linkml-validate accepts that file. The same file with display_name: instead is rejected as an unexpected property.
  • Ordered lists: right about note, dbxref and ontology_term ("in source order") and taxonomic_lineage (rank order). The source model has the same gap, so it's filed there to fix first and then copy here: Mark the four order-dependent list slots as ordered turbomam/feature-table-corpus#170 (Mark the four order-dependent list slots as ordered). Changing only this copy would make it drift from feature-table-corpus.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The broad public schema surface and unresolved interoperability questions require domain-owner review.

Review effort: Balanced
Findings: None

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Ordered lineage semantics, strand documentation, and required fixture coverage remain unresolved.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)

Comment thread src/ber_central_schema/schema/ber_central_schema.yaml
Comment thread src/ber_central_schema/schema/ber_feature_model.yaml
Comment thread src/ber_central_schema/schema/ber_feature_model.yaml Outdated
The valid examples are real data converted by the model's own profiles: an NMDC run with its
contig collection, phiX174 with joined and origin-crossing locations, and Pfam hits with their
alignment targets. Each invalid example breaks one constraint and is named for it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Attribute counterexample coverage and acknowledged ordered-list and strand-description fixes remain outstanding.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (2)

Comment thread src/ber_central_schema/schema/attributes.yaml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The modified schema reuses the upstream release identity and version despite defining a different contract.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Use a distinct version for the structurally divergent schema

src/​ber_central_schema/​schema/​ber_feature_model.yaml:4

This copy still advertises the upstream schema's id and 0.1.0 version, but it is structurally different from that release: upstream v0.1.0 has Dataset.tree_root, the name slot, and EDAM.DATA, while this artifact drops or renames them. Two non-equivalent contracts are therefore indistinguishable by (id, version), which can misidentify generated artifacts and cached schemas. Publish this as a distinct derived version, or release these changes upstream and vendor that exact version.

@@ -0,0 +1,67 @@
id: https://w3id.org/ber-data/attributes

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split out attribute/value into a separate PR? I think it is important enough to the effort that we should have it separately.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #11

Also copies turbomam/feature-table-corpus#172: note, dbxref,
ontology_term and taxonomic_lineage are ordered, and '.' is described as not stranded.
@turbomam

turbomam commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Answering the previously-missed item in Copilot's review of b632020 (#5 (review)): right, the copy differed from v0.1.0 while advertising the same id and version. Fixed in 15b0e06. The copy's version is now 0.1.0-bridge.1, and a note lists each difference from v0.1.0: no tree_root, display_name with alias name, the EDAM_DATA prefix, and the ordered lists and '.' wording from turbomam/feature-table-corpus#172, which merged after v0.1.0 and is copied here too. The id stays the same, so the copy can align with a later feature-table-corpus release.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The substantial domain-model import and unresolved interoperability questions warrant final human schema review.

0 open findings

🧠 Review effort: Balanced

@dschristianson

Copy link
Copy Markdown

Thanks for this work, @turbomam. Could we consider using something like SequenceFeature instead of straight up Feature? Feature is also used in the earth science world with the base Feature concept being quite broad and then qualified for specific types of features, e.g., SamplingFeature (ref: OGC Observations and Measurements) = point in a stream, soil pit, tree, etc.

@ialarmedalien

Copy link
Copy Markdown

It is totally overwhelming to have so much back and forth with the agent and to have reams of LLM text to wade through as part of the PR -- can we institute an SOP that keeps the LLM iteration out of the PRs or reserved for draft PRs, which are then cleaned up for human consumption?

I usually skim through the conversation tab first so I can see what others have already brought up, and pages of back and forth with the agent make it hard to pick out what, if anything, is of value. It seems like this iterative co-development should be done prior to making the PR, rather than as part of it. Can we reserve PRs for finished products, ready for human comments, not WIPs? Or, if they are WIPs, label them as being agent co-dev WIPs that other humans do not need to look at?

@turbomam

Copy link
Copy Markdown
Contributor Author

It is totally overwhelming to have so much back and forth with the agent

Thanks @ialarmedalien. Yes, I like the idea of a SOP and appreciate your feedback. I use Claude as my main development agent and then like to have have copilot or codex review give them an independent review. That does make the PRs long but it keeps the evolution of the PR transparent. As long as I have an Open AI allocation though the Rosalind program I can do the orthogonal reviews locally and not post it's findings. I think @cmungall and other BBOP people have other review patterns and I'm not sure how verbose they are but will look into it.

I can also rewrite the PR description by hand and hide some of the agentic replies that came after that.

@ialarmedalien

Copy link
Copy Markdown

I don't know how valuable it is to keep iterations of the PR content visible. When I look at a PR, I don't really care how it got to its current state; I evaluate the code/text/whatever it is as presented on screen. Certainly for work that I do, I can't imagine anyone's going to want to see how the code evolved to its present state, and it's not really relevant as the older versions aren't going into the repo.

If there is something surprising in a PR (an unintuitive choice, something that appears illogical, etc.), comments in the code or inline in the PR are appropriate and reviewers can always ask Qs.

@valerie-autumn-skye valerie-autumn-skye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support AJ's request for attribute/value to be moved into a separate PR to be reviewed/merged prior to this PR.

Nothing in particular jumps out at me as being problematic in this schema, but I should solicit some sample data from IMG, SMC, Phytozome, and Mycocosm in order to provide enough test coverage for you.

This branch has not been deployed

No deployments
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.

5 participants