mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-09-10 04:00:35 +00:00
- Migrate from mint.json to docs.json (Mintlify v4) - Theme: maple, emerald green + near-black dark / cream light palette (#059669 primary, #0A0A0A dark bg, #FAF7F0 light bg) - Typography: Lexend headings, Inter body - 5-tab navigation: Documentation, Quick Start, API Reference, Cookbook, FAQ - Homepage: removed badge stickers, redundant h2, added blockquote tagline, full 27-module reference table with semantica.mcp_server added - quickstart.md: CodeGroup per pipeline step, pattern vs LLM options, AccordionGroup for patterns and troubleshooting - faq.md: full AccordionGroup structure across 5 sections - reference/explorer.md: NEW — FastAPI explorer, Ontology Hub, Distance Intelligence, CLI reference, REST API endpoints - reference/mcp_server.md: NEW — MCP stdio server, 12 tools with I/O examples, 3 resources, Claude Desktop/VS Code/Windsurf/Cline config - docs.json: explorer added to Output group, mcp_server to Utilities group - Chat, feedback (thumbs/suggest/raise), OG/Twitter metadata, search topbar - All reference pages reformatted with Mintlify JSX components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.1 KiB
3.1 KiB
title, description, icon
| title | description | icon |
|---|---|---|
| Conflicts Module | Multi-source conflict detection and resolution — value, type, temporal, and logical conflicts. | triangle-exclamation |
Comprehensive conflict detection and resolution for data discrepancies across multiple sources.
Overview
When multiple sources disagree on the same fact, the Conflicts Module detects and resolves the conflict rather than silently picking one value.
Detection types: value, type, temporal, and logical conflicts.
ConflictDetector
from semantica.conflicts import ConflictDetector
detector = ConflictDetector()
conflicts = detector.detect_conflicts(kg)
for conflict in conflicts:
print(f"Conflict on '{conflict.entity}' — {conflict.attribute}")
print(f" Source A: {conflict.value_a} (from {conflict.source_a})")
print(f" Source B: {conflict.value_b} (from {conflict.source_b})")
print(f" Type: {conflict.conflict_type}")
Detection Types
# Detect specific types only
conflicts = detector.detect_conflicts(
kg,
types=["value", "temporal"] # value | type | temporal | logical
)
Value conflicts — same entity, same attribute, different values across sources. Type conflicts — same entity classified as different types in different sources. Temporal conflicts — overlapping validity windows with contradictory facts. Logical conflicts — facts that violate ontology axioms or constraints.
Conflict Resolution
from semantica.conflicts import ConflictResolver
resolver = ConflictResolver()
resolved_kg = resolver.resolve(
kg,
conflicts,
strategy="most_recent" # see strategies below
)
Resolution strategies:
| Strategy | Description |
|---|---|
most_recent |
Prefer the most recently updated fact |
most_reliable |
Prefer the source with the highest reliability score |
majority_vote |
Use the value agreed upon by most sources |
highest_confidence |
Prefer the fact with the highest confidence score |
flag_for_review |
Mark conflicting facts for manual resolution |
Source Reliability Scoring
resolver = ConflictResolver(
source_reliability={
"pubmed": 0.95,
"wikipedia": 0.80,
"user_input": 0.60
}
)
resolved_kg = resolver.resolve(kg, conflicts, strategy="most_reliable")
Conflict Report
report = detector.generate_report(conflicts)
print(f"Total conflicts: {report.total}")
print(f"By type: {report.by_type}")
print(f"Most conflicted entities: {report.top_entities[:5]}")
report.export("conflicts.json")