Overview
Apply confirmed decisions from the review process to the knowledge graph. Merges approved duplicate entities and removes rejected relations, then updates the graph file.Usage
Options
Output directory containing graph and review files. Use
-o as shorthand.Enable verbose logging. Use
-v as shorthand.Behavior
Application Process
- Load Graph - Reads
graph_data.json - Apply Entity Merges - Processes confirmed proposals from
merge_proposals.yaml- Merges entity attributes
- Redirects all relations to canonical entity
- Removes duplicate entities
- Apply Relation Rejections - Removes rejected relations from
relation_review.yaml - Save Graph - Updates
graph_data.jsonwith changes
Entity Merge Logic
When merging entities:- Canonical Name - Uses name from merge proposal
- Attributes - Combines attributes from all merged entities
- Relations - Redirects all incoming/outgoing relations to canonical entity
- Source Documents - Preserves references from all merged entities
Relation Rejection
Removes relations marked asstatus: rejected in relation_review.yaml.
Input Files
merge_proposals.yaml
Reads theconfirmed section:
relation_review.yaml
Reads relations withstatus: rejected:
Output
Updatesgraph_data.json with:
- Merged entities
- Removed duplicate entities
- Removed rejected relations
- Updated entity and relation counts
Examples
Apply all confirmed decisions
Apply from custom directory
With verbose logging
Output Summary
Displays:- Number of entity merges applied
- Number of relations rejected
- Final entity count
- Final relation count
- Graph file location
No Changes
If no confirmed merges or rejections exist:Next Steps
After applying merges:Iterative Workflow
The review-apply cycle can be repeated:sift resolve- Find more duplicatessift review- Review new proposalssift apply-merges- Apply decisions- Repeat as needed
Error Handling
Exits with error if:- No
graph_data.jsonfound (runsift buildfirst) - Review files are malformed
Rollback
To undo applied merges:- Restore
graph_data.jsonfrom backup - Or rebuild graph from extractions:
sift build