Skip to content

LinkML SQL DDL regression blocks upgrade past 1.9.x #74

Description

@cmungall

ChemROF currently cannot move cleanly to linkml==1.10.0 or linkml==1.11.0rc3 because SQL DDL generation fails in LinkML.

Upstream LinkML issue: linkml/linkml#3501

Symptom

Running ChemROF generation with newer LinkML fails during gen-project / gen-sqlddl:

sqlalchemy.exc.NoReferencedColumnError: Could not initialize target column for ForeignKey 'AtomOccurrence.id' on table 'AtomicBond': table 'AtomOccurrence' has no column named 'id'

The relevant ChemROF shape is:

  • ChemicalRelationship is an abstract parent with no authored identifier.
  • AtomOccurrence extends it and declares name as its identifier.
  • AtomicBond.subject and AtomicBond.object range over AtomOccurrence.

The expected SQL FKs are:

FOREIGN KEY(subject) REFERENCES "AtomOccurrence" (name)
FOREIGN KEY(object) REFERENCES "AtomOccurrence" (name)

Version boundary

A reduced LinkML reproducer shows this is not newly introduced by the 1.11.0rc3 release candidate:

linkml==1.8.7 + linkml-runtime==1.8.3: passes
linkml==1.9.6 + linkml-runtime==1.9.5: passes
linkml==1.10.0: fails
linkml==1.11.0rc3: fails

So this appears to be a LinkML 1.10.0 regression that ChemROF encounters when upgrading beyond the 1.9.x-era behavior.

Local verification

With linkml==1.11.0rc3, make test fails at project generation with the AtomOccurrence.id FK error.

With a local LinkML patch for linkml/linkml#3501, ChemROF make test completes successfully in a throwaway worktree, and generated SQL uses AtomOccurrence.name for AtomicBond.subject and AtomicBond.object.

Suggested action

Track linkml/linkml#3501 and retest ChemROF once a LinkML release or patch release includes the SQL DDL fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions