Skip to content

[Bug]: uc_tag_sync ignores standalone uc_table / uc_column semantic links (only reads data_contract_schema + asset) #724

Description

@mvkonchits-db

Summary

uc_tag_sync propagates a concept's IRI to a UC governed tag ONLY when the concept is linked via a data_contract_schema or an asset entity. A concept linked directly to a physical object with entity_type = 'uc_table' (or uc_column, uc_schema, uc_catalog) is silently skipped — no tag is written, no error.

Evidence (verified on FEVM valcon-demo)

src/backend/src/workflows/uc_tag_sync/uc_tag_sync.py has two readers:

  • read_contracts_and_links — joins entity_semantic_links with WHERE el.entity_type = 'data_contract_schema' (approx L216).
  • read_assets_and_links — joins entity_semantic_links with WHERE esl.entity_type = 'asset' (approx L383) and WHERE at.name IN ('Table','View').

Neither reads links whose entity_type is uc_table / uc_column / uc_schema / uc_catalog.

Repro:

  1. Link a concept directly to a UC table: POST /api/semantic-links/ {entity_id: "main.finance.fact_expenses", entity_type: "uc_table", iri: "urn:glossary:finance/opex-spend"}.
  2. GET /api/knowledge/tag-delivery-stats reports it as eligible (eligible: 1) — the app's read model counts uc_table links.
  3. Run uc_tag_sync → log shows Found 0 datasets from contracts / Found 0 datasets from assets / Processing 0 datasets / Summary: updated=0. The eligible link is never tagged.

By contrast, the SAME concept linked via an asset row (asset_type Table, location = demo_catalog.e2e_import.fct_revenue) tags correctly: the job writes ontos_semantic_opex_spend = urn:glossary:finance/opex-spend on the table (verified via information_schema.table_tags).

Impact

  • The Enrich tag-delivery read model and the sync job disagree: the UI shows a uc_table-linked concept as eligible/pending forever, but the job never delivers it. Confusing and looks like a broken sync.
  • Users who link concepts straight to physical UC objects (a natural, common action) get no tags.

Suggested fix

Add a reader path for direct physical links (entity_type IN ('uc_table','uc_column','uc_schema','uc_catalog')) where entity_id is (or resolves to) the UC FQN, and feed those into the same DatasetTagInfo aggregation the asset/contract paths use. The tag key/value formats already exist (semantic_assignment config). Alternatively, make tag-delivery-stats count only the entity types the job can actually deliver, so the read model and the job agree — but delivering uc_table links is the better fix.

Notes

  • Not a regression from the concept-versioning work — the versioning changes never touched this job; this gap predates them. Surfaced while validating that versioning did not break UC tag propagation (it did not — the asset-linked path tags end to end cleanly).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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