Skip to content

model-catalog-api: /models returns 44 of 55 software at TACC — the subtype allowlist is stale #102

Description

@mosoriob

GET /models on model-catalog-api v2 drops software rows without saying so.

Measured

https://api.models.mint.tacc.utexas.edu/v2.0.0/models returns 44 rows.
modelcatalog_software at TACC holds 55.

The 11 missing rows:

type rows
sd#Software 8
sdm#TheoryBasedModel 1
sdm#TheoryAndEmpiricalModel 1
sdm#DataAssimilation 1

The 8 sd#Software rows are models: MODFLOW-96 x2, MODFLOW-2001 x3, ParFlow, an InSAR deformation workflow, a particle-filter groundwater assimilation.

Cause

getSoftwareTypeFilter in src/service.ts:59-76 holds a hand-written allowlist of six type URIs for the models resource. It was never taught the three subtypes above, and it cannot match sd#Software.

src/custom-handlers.ts is cut harder still. Four handlers filter on type: { _eq: "https://w3id.org/okn/o/sdm#Model" } (lines 150, 196, 268, 321, 562), which keeps only 27 of 55.

The rule

modelcatalog_software.type classifies a model. It does not say whether a row is a model. The ETL only migrated rows matching ?id a sdm:Model and stored the most specific subtype it found (etl/extract.py:145-171); rows created through the generic softwares resource carry the superclass sd#Software (src/mappers/resource-registry.ts:77). Any predicate on type hides real models, and an allowlist goes stale every time the catalog gains a subtype.

ui-react hit the same fault and fixed it by dropping the predicate: #98, PR #101.

Scope

Not on the path to the SUBSIDE sign-off (#79). ui-react talks to Hasura directly and never calls this API. The affected consumer is the legacy Lit UI at TACC, which points at api.models.mint.tacc.utexas.edu/v2.0.0 and is being retired. Filed so the defect is not lost.

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