Fix source relationship direction and duplicate inverses - #333
Merged
Conversation
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.
Summary
dct:sourcelink as Source record...dct:isSourceOfpredicatedct:sourceOfrows while they remain in the databasedct_source_smBefore and after
The original issue identifies this parent and child:
Parent resource
Production currently returns both
dct:isSourceOfand the legacydct:sourceOffor the same 20 children.dct:isSourceOf_aggfilter.include_filters[dct_source_sm][]=b1g_gxSjhzRCQ7xQ.Child resource
The child stores
b1g_gxSjhzRCQ7xQindct_source_sm, which means the linked record is its source/parent.The Princeton example from the issue currently has the same duplicate inverse predicates; it is normalized by the same compatibility path.
Root cause
The frontend labels for
dct:sourceanddct:isSourceOfwere reversed. Separately, the full relationship population script useddct:isSourceOf, while newer incremental synchronization emitteddct:sourceOf. A full reconciliation therefore left the old canonical row in place and added a second alias row.Incremental synchronization now emits
dct:isSourceOfand includesdct:sourceOfin its cleanup set. The relationship presenter also canonicalizes and deduplicates both spellings, so deploying and refreshing resource representations corrects existing records without requiring an immediate full relationship rebuild.Validation
python -m pytest backend/tests/services/test_relationship_sync.py backend/tests/services/test_relationship_service.py— 21 passedmake lint-check— passednpm test -- --run— 946 passednpm run build— client and SSR production builds passedCloses #306