fix(ui-react): show every model in the model tree, not only type sdm#Model (#98) - #101
Merged
Merged
Conversation
…Model (#98) The three queries that read modelcatalog_software filtered on type: { _eq: "https://w3id.org/okn/o/sdm#Model" }. The column classifies a model — Empirical, Coupled, Theory-Guided and so on — it does not say whether a row is a model. Every row the ETL migrated matched `?id a sdm:Model` in the RDF and stored the most specific subtype found; rows written through the REST API's generic `softwares` resource carry the ontology superclass sd#Software. So the predicate hid real models. Against TACC's catalog the thread wizard showed 18 of 175 leaf configurations and 0 of the 61 with every required input annotated. All 44 Height Above Nearest Drainage configurations were hidden, so a search for HAND returned "No models match your search." - GetModelTreeWithRegions — the thread wizard Models step - GetModelTree — /regions/:id/models - GetModelFamilies — the Model Family picker on registration, which could not offer any family whose type is a subtype of sdm#Model An allowlist of subtypes is not the fix. model-catalog-api keeps one (getSoftwareTypeFilter in service.ts) and it is already stale: it returns 44 of TACC's 55 software rows. Verified live against TACC's Hasura: all three documents now return 55 software, 51 versions, 175 leaf configurations, 44 of them HAND. graphql.ts regenerated by graphql-codegen from the committed admin-schema snapshot, not hand-edited.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 9, 2026
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #98.
The rule
modelcatalog_software.typeclassifies a model. It does not say whether a row is a model.?id a sdm:Modelin the RDF. It then stored the most specificsdm:subtype it found, defaulting tosdm#Model(etl/extract.py:145-171). So every migrated row is a model by construction.softwaresresource carry the ontology superclasssd#Software(model-catalog-api/src/mappers/resource-registry.ts:77). All 8 such rows at TACC are models: MODFLOW-96 ×2, MODFLOW-2001 ×3, ParFlow, an InSAR workflow, a particle-filter groundwater assimilation.ui/src/model-catalog-api/util.ts:14-44).So any predicate on
typehides real models. The queries now pass none.Effect at TACC
Measured live against
https://graphql.mint.tacc.utexas.edu/v1/graphqlwith the exact documents this PR ships.Why not an allowlist of subtypes
model-catalog-apialready keeps one —getSoftwareTypeFilterinsrc/service.ts:59-76, six URIs. It is already stale: TACC's/modelsreturns 44 of 55 software, silently droppingTheoryBasedModel,TheoryAndEmpiricalModelandDataAssimilation(never added to the list) plus everysd#Softwarerow. An allowlist goes wrong every time the catalog gains a subtype, and it fails silently.Changes
Three queries lose the
whereclause:GetModelTreeWithRegions(src/graphql/generated/modeling.ts) — the thread wizard Models stepGetModelTree(src/graphql/queries/model-catalog.graphql) —/regions/:id/modelsGetModelFamilies(same file) — the Model Family picker on registration, which could not offer any family whose type is a subtype, so a new version could not be registered under HANDsrc/graphql/generated/graphql.tswas regenerated withgraphql-codegenagainst the committed admin-schema snapshot (src/graphql/generated/schema.graphql) rather than hand-edited. The diff is 10 lines across the two documents.Registration still writes
sdm#Modelfor a newly created family (src/schemas/registration.ts:12). That is correct — the generic type is the honest default when no subtype is known.Tests
New
src/graphql/__tests__/model-tree-type-filter.test.ts— 9 assertions guarding all three documents against a type predicate. Checked to fail against the old code (6 of 9 red).Full suite green: 97 files, 802 tests.
npm run buildandnpm run lintclean (0 errors).Not covered
No render-level browser check — the Models step needs a signed-in thread, and that is #92's job.
grepconfirms these were the only ontology-type filters inui-react.