{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Hawksight-AI/semantica/blob/main/cookbook/introduction/18_Conflict_Detection.ipynb)\n",
    "\n",
    "# Conflict Detection\n",
    "\n",
    "## Overview\n",
    "\n",
    "This notebook demonstrates how to detect and resolve conflicts in knowledge graphs using Semantica's conflict modules. You'll learn to use `ConflictDetector`, `SourceTracker`, and `ConflictResolver`.\n",
    "\n",
    "**Documentation**: [API Reference](https://semantica.readthedocs.io/reference/conflicts/)\n",
    "\n",
    "### Learning Objectives\n",
    "\n",
    "- Use `ConflictDetector` to detect conflicts\n",
    "- Use `SourceTracker` to track data sources\n",
    "- Use `ConflictResolver` to resolve conflicts\n",
    "\n",
    "## Installation\n",
    "\n",
    "Install Semantica from PyPI:\n",
    "\n",
    "```bash\n",
    "pip install semantica\n",
    "# Or with all optional dependencies:\n",
    "pip install semantica[all]\n",
    "```\n",
    "\n",
    "---\n",
    "\n",
    "## Step 1: Conflict Detection\n",
    "\n",
    "Detect conflicts in entities.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import ConflictDetector\n",
    "from datetime import datetime\n",
    "\n",
    "# Initialize detector with configuration\n",
    "detector = ConflictDetector(\n",
    "    confidence_threshold=0.7,\n",
    "    track_provenance=True,\n",
    "    conflict_fields={\"Company\": [\"name\", \"founded\", \"revenue\"]}\n",
    ")\n",
    "\n",
    "# Sample entities from multiple sources\n",
    "entities = [\n",
    "    {\"id\": \"e1\", \"name\": \"Apple Inc.\", \"founded\": 1976, \"type\": \"Company\", \n",
    "     \"source\": \"wikipedia\", \"confidence\": 0.9},\n",
    "    {\"id\": \"e1\", \"name\": \"Apple Incorporated\", \"founded\": 1976, \"type\": \"Company\",\n",
    "     \"source\": \"official_site\", \"confidence\": 0.95},\n",
    "    {\"id\": \"e1\", \"name\": \"Apple Inc.\", \"founded\": 1977, \"type\": \"Company\",\n",
    "     \"source\": \"news\", \"confidence\": 0.7},\n",
    "    {\"id\": \"e2\", \"name\": \"Microsoft\", \"type\": \"Company\", \"founded\": 1975, \"source\": \"source1\"},\n",
    "    {\"id\": \"e2\", \"name\": \"Microsoft Corporation\", \"type\": \"Organization\", \n",
    "     \"founded\": 1975, \"source\": \"source2\"},\n",
    "]\n",
    "\n",
    "# 1.1 Value Conflict Detection\n",
    "value_conflicts = detector.detect_value_conflicts(entities, \"name\")\n",
    "\n",
    "# 1.2 Type Conflict Detection\n",
    "type_conflicts = detector.detect_type_conflicts(entities)\n",
    "\n",
    "# 1.3 Temporal Conflict Detection\n",
    "temporal_conflicts = detector.detect_temporal_conflicts(entities)\n",
    "\n",
    "# 1.4 Logical Conflict Detection\n",
    "logical_entities = [\n",
    "    {\"id\": \"e3\", \"type\": \"Person\", \"name\": \"John Doe\", \"source\": \"source1\"},\n",
    "    {\"id\": \"e3\", \"type\": \"Organization\", \"name\": \"John Doe\", \"source\": \"source2\"},\n",
    "]\n",
    "logical_conflicts = detector.detect_logical_conflicts(logical_entities)\n",
    "\n",
    "# 1.5 Relationship Conflict Detection\n",
    "relationships = [\n",
    "    {\"id\": \"rel1\", \"source_id\": \"e1\", \"target_id\": \"e2\", \"type\": \"competes_with\", \"source\": \"source1\"},\n",
    "    {\"id\": \"rel1\", \"source_id\": \"e1\", \"target_id\": \"e2\", \"type\": \"partners_with\", \"source\": \"source2\"},\n",
    "]\n",
    "rel_conflicts = detector.detect_relationship_conflicts(relationships)\n",
    "\n",
    "# 1.6 General Conflict Detection (all types)\n",
    "all_conflicts = detector.detect_conflicts(entities)\n",
    "\n",
    "# Get conflict report\n",
    "report = detector.get_conflict_report()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 2: Source Tracking\n",
    "\n",
    "Track data sources.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import SourceTracker, SourceReference\n",
    "from datetime import datetime\n",
    "\n",
    "# Initialize source tracker\n",
    "tracker = SourceTracker()\n",
    "\n",
    "# Create source references with metadata\n",
    "source1 = SourceReference(\n",
    "    document=\"wikipedia\",\n",
    "    page=1,\n",
    "    section=\"Company Information\",\n",
    "    timestamp=datetime(2023, 1, 15),\n",
    "    confidence=0.9\n",
    ")\n",
    "\n",
    "source2 = SourceReference(\n",
    "    document=\"official_site\",\n",
    "    section=\"About Us\",\n",
    "    timestamp=datetime(2023, 3, 20),\n",
    "    confidence=0.95\n",
    ")\n",
    "\n",
    "# Track property sources\n",
    "tracker.track_property_source(\"e1\", \"name\", \"Apple Inc.\", source1)\n",
    "tracker.track_property_source(\"e1\", \"name\", \"Apple Incorporated\", source2)\n",
    "tracker.track_property_source(\"e1\", \"founded\", 1976, source1)\n",
    "\n",
    "# Track entity sources\n",
    "tracker.track_entity_source(\"e1\", source1)\n",
    "\n",
    "# Set source credibility scores\n",
    "tracker.set_source_credibility(\"wikipedia\", 0.85)\n",
    "tracker.set_source_credibility(\"official_site\", 0.95)\n",
    "\n",
    "# Retrieve property sources\n",
    "prop_source = tracker.get_property_sources(\"e1\", \"name\")\n",
    "\n",
    "# Get entity sources\n",
    "entity_sources = tracker.get_entity_sources(\"e1\")\n",
    "\n",
    "# Get all source credibilities\n",
    "all_credibilities = tracker.get_all_source_credibilities()\n",
    "\n",
    "# Generate traceability chain\n",
    "chain = tracker.generate_traceability_chain(\"e1\", \"name\")\n",
    "\n",
    "# Generate source report\n",
    "report = tracker.generate_source_report(\"e1\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Step 3: Conflict Resolution\n",
    "\n",
    "Resolve conflicts using ConflictResolver.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import ConflictResolver\n",
    "\n",
    "# Initialize resolver with source tracker\n",
    "resolver = ConflictResolver(\n",
    "    default_strategy=\"voting\",\n",
    "    source_tracker=tracker\n",
    ")\n",
    "\n",
    "# Resolve conflicts using different strategies\n",
    "if value_conflicts:\n",
    "    # Voting strategy\n",
    "    voting_results = resolver.resolve_conflicts(value_conflicts, strategy=\"voting\")\n",
    "    \n",
    "    # Credibility-weighted strategy\n",
    "    credibility_results = resolver.resolve_conflicts(value_conflicts, strategy=\"credibility_weighted\")\n",
    "    \n",
    "    # Most recent strategy\n",
    "    recent_results = resolver.resolve_conflicts(value_conflicts, strategy=\"most_recent\")\n",
    "    \n",
    "    # Highest confidence strategy\n",
    "    confidence_results = resolver.resolve_conflicts(value_conflicts, strategy=\"highest_confidence\")\n",
    "    \n",
    "    # First seen strategy\n",
    "    first_seen_results = resolver.resolve_conflicts(value_conflicts, strategy=\"first_seen\")\n",
    "    \n",
    "    # Manual review strategy\n",
    "    manual_results = resolver.resolve_conflicts(value_conflicts, strategy=\"manual_review\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Summary\n",
    "\n",
    "You've learned how to detect and resolve conflicts:\n",
    "\n",
    "- **ConflictDetector**: Detect conflicts in entities\n",
    "- **SourceTracker**: Track data sources\n",
    "- **ConflictResolver**: Resolve conflicts using various strategies\n",
    "\n",
    "Next: Learn about configuration in the Configuration notebook.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import ConflictAnalyzer\n",
    "\n",
    "# Initialize analyzer\n",
    "analyzer = ConflictAnalyzer()\n",
    "\n",
    "# Comprehensive analysis\n",
    "analysis = analyzer.analyze_conflicts(all_conflicts)\n",
    "\n",
    "# Analysis by type, severity, and source\n",
    "by_type = analysis['by_type']['counts']\n",
    "by_severity = analysis['by_severity']['counts']\n",
    "by_source = analysis['by_source']['counts']\n",
    "\n",
    "# Top entities and properties\n",
    "top_entities = analysis['by_entity']['top_entities']\n",
    "top_properties = analysis['by_property']['top_properties']\n",
    "\n",
    "# Patterns and recommendations\n",
    "patterns = analysis['patterns']\n",
    "recommendations = analysis['recommendations']\n",
    "\n",
    "# Trend analysis\n",
    "trends = analyzer.analyze_trends(all_conflicts)\n",
    "\n",
    "# Generate insights report\n",
    "insights = analyzer.generate_insights_report(all_conflicts)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part 5: Investigation Guides\n",
    "\n",
    "`InvestigationGuideGenerator` creates guides for manual review.\n",
    "\n",
    "**Guide Components:**\n",
    "- Conflict summary, investigation steps, recommended actions\n",
    "- Source information, context, severity assessment\n",
    "\n",
    "**Use Cases:** High-severity conflicts, ambiguous cases, compliance, QA workflows\n",
    "\n",
    "**Export Formats:** Markdown checklists, detailed reports, structured context\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import InvestigationGuideGenerator\n",
    "\n",
    "# Initialize guide generator\n",
    "guide_generator = InvestigationGuideGenerator(source_tracker=tracker)\n",
    "\n",
    "# Generate guide for a conflict\n",
    "if value_conflicts:\n",
    "    guide = guide_generator.generate_guide(value_conflicts[0])\n",
    "\n",
    "# Generate guides for multiple conflicts\n",
    "guides = guide_generator.generate_guides(value_conflicts[:3])\n",
    "\n",
    "# Export checklist\n",
    "checklist = guide_generator.export_investigation_checklist(guide, format=\"markdown\")\n",
    "\n",
    "# Generate conflict report\n",
    "conflict_report = guide_generator.generate_conflict_report(value_conflicts, format=\"detailed\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part 6: Methods Module\n",
    "\n",
    "`semantica.conflicts.methods` provides convenience functions for functional-style access.\n",
    "\n",
    "**Functions:**\n",
    "- `detect_conflicts()`: Methods: `value`, `type`, `temporal`, `logical`, `relationship`\n",
    "- `resolve_conflicts()`: Methods: `voting`, `credibility_weighted`, `most_recent`, `highest_confidence`, `first_seen`, `manual_review`\n",
    "- `analyze_conflicts()`: Methods: `pattern`, `type`, `severity`, `source`, `trend`\n",
    "- `track_sources()`: Methods: `property`, `entity`, `relationship`\n",
    "- `generate_investigation_guide()`: Methods: `guide`, `checklist`, `context`\n",
    "- `list_available_methods()`: List all methods by task type\n",
    "- `get_conflict_method()`: Retrieve specific method function\n",
    "\n",
    "**Benefits:** Simpler API, method discovery, consistent interface, extensible\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts.methods import (\n",
    "    detect_conflicts,\n",
    "    resolve_conflicts,\n",
    "    analyze_conflicts,\n",
    "    track_sources,\n",
    "    generate_investigation_guide,\n",
    "    list_available_methods,\n",
    "    get_conflict_method\n",
    ")\n",
    "\n",
    "# Detection methods\n",
    "value_conflicts_method = detect_conflicts(entities, method=\"value\", property_name=\"name\")\n",
    "type_conflicts_method = detect_conflicts(entities, method=\"type\")\n",
    "temporal_conflicts_method = detect_conflicts(entities, method=\"temporal\")\n",
    "logical_conflicts_method = detect_conflicts(logical_entities, method=\"logical\")\n",
    "\n",
    "# Resolution methods\n",
    "if value_conflicts_method:\n",
    "    voting_results = resolve_conflicts(value_conflicts_method, method=\"voting\")\n",
    "    credibility_results = resolve_conflicts(value_conflicts_method, method=\"credibility_weighted\")\n",
    "\n",
    "# Analysis methods\n",
    "pattern_analysis = analyze_conflicts(all_conflicts, method=\"pattern\")\n",
    "type_analysis = analyze_conflicts(all_conflicts, method=\"type\")\n",
    "severity_analysis = analyze_conflicts(all_conflicts, method=\"severity\")\n",
    "source_analysis = analyze_conflicts(all_conflicts, method=\"source\")\n",
    "trend_analysis = analyze_conflicts(all_conflicts, method=\"trend\")\n",
    "\n",
    "# Source tracking methods\n",
    "source_ref = SourceReference(document=\"test_source\", confidence=0.9)\n",
    "track_sources(\"e1\", method=\"property\", property_name=\"name\", value=\"Test\", source=source_ref)\n",
    "track_sources(\"e1\", method=\"entity\", source=source_ref)\n",
    "\n",
    "# Investigation guide methods\n",
    "if value_conflicts_method:\n",
    "    guide_method = generate_investigation_guide(value_conflicts_method[0], method=\"guide\")\n",
    "    checklist_method = generate_investigation_guide(value_conflicts_method[0], method=\"checklist\")\n",
    "    context_method = generate_investigation_guide(value_conflicts_method[0], method=\"context\")\n",
    "\n",
    "# List available methods\n",
    "all_methods = list_available_methods()\n",
    "\n",
    "# Get specific method\n",
    "voting_method = get_conflict_method(\"resolution\", \"voting\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part 7: Method Registry\n",
    "\n",
    "`method_registry` provides a plugin system for custom methods.\n",
    "\n",
    "**Registration:** Task type (`detection`, `resolution`, `analysis`, `tracking`, `investigation`), method name, function\n",
    "\n",
    "**Use Cases:**\n",
    "- Domain-specific resolution logic\n",
    "- External system integration\n",
    "- A/B testing strategies\n",
    "- ML model integration\n",
    "- Hybrid resolution approaches\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import method_registry, ResolutionResult\n",
    "\n",
    "# Register custom resolution method\n",
    "def custom_resolution(conflicts, **kwargs):\n",
    "    \"\"\"Custom resolution that always picks the first value.\"\"\"\n",
    "    results = []\n",
    "    for conflict in conflicts:\n",
    "        if conflict.conflicting_values:\n",
    "            result = ResolutionResult(\n",
    "                conflict_id=conflict.conflict_id,\n",
    "                resolved=True,\n",
    "                resolved_value=conflict.conflicting_values[0],\n",
    "                resolution_strategy=\"custom_first\",\n",
    "                confidence=0.8,\n",
    "                resolution_notes=\"Custom: Always use first value\"\n",
    "            )\n",
    "            results.append(result)\n",
    "    return results\n",
    "\n",
    "# Register the custom method\n",
    "method_registry.register(\"resolution\", \"custom_first\", custom_resolution)\n",
    "\n",
    "# List registered methods\n",
    "registered = method_registry.list_all(\"resolution\")\n",
    "\n",
    "# Use custom method\n",
    "if value_conflicts:\n",
    "    custom_results = resolve_conflicts(value_conflicts, method=\"custom_first\")\n",
    "\n",
    "# Unregister method\n",
    "method_registry.unregister(\"resolution\", \"custom_first\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part 8: Configuration\n",
    "\n",
    "`ConflictsConfig` manages settings programmatically, via environment variables, or method-specific.\n",
    "\n",
    "**Global Settings:**\n",
    "- `confidence_threshold`, `default_strategy`, `auto_resolve`, `track_provenance`\n",
    "\n",
    "**Method-Specific:** Voting (`min_sources`, `tie_breaker`), credibility-weighted (`min_credibility`), most_recent (`time_field`), etc.\n",
    "\n",
    "**Priority:** Method-specific → Global → Environment variables → Defaults\n",
    "\n",
    "**Best Practices:** Set source credibility early, configure conflict fields, use method-specific configs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from semantica.conflicts import ConflictsConfig, conflicts_config\n",
    "\n",
    "# Using global config instance\n",
    "conflicts_config.set(\"confidence_threshold\", 0.8)\n",
    "conflicts_config.set(\"default_strategy\", \"credibility_weighted\")\n",
    "threshold = conflicts_config.get(\"confidence_threshold\", default=0.7)\n",
    "\n",
    "# Method-specific configuration\n",
    "conflicts_config.set_method_config(\"voting\", min_sources=2, tie_breaker=\"confidence\")\n",
    "conflicts_config.set_method_config(\"credibility_weighted\", min_credibility=0.5)\n",
    "voting_config = conflicts_config.get_method_config(\"voting\")\n",
    "\n",
    "# Create custom config instance\n",
    "custom_config = ConflictsConfig()\n",
    "custom_config.set(\"confidence_threshold\", 0.9)\n",
    "custom_config.set(\"auto_resolve\", True)\n",
    "all_config = custom_config.get_all()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Part 9: Complete Workflow\n",
    "\n",
    "End-to-end example: integrating company data from multiple sources.\n",
    "\n",
    "**Workflow:** Initialize → Track Sources → Detect → Resolve → Analyze → Generate Guides → Build Final Entity\n",
    "\n",
    "**Scenario:** Three sources (Wikipedia, Official Site, Financial DB) with conflicts in name, founding year, and type classifications.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Complete workflow: Company data integration from multiple sources\n",
    "from semantica.conflicts import (\n",
    "    ConflictDetector, ConflictResolver, ConflictAnalyzer,\n",
    "    SourceTracker, InvestigationGuideGenerator, SourceReference\n",
    ")\n",
    "\n",
    "# Sample company data from multiple sources\n",
    "company_data = [\n",
    "    {\"id\": \"company_1\", \"name\": \"Apple Inc.\", \"founded\": 1976, \"revenue\": 394328000000,\n",
    "     \"headquarters\": \"Cupertino, California\", \"type\": \"Company\",\n",
    "     \"source\": \"wikipedia\", \"confidence\": 0.85, \"timestamp\": datetime(2023, 1, 15)},\n",
    "    {\"id\": \"company_1\", \"name\": \"Apple Inc.\", \"founded\": 1976, \"revenue\": 394328000000,\n",
    "     \"headquarters\": \"Cupertino, CA\", \"type\": \"Company\",\n",
    "     \"source\": \"official_site\", \"confidence\": 0.95, \"timestamp\": datetime(2023, 3, 20)},\n",
    "    {\"id\": \"company_1\", \"name\": \"Apple Incorporated\", \"founded\": 1977, \"revenue\": 394328000000,\n",
    "     \"headquarters\": \"Cupertino\", \"type\": \"Organization\",\n",
    "     \"source\": \"financial_db\", \"confidence\": 0.80, \"timestamp\": datetime(2023, 2, 10)},\n",
    "]\n",
    "\n",
    "# Initialize all components\n",
    "detector = ConflictDetector(\n",
    "    confidence_threshold=0.7,\n",
    "    track_provenance=True,\n",
    "    conflict_fields={\"Company\": [\"name\", \"founded\", \"revenue\", \"headquarters\"]}\n",
    ")\n",
    "\n",
    "tracker = SourceTracker()\n",
    "tracker.set_source_credibility(\"wikipedia\", 0.85)\n",
    "tracker.set_source_credibility(\"official_site\", 0.95)\n",
    "tracker.set_source_credibility(\"financial_db\", 0.80)\n",
    "\n",
    "resolver = ConflictResolver(default_strategy=\"credibility_weighted\", source_tracker=tracker)\n",
    "analyzer = ConflictAnalyzer()\n",
    "guide_generator = InvestigationGuideGenerator(source_tracker=tracker)\n",
    "\n",
    "# Step 1: Track sources\n",
    "for entity in company_data:\n",
    "    source_ref = SourceReference(\n",
    "        document=entity[\"source\"],\n",
    "        confidence=entity[\"confidence\"],\n",
    "        timestamp=entity[\"timestamp\"]\n",
    "    )\n",
    "    tracker.track_property_source(entity[\"id\"], \"name\", entity[\"name\"], source_ref)\n",
    "    tracker.track_property_source(entity[\"id\"], \"founded\", entity[\"founded\"], source_ref)\n",
    "\n",
    "# Step 2: Detect conflicts\n",
    "detected_conflicts = detector.detect_entity_conflicts(company_data, entity_type=\"Company\")\n",
    "\n",
    "# Step 3: Resolve conflicts\n",
    "resolved_data = {}\n",
    "for conflict in detected_conflicts:\n",
    "    results = resolver.resolve_conflicts([conflict], strategy=\"credibility_weighted\")\n",
    "    if results[0].resolved:\n",
    "        resolved_data[conflict.property_name] = results[0].resolved_value\n",
    "\n",
    "# Step 4: Analyze\n",
    "analysis = analyzer.analyze_conflicts(detected_conflicts)\n",
    "\n",
    "# Step 5: Generate guides for unresolved conflicts\n",
    "unresolved = [c for c in detected_conflicts if c.property_name not in resolved_data]\n",
    "if unresolved:\n",
    "    guides = guide_generator.generate_guides(unresolved)\n",
    "\n",
    "# Final resolved entity\n",
    "final_entity = {\"id\": \"company_1\", \"type\": \"Company\", **resolved_data}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Summary\n",
    "\n",
    "### Key Features\n",
    "\n",
    "✅ **Detection**: Value, type, temporal, logical, relationship conflicts  \n",
    "✅ **Resolution**: 6 strategies (voting, credibility-weighted, most_recent, first_seen, highest_confidence, manual_review)  \n",
    "✅ **Source Tracking**: Provenance, credibility, traceability chains  \n",
    "✅ **Analysis**: Patterns, trends, recommendations  \n",
    "✅ **Investigation Guides**: Automated guides and checklists  \n",
    "✅ **Methods Module**: Convenience functions for all operations  \n",
    "✅ **Method Registry**: Custom method registration  \n",
    "✅ **Configuration**: Global and method-specific settings\n",
    "\n",
    "### Best Practices\n",
    "\n",
    "1. Set source credibility before detection\n",
    "2. Choose strategies based on data characteristics\n",
    "3. Enable provenance tracking for audits\n",
    "4. Analyze patterns before resolving\n",
    "5. Use guides for high-severity conflicts\n",
    "6. Configure conflict fields to focus on critical properties\n",
    "\n",
    "### Common Patterns\n",
    "\n",
    "- **Integration**: Track → Detect → Resolve → Analyze\n",
    "- **QA**: Detect → Analyze → Generate guides → Review\n",
    "- **Auto**: Detect → Resolve → Analyze\n",
    "- **Assessment**: Track → Analyze → Adjust credibility\n",
    "\n",
    "### Next Steps\n",
    "\n",
    "- `04_Conflict_Resolution_Strategies.ipynb` - Advanced strategies\n",
    "- `06_Multi_Source_Data_Integration.ipynb` - Integration workflows\n",
    "- [API Reference](https://semantica.readthedocs.io/reference/conflicts/)\n",
    "- [Usage Guide](../semantica/conflicts/conflicts_usage.md)\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
