semantica.conflicts detects and resolves contradictions when multiple sources disagree on the same fact:
- Five conflict types: value, type, temporal, logical, and relationship
- Seven resolution strategies: voting, credibility-weighted, most-recent, first-seen, highest-confidence, manual review, expert review
InvestigationGuideGeneratorproduces step-by-step investigation instructions for manual resolutionSourceTrackermaps each property value to its contributing source for full attribution- Conflicts are surfaced explicitly: never silently corrupting the knowledge graph
Why Detect Conflicts?
When you ingest data from multiple sources, contradictions are inevitable. One annual report says Apple’s revenue was $391B; a financial newswire says $383B. Without conflict detection, both values land in your graph and queries silently return inconsistent answers. Semantica’s conflict detection makes disagreements explicit and actionable:- Value conflicts: SEC says revenue is $391B; Reuters says $383B
- Type conflicts: “Python” is a
ProgrammingLanguagein one source, aSnakespecies in another - Temporal conflicts: a CEO had two different employers during overlapping date ranges
- Logical conflicts: an entity simultaneously holds two mutually exclusive properties
- Relationship conflicts: the same relationship has inconsistent cardinality or properties across sources
Exported Classes
What You Get
- ConflictDetector — Value, type, and relationship conflict detection across entity and relationship lists.
- ConflictResolver — 7 resolution strategies including voting, credibility-weighted, and temporal preference.
- SourceTracker — Track which source each conflicting fact came from, with per-source credibility scores.
- ConflictAnalyzer — Pattern analysis, severity grouping, source-level statistics, and trend identification.
- InvestigationGuideGenerator — Auto-generate step-by-step investigation checklists for human and expert review.
- Convenience Functions —
detect_conflicts()andresolve_conflicts()for one-call workflows.
Quick Start
1
Set credibility scores before ingestion
2
Detect conflicts after building the graph
3
Triage by severity
4
Auto-resolve low-severity, escalate critical
ConflictDetector
Detection Types
Run targeted detection by type:
ConflictDetector Methods
ConflictResolver
Choosing a Resolution Strategy
- CREDIBILITY_WEIGHTED (recommended)
- VOTING
- MOST_RECENT / FIRST_SEEN
- MANUAL_REVIEW / EXPERT_REVIEW
- Strategy Comparison
Weights each source’s value by its assigned credibility score: favors authoritative sources automatically:Best for: sources with known reliability rankings (SEC > blog).
SourceTracker
- Credibility scores default to 0.50 for any source not explicitly set
SourceTrackerstores property-level provenance: so you can trace exactly which source contributed each value
ConflictAnalyzer
analyze_conflicts()["patterns"]returns a list ofConflictPatternobjects: usepattern.pattern_typeandpattern.frequencyto find systemic data quality issuesanalyze_conflicts()["by_source"]includescountsandtop_sources: sources appearing in many conflicts may have upstream data quality problemsanalyze_trends()returns a list of per-period dicts (period,conflict_count,trend,trend_direction):trendis"increasing","decreasing", or"stable"
InvestigationGuideGenerator
Auto-generate human-readable investigation checklists for conflicts requiring manual or expert review:Schemas
Conflict schema
Conflict schema
ResolutionResult schema
ResolutionResult schema
ConflictType enum
ConflictType enum
InvestigationGuide and InvestigationStep schemas
InvestigationGuide and InvestigationStep schemas
- Deduplication — Resolve duplicate entities before conflict detection.
- Ontology — Logical conflicts use SHACL shapes and ontology axioms.
- Provenance — Track which source each conflicting fact came from.
- Knowledge Graph — The graph being checked for conflicts.
