Skip to content

feat(concepts): full-page browser/detail, links, neighbourhood, robust ontology save#340

Merged
larsgeorge-db merged 1 commit into
mainfrom
feat/concepts-panels-and-fixes
May 21, 2026
Merged

feat(concepts): full-page browser/detail, links, neighbourhood, robust ontology save#340
larsgeorge-db merged 1 commit into
mainfrom
feat/concepts-panels-and-fixes

Conversation

@larsgeorge-db
Copy link
Copy Markdown
Collaborator

Summary

Rebuilds the Concepts experience around a full-page master/detail flow and hardens the backend so LLM-generated ontologies always import cleanly.

Concepts UX

  • New Concept detail page at /concepts/browser/:iri with a sticky header (back, title/type/IRI, edit/delete), single dense column matching other detail views. Legacy ?concept=IRI URLs auto-redirect.
  • List view is now full-width with richer rows (type icon, badge, status pill, collection chip, property hints) and persisted UI state (expanded groups, scroll position, search) via glossary-preferences-store.
  • LinkedObjectsPanel: collapsible card matching NodeLinksPanel style. Assign dialog now restricted to Data Product, Data Contract, and Asset — no raw UC objects. Asset list pulls from /api/assets (paginated) and is bounded + scrollable. Existing UC links keep rendering for back-compat but can no longer be created from this UI.
  • ConceptRelationsPanel replaces NodeLinksPanel on detail; consumes /api/semantic-models/neighbors so the full set of incoming/outgoing triples renders, with directional icons and colour-coded predicate badges.
  • ConceptNeighborhoodGraph: ReactFlow mini-graph (parents → current → children) with click-to-navigate and theme-correct colours for light/dark.
  • Cache-coherence store (knowledge-graph-store): bumped on Settings → Rebuild Graph and on every semantic-link mutation so dependent panels refetch without a hard reload.
  • i18n: linkedObjects / neighborhood / relations keys plus the new Asset label across de/en/es/fr/it/ja/nl.

Backend hardening

  • clean_truncated_turtle helper in owl/owl_parser.py salvages truncated LLM Turtle; applied in SemanticModelsManager, the base ontology handler, and the upload route. rdflib.parse() failures now surface as HTTP 400 instead of 500.
  • SemanticLinksManager invalidates the manager cache on create/delete so the UI sees fresh state immediately.

Test plan

  • Unit: tests/unit/test_clean_truncated_turtle.py (10 cases)
  • Integration: tests/integration/test_knowledge_routes.py covers truncated-Turtle recovery and unparseable rejection
  • Component: linked-objects-panel.test.tsx (6), concept-relations-panel.test.tsx, concept-neighborhood-graph.test.tsx, business-terms.test.tsx (redirect)
  • Manual: assign Data Product / Data Contract / Asset to a concept; verify navigation and removal
  • Manual: open a concept with many neighbours; confirm the relations and linked-entities lists scroll past the cap and the neighbourhood graph remains readable in light + dark modes
  • Manual: re-import an LLM ontology that previously truncated; confirm save succeeds and Settings → Rebuild Graph refreshes the tree

@larsgeorge-db larsgeorge-db requested a review from a team as a code owner May 6, 2026 16:33
Copy link
Copy Markdown
Contributor

@mvkonchits-db mvkonchits-db left a comment

Choose a reason for hiding this comment

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

Hi Lars, one of the CI tests failed plus 5 cents from my side (what to double check):

  • settings_routes.py:364 — audit field rename user_email → requester_email. Confirm requester_email is the canonical field, else downstream audit consumers break silently.
  • _get_asset_child_columns N+1 (one SELECT per hasColumn relationship per table-like asset).
  • get_all_columns / search_columns paginate in memory rather than push to SQL.
  • _resolve_asset_parents recurses without a visited-set.

larsgeorge-db added a commit that referenced this pull request May 21, 2026
Eager-load source_relationships.target_asset in _get_columns_from_assets so
that _get_asset_child_columns can read rel.target_asset directly instead of
issuing one SELECT per hasColumn relationship per table-like asset.

Note: PR #340 (feat/concepts-panels-and-fixes) also touches this method —
whichever PR merges second will need a rebase carry-over.
larsgeorge-db added a commit that referenced this pull request May 21, 2026
Eager-load source_relationships.target_asset in _get_columns_from_assets so
that _get_asset_child_columns can read rel.target_asset directly instead of
issuing one SELECT per hasColumn relationship per table-like asset.

Note: PR #340 (feat/concepts-panels-and-fixes) also touches this method —
whichever PR merges second will need a rebase carry-over.
@larsgeorge-db larsgeorge-db force-pushed the feat/concepts-panels-and-fixes branch from 73c770b to 77e5c86 Compare May 21, 2026 10:51
@larsgeorge-db
Copy link
Copy Markdown
Collaborator Author

Thanks for the careful review @mvkonchits-db — circling back now that main has caught up. The branch is rebased onto current main (77e5c86), which dropped the duplicate data-catalog commit and inherited the recent fixes. Per-bullet response:

PTAL when CI clears.

…t ontology save

Rebuilds the Concepts experience as a master/detail flow and hardens the
backend so LLM-generated ontologies always import cleanly.

Frontend
- New full-page Concept detail view (/concepts/browser/:iri) with sticky
  header, dense single-column layout matching other detail pages, back-compat
  redirect from the legacy ?concept= query param.
- Concepts list refactored to a full-width tree with richer rows (type icon,
  badge, status pill, collection chip, property hints) and persisted UI
  state (expanded groups, scroll, search) via glossary-preferences-store.
- LinkedObjectsPanel: collapsible card matching NodeLinksPanel style; assign
  dialog now restricted to Data Product, Data Contract, and Asset (no raw
  UC objects). Asset selector pulls from /api/assets and is scrollable.
- ConceptRelationsPanel replaces NodeLinksPanel on detail; consumes
  /api/semantic-models/neighbors so all incoming/outgoing triples render.
- ConceptNeighborhoodGraph: ReactFlow mini-graph (parents/current/children)
  with click-to-navigate and theme-correct colours for light/dark.
- Knowledge-graph cache nonce store ensures Settings "Rebuild Graph" and
  semantic-link mutations refresh dependent views.
- i18n: linkedObjects/neighborhood/relations keys + Asset label across
  de/en/es/fr/it/ja/nl.

Backend
- clean_truncated_turtle helper in owl_parser.py guards against truncated
  LLM Turtle output; applied in semantic_models_manager, base ontology
  handler, and the upload route. parse() failures now return HTTP 400.
- Semantic-link mutations invalidate the manager cache so the UI sees
  fresh state without a hard reload.

Tests
- Unit tests for clean_truncated_turtle.
- Integration tests for /api/ontology/save-to-collection covering the
  truncated-Turtle recovery path and unparseable-content rejection.
- Component tests for LinkedObjectsPanel, ConceptRelationsPanel,
  ConceptNeighborhoodGraph, and the BusinessTermsView redirect.
@larsgeorge-db larsgeorge-db force-pushed the feat/concepts-panels-and-fixes branch from 77e5c86 to 39866a8 Compare May 21, 2026 10:54
@larsgeorge-db larsgeorge-db merged commit f9f4a47 into main May 21, 2026
5 of 6 checks passed
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.

2 participants