Repository navigation
fix(rdf): properly index Dashboard/DashboardDataModel/Table/StoredProcedure in the knowledge graph (#29211) - #29326
Conversation
…29211) The distributed RDF reindex counts entities the source cannot hydrate (field-resolution / deserialization errors) as failed records, but RdfPartitionWorker never logged them. The only trace was a DEBUG line in EntityRepository.listAfterKeyset — or nothing at all for messages caught by isEntityNotFoundError but not isStaleReferenceError (e.g. "Entity type X not found"), which are logged at DEBUG yet still counted as failures. Operators saw the failed-record count rise with no way to identify the offending entities, and a log filter scoped to RDF class names found nothing. Mirror the search-index PartitionWorker.recordReaderFailures behaviour: log each reader failure at ERROR with the entity id/FQN and reason, and carry a representative message into the partition lastError so the job error summary is non-empty when only reader errors occurred. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…map data-asset types to dataAsset context (#29211) Two indexing gaps that left Dashboard/DashboardDataModel/Table/StoredProcedure under-represented in the knowledge graph: 1. Resilience: when the reindex source cannot fully hydrate an entity (one of the reindex field-set relationships fails to resolve), the row was turned into an EntityError and dropped from RDF entirely. Now, an entity that DESERIALIZED but failed field resolution is re-indexed with its core stored data (and its edges are still rebuilt from the DB by processBatchRelationships), so a single unresolvable field no longer leaves the whole entity missing from the graph. Only rows that cannot be deserialized at all remain hard failures. 2. Context mapping: getContextName mapped dashboardDataModel and storedProcedure (and searchIndex / apiEndpoint / apiCollection) to the minimal "base" JSON-LD context instead of "dataAsset-complete", so these data assets were translated with the wrong/empty mapping. Route every data-asset type to dataAsset-complete. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…data log wording Address code review on the reader-failure surfacing: - logReaderFailures returned the LAST EntityError's message, so a null final message blanked out the partition lastError (defeating the goal of a non-empty error summary), and a recoverable WARN could mask a genuine drop. Now prefer the first DROPPED (unrecoverable) failure's message, falling back to the first non-null message — lastError always describes a real drop when one occurred and is never null when any failure carried a message. Also surface recovered.lastError() in the lastError precedence so a failed recovery write isn't hidden. - The recoverable WARN said "indexing core data only" before the recovery re-index actually runs; reworded to "attempting to index core data only" so it doesn't assert success the recovery write might not achieve. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
🟡 Playwright Results — all passed (13 flaky)✅ 4017 passed · ❌ 0 failed · 🟡 13 flaky · ⏭️ 84 skipped
🟡 13 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved 2 resolved / 2 findingsImproves RDF reindex robustness by implementing a recovery pass for partially-resolved entities and adding missing entity types to the data-asset context. Addresses high failure rates for specific entities by surfacing diagnostic logs and enabling core-data indexing as a fallback. ✅ 2 resolved✅ Edge Case: Representative reader error captures last entry, may be null/non-severe
✅ Quality: WARN log claims core-data indexing before recovery is attempted/succeeds
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Fixes #29211 — RDF reindex reports high "failed records" for Dashboard / DashboardDataModel / Table / StoredProcedure (up to ~94%) with no diagnostic, and these entities end up missing/under-represented in the knowledge graph.
Investigation (what was ruled out)
DashboardDataModelandStoredProcedurerequest the exact same reindex fields asDatabaseSchema(the COMMON set: owners, domains, reviewers, followers, votes, extension, tags, certification, dataProducts) — yet fail ~94% / ~15% while DatabaseSchema is 0%. So a requested field isn't the cause; the divergence is per-entity-type code/data.model.write(N-TRIPLES)+UpdateFactory.createis robust to spaces /<>/ quotes / unicode / control chars in IRIs and literals — they're escaped and parse fine. The "bad-IRI breaks SPARQL" theory is false.RdfPropertyMapper.mapEntityToRdfswallows exceptions and Fuseki returns 200/204; per-entity write failures log the UUID (which the reporter's RDF-only log grep missed).The failures are reader-side: an entity that fails to fully hydrate during reindex was turned into an
EntityErrorand dropped from RDF entirely — a single unresolvable relationship in the field-set takes the whole entity out of the graph.Fixes
RdfPartitionWorker): log each with entity id/FQN + reason (previously only a DEBUG line underEntityRepository, invisible to an RDF-scoped log filter).getContextNamemappeddashboardDataModelandstoredProcedure(+searchIndex/apiEndpoint/apiCollection) to the minimalbaseJSON-LD context instead ofdataAsset-complete— so they were translated with the wrong mapping. Route all data-asset types todataAsset-complete.Scope / risk
RDF-only; additive (only changes the handling of rows that were already failing); no change to the shared
PaginatedEntitiesSourceor the search-index path.RdfPartitionWorkerTest+5 cases, all 7 pass.Honest note
The exact per-entity trip (a data-dependent strict resolve / edge case in one of these four repositories' bulk paths) couldn't be pinpointed statically — every individual resolver reads as lenient — and the reporter's logs weren't available. Fix #2 closes the gap regardless of the specific field by indexing core data; fix #1 surfaces the exact reason for any remaining hard failure.
🤖 Generated with Claude Code
Greptile Summary
This PR fixes high failure rates (~94%) for
Dashboard,DashboardDataModel,Table, andStoredProcedureduring RDF reindexing, and extends the same protection toSearchIndex,ApiEndpoint, andApiCollection. Two root causes are addressed: (1) partially-hydrated entities were silently dropped from the graph with no diagnostic; (2) those entity types were mapped to the minimalbaseJSON-LD context instead ofdataAsset-complete, causing them to be translated with the wrong schema.RdfPartitionWorker: Reader failures are now split into "recoverable" (deserialized but field-resolution failed) and "unrecoverable" (couldn't deserialize). Recoverable entities are re-indexed with their core stored data rather than dropped; each failure is now logged at WARN/ERROR with entity id + FQN.RdfPropertyMapper.getContextName: Five entity types that previously fell through tobaseare now routed todataAsset-complete, ensuring correct JSON-LD mapping.RdfPartitionWorkerTest: Five new test cases coverlogReaderFailurespriority logic,describeFailedEntityedge cases, andrecoverableEntitiesfiltering.Confidence Score: 5/5
Safe to merge — changes are additive, scoped entirely to the RDF indexing path, and do not touch PaginatedEntitiesSource or the search-index pipeline.
The recovery logic correctly splits reader failures into recoverable/unrecoverable buckets, re-indexes core data for recoverable entities, and accumulates all counters accurately across both processing passes. The logReaderFailures representative-message selection (first dropped wins, first non-null fallback) is validated by dedicated tests. The context-mapping fix in getContextName is a straightforward case addition with no side effects on other entity types.
No files require special attention.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(rdf): pick the representative reader..." | Re-trigger Greptile