{
 "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/use_cases/intelligence/02_Intelligence_Analysis_Orchestrator_Worker.ipynb)\n",
    "\n",
    "# Intelligence Analysis - Multi-Source Integration & Temporal Analysis\n",
    "\n",
    "## Overview\n",
    "\n",
    "This notebook demonstrates **intelligence analysis with multi-source integration** using Semantica with focus on **parallel processing**, **conflict resolution**, and **temporal analysis**. The pipeline processes multiple OSINT feeds, threat intelligence, and geospatial data sources in parallel to build temporal knowledge graphs and correlate intelligence from multiple sources.\n",
    "\n",
    "### Key Features\n",
    "\n",
    "- **Parallel Processing**: Processes multiple intelligence sources simultaneously using stream ingestion\n",
    "- **Multi-Source Integration**: Integrates OSINT feeds, threat intelligence, and geospatial data\n",
    "- **Conflict Resolution**: Detects and resolves conflicts from multiple intelligence sources\n",
    "- **Temporal Analysis**: Time-aware intelligence analysis with temporal graph queries\n",
    "- **Multi-Source Correlation**: Correlates intelligence from multiple sources using reasoning\n",
    "- **Hybrid RAG**: Combines multiple intelligence sources for comprehensive analysis\n",
    "\n",
    "### Learning Objectives\n",
    "\n",
    "- Understand how to process multiple intelligence sources in parallel\n",
    "- Learn to detect and resolve conflicts from multiple sources\n",
    "- Master temporal analysis for time-aware intelligence queries\n",
    "- Explore multi-source correlation and reasoning\n",
    "- Practice parallel data ingestion and stream processing\n",
    "- Analyze temporal patterns in intelligence data\n",
    "\n",
    "### Pipeline Flow\n",
    "\n",
    "```mermaid\n",
    "graph TD\n",
    "    A[Parallel Data Ingestion] --> B[Document Parsing]\n",
    "    B --> C[Text Processing]\n",
    "    C --> D[Entity Extraction]\n",
    "    D --> E[Relationship Extraction]\n",
    "    E --> F[Deduplication]\n",
    "    F --> G[Conflict Detection]\n",
    "    G --> H[Temporal KG Construction]\n",
    "    H --> I[Embedding Generation]\n",
    "    I --> J[Vector Store]\n",
    "    H --> K[Multi-Source Correlation]\n",
    "    H --> L[Temporal Queries]\n",
    "    J --> M[GraphRAG Queries]\n",
    "    K --> N[Visualization]\n",
    "    L --> N\n",
    "    H --> O[Export]\n",
    "```\n",
    "\n",
    "\n",
    "---\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: Ignoring invalid distribution ~gno (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~lotly (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~ython-socketio (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~gno (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~lotly (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~ython-socketio (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~gno (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~lotly (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n",
      "WARNING: Ignoring invalid distribution ~ython-socketio (c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages)\n"
     ]
    }
   ],
   "source": [
    "%pip install -qU semantica networkx matplotlib plotly pandas faiss-cpu beautifulsoup4 groq sentence-transformers scikit-learn\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Configuration & Setup\n",
    "\n",
    "Configure API keys and set up constants for the intelligence analysis pipeline, including temporal granularity for time-aware analysis.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "os.environ[\"GROQ_API_KEY\"] = os.getenv(\"GROQ_API_KEY\", \"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\")\n",
    "\n",
    "# Configuration constants\n",
    "EMBEDDING_DIMENSION = 384\n",
    "EMBEDDING_MODEL = \"sentence-transformers/all-MiniLM-L6-v2\"\n",
    "CHUNK_SIZE = 1000\n",
    "CHUNK_OVERLAP = 200\n",
    "TEMPORAL_GRANULARITY = \"day\"  # For temporal intelligence analysis\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Parallel Data Ingestion\n",
    "\n",
    "Ingest intelligence data from multiple sources in parallel including RSS feeds, streams, web APIs, and local files.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is ingesting: File: intelligence.txt 🔄📥 (0.0s) | 🧠 Semantica is ingesting: Feed: https://www.us-cert.gov/ncas/alerts.xml 🔄📥 (0.0s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\dateutil\\parser\\_parser.py:1207: UnknownTimezoneWarning: tzname EST identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a future version, this will raise an exception.\n",
      "  warnings.warn(\"tzname {tzname} identified but not understood.  \"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is ingesting: File: intelligence.txt 🔄📥 (0.0s) | 🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥  [1/14] Feed: 10 documents\n",
      "🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥  [2/14] Feed: 10 documents\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to parse feed: not well-formed (invalid token): line 5, column 14\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Failed to parse feed: not well-formed (invalid token): line 5, column 14 ❌📥 (19.3s)  [3/14] Feed failed: Failed to parse feed: not well-formed (invalid tok\n",
      "🧠 Semantica is ingesting: Failed to parse feed: not well-formed (invalid token): line 5, column 14 ❌📥 (19.3s) | 🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥  [4/14] Feed: 10 documents\n",
      "🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥  [5/14] Feed: 10 documents\n",
      "🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested 50 items |███████████████| 100.0% ✅📥  [6/14] Feed: 50 documents\n",
      "🧠 Semantica is ingesting: Ingested 50 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥  [7/14] Feed: 10 documents\n",
      "🧠 Semantica is ingesting: Ingested 10 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.bleepingcomputer.com/feed/ ❌📥 (0.6s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.bleepingcomputer.com/feed/: 403 Client Error: Forbidden for url: https://www.bleepingcomputer.com/feed/\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [8/14] Feed failed: Failed to fetch feed: 403 Client Error: Forbidden \n",
      "🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.bleepingcomputer.com/feed/ ❌📥 (0.6s) | 🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.securityweek.com/rss ❌📥 (0.5s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.securityweek.com/rss: 403 Client Error: Forbidden for url: https://www.securityweek.com/rss\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [9/14] Feed failed: Failed to fetch feed: 403 Client Error: Forbidden \n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Feed https://www.infosecurity-magazine.com/rss/news/ validation failed\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.securityweek.com/rss ❌📥 (0.5s) | 🧠 Semantica is ingesting: Ingested 12 items |███████████████| 100.0% ✅📥  [10/14] Feed: 12 documents\n",
      "🧠 Semantica is ingesting: Ingested 12 items |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.csoonline.com/index.rss ❌📥 (2.1s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.csoonline.com/index.rss: 404 Client Error: Not Found for url: https://www.csoonline.com/index.rss\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [11/14] Feed failed: Failed to fetch feed: 404 Client Error: Not Found \n",
      "🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.csoonline.com/index.rss ❌📥 (2.1s) | 🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.cisa.gov/news-events/cybersecurity-advisories/rss.xml ❌📥 (0.8s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.cisa.gov/news-events/cybersecurity-advisories/rss.xml: 404 Client Error: Not Found for url: https://www.cisa.gov/news-events/cybersecurity-advisories/rss.xml\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [12/14] Feed failed: Failed to fetch feed: 404 Client Error: Not Found \n",
      "🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.cisa.gov/news-events/cybersecurity-advisories/rss.xml ❌📥 (0.8s) | 🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.ncsc.gov.uk/news/rss ❌📥 (1.2s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.ncsc.gov.uk/news/rss: 404 Client Error: Not Found for url: https://www.ncsc.gov.uk/news/rss\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [13/14] Feed failed: Failed to fetch feed: 404 Client Error: Not Found \n",
      "🧠 Semantica is ingesting: 404 Client Error: Not Found for url: https://www.ncsc.gov.uk/news/rss ❌📥 (1.2s) | 🧠 Semantica is ingesting: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30) ❌📥 (30.5s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch feed https://www.cyber.gov.au/news/rss: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [14/14] Feed failed: Failed to fetch feed: HTTPSConnectionPool(host='ww\n",
      "🧠 Semantica is ingesting: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30) ❌📥 (30.5s) | 🧠 Semantica is ingesting: Ingested https://www.interpol.int/en/How-we-work/Notices/View-Red-Notices (200) |███████████████| 100.0% ✅📥  [1/9] Web: 3133 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.interpol.int/en/How-we-work/Notices/View-Red-Notices (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested https://www.unodc.org/unodc/en/data-and-analysis/index.html (200) |███████████████| 100.0% ✅📥  [2/9] Web: 3861 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.unodc.org/unodc/en/data-and-analysis/index.html (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested https://www.cisa.gov/news-events/cybersecurity-advisories (200) |███████████████| 100.0% ✅📥  [3/9] Web: 8501 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.cisa.gov/news-events/cybersecurity-advisories (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested https://www.us-cert.gov/ncas/alerts (200) |███████████████| 100.0% ✅📥  [4/9] Web: 8501 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.us-cert.gov/ncas/alerts (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested https://www.europol.europa.eu/newsroom (200) |███████████████| 100.0% ✅📥  [5/9] Web: 96 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.europol.europa.eu/newsroom (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: Ingested https://www.ncsc.gov.uk/news (200) |███████████████| 100.0% ✅📥  [6/9] Web: 50 characters\n",
      "🧠 Semantica is ingesting: Ingested https://www.ncsc.gov.uk/news (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is ingesting: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Max retries exceeded with url: /news (Caused by ReadTimeoutError(\"HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30)\")) ❌📥 (119.5s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch URL https://www.cyber.gov.au/news: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Max retries exceeded with url: /news (Caused by ReadTimeoutError(\"HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30)\"))\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [7/9] Web failed: Failed to fetch URL: HTTPSConnectionPool(host='www\n",
      "🧠 Semantica is ingesting: HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Max retries exceeded with url: /news (Caused by ReadTimeoutError(\"HTTPSConnectionPool(host='www.cyber.gov.au', port=443): Read timed out. (read timeout=30)\")) ❌📥 (119.5s) | 🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.fbi.gov/wanted/cyber ❌📥 (0.5s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Failed to fetch URL https://www.fbi.gov/wanted/cyber: 403 Client Error: Forbidden for url: https://www.fbi.gov/wanted/cyber\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [8/9] Web failed: Failed to fetch URL: 403 Client Error: Forbidden f\n",
      "🧠 Semantica is ingesting: 403 Client Error: Forbidden for url: https://www.fbi.gov/wanted/cyber ❌📥 (0.5s) | 🧠 Semantica is ingesting: Ingested https://www.dhs.gov/news (200) |███████████████| 100.0% ✅📥  [9/9] Web: 4617 characters\n",
      "Ingested 119 documents from multiple sources\n"
     ]
    }
   ],
   "source": [
    "from semantica.ingest import FeedIngestor, WebIngestor\n",
    "import os\n",
    "\n",
    "os.makedirs(\"data\", exist_ok=True)\n",
    "\n",
    "documents = []\n",
    "\n",
    "# Ingest from multiple OSINT RSS feeds\n",
    "osint_feeds = [\n",
    "    \"https://www.us-cert.gov/ncas/alerts.xml\",\n",
    "    \"https://www.europol.europa.eu/rss.xml\",\n",
    "    \"https://www.treasury.gov/resource-center/sanctions/OFAC-Enforcement/Pages/rss.xml\",\n",
    "    \"https://krebsonsecurity.com/feed/\",\n",
    "    \"https://www.schneier.com/feed/\",\n",
    "    \"https://www.darkreading.com/rss.xml\",\n",
    "    \"https://threatpost.com/feed/\",\n",
    "    \"https://www.bleepingcomputer.com/feed/\",\n",
    "    \"https://www.securityweek.com/rss\",\n",
    "    \"https://www.infosecurity-magazine.com/rss/news/\",\n",
    "    \"https://www.csoonline.com/index.rss\",\n",
    "    \"https://www.cisa.gov/news-events/cybersecurity-advisories/rss.xml\",\n",
    "    \"https://www.ncsc.gov.uk/news/rss\",\n",
    "    \"https://www.cyber.gov.au/news/rss\"\n",
    "]\n",
    "\n",
    "feed_ingestor = FeedIngestor()\n",
    "for i, feed_url in enumerate(osint_feeds, 1):\n",
    "    try:\n",
    "        feed_data = feed_ingestor.ingest_feed(feed_url, validate=False)\n",
    "        \n",
    "        feed_count = 0\n",
    "        for item in feed_data.items:\n",
    "            if not item.content:\n",
    "                item.content = item.description or item.title or \"\"\n",
    "            if item.content:\n",
    "                if not hasattr(item, 'metadata'):\n",
    "                    item.metadata = {}\n",
    "                item.metadata['source'] = feed_url\n",
    "                documents.append(item)\n",
    "                feed_count += 1\n",
    "        \n",
    "        print(f\"  [{i}/{len(osint_feeds)}] Feed: {feed_count} documents\")\n",
    "    except Exception as e:\n",
    "        print(f\"  [{i}/{len(osint_feeds)}] Feed failed: {str(e)[:50]}\")\n",
    "\n",
    "# Web ingestion from various intelligence and security sources\n",
    "web_links = [\n",
    "    \"https://www.interpol.int/en/How-we-work/Notices/View-Red-Notices\",\n",
    "    \"https://www.unodc.org/unodc/en/data-and-analysis/index.html\",\n",
    "    \"https://www.cisa.gov/news-events/cybersecurity-advisories\",\n",
    "    \"https://www.us-cert.gov/ncas/alerts\",\n",
    "    \"https://www.europol.europa.eu/newsroom\",\n",
    "    \"https://www.ncsc.gov.uk/news\",\n",
    "    \"https://www.cyber.gov.au/news\",\n",
    "    \"https://www.fbi.gov/wanted/cyber\",\n",
    "    \"https://www.dhs.gov/news\"\n",
    "]\n",
    "\n",
    "web_ingestor = WebIngestor(respect_robots=False, delay=1.0)\n",
    "for i, web_url in enumerate(web_links, 1):\n",
    "    try:\n",
    "        web_content = web_ingestor.ingest_url(web_url)\n",
    "        if web_content and web_content.text:\n",
    "            web_content.content = web_content.text\n",
    "            if not hasattr(web_content, 'metadata'):\n",
    "                web_content.metadata = {}\n",
    "            web_content.metadata['source'] = web_url\n",
    "            documents.append(web_content)\n",
    "            print(f\"  [{i}/{len(web_links)}] Web: {len(web_content.text)} characters\")\n",
    "    except Exception as e:\n",
    "        print(f\"  [{i}/{len(web_links)}] Web failed: {str(e)[:50]}\")\n",
    "\n",
    "print(f\"Ingested {len(documents)} documents from multiple sources\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Parsing 119 documents...\n",
      "🧠 Semantica is ingesting: Ingested https://www.dhs.gov/news (200) |███████████████| 100.0% ✅📥 | 🧠 Semantica is parsing: Document: p>\n",
      " 🔄🔍 (0.0s)"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is parsing: Document: p>                                                                                   \n",
      "🧠 Semantica is parsing: Document: On the surface, the Superbox media streaming devices for sale at retailers like BestBuy and Walmart may seem like a steal: They offer unlimited access to more than 2,200 pay-per-view and streaming services like Netflix, ESPN and Hulu, all for a one-time fee of around $400. But security experts warn these TV boxes require intrusive software that forces the user's network to relay Internet traffic for others, traffic that is often tied to cybercrime activity such as advertising fraud and account takeovers. 🔄🔍 (0.0s) | 🧠 Semantica is parsing: Document: Take part in the new survey from Dark Reading and help uncover trends, challenges, and solutions shaping the future of application security. 🔄🔍 (0.0s)cess to more than 2,200 pay-per-view and streaming services like Netflix, ESPN and Hulu, all for a one-time fee of around $400. But security experts warn these TV boxes require intrusive software that forces the user's network to relay Internet traffic for others, traffic that is often tied to cybercrime activity such as advertising fraud and account takeovers. 🔄🔍 (0.0s)  Parsed 50/119 documents...\n",
      "🧠 Semantica is parsing: Document file not found: As exploitation activity against CVE-2025-55182 ramps up, researchers are finding some proof-of-concept exploits contain bypasses for web application firewall (WAF) rules. ❌🔍 (0.0s) | 🧠 Semantica is parsing: Document: An insufficient validation input flaw, one of 11 patched in an update this week, could allow for arbitrary code execution and is under active attack. 🔄🔍 (0.0s)(WAF) rules. ❌🔍 (0.0s)  Parsed 100/119 documents...\n",
      "  Parsed 119/119 documents...\n",
      "Parsed 119 documents\n"
     ]
    }
   ],
   "source": [
    "from semantica.parse import DocumentParser\n",
    "\n",
    "parser = DocumentParser()\n",
    "\n",
    "print(f\"Parsing {len(documents)} documents...\")\n",
    "parsed_documents = []\n",
    "for i, doc in enumerate(documents, 1):\n",
    "    try:\n",
    "        parsed = parser.parse(\n",
    "            doc.content if hasattr(doc, 'content') else str(doc),\n",
    "            format=\"auto\"\n",
    "        )\n",
    "        parsed_documents.append(parsed)\n",
    "    except Exception:\n",
    "        parsed_documents.append(doc.content if hasattr(doc, 'content') else str(doc))\n",
    "    if i % 50 == 0 or i == len(documents):\n",
    "        print(f\"  Parsed {i}/{len(documents)} documents...\")\n",
    "\n",
    "print(f\"Parsed {len(parsed_documents)} documents\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Text Processing\n",
    "\n",
    "Normalize multi-source intelligence data and split documents using sentence chunking for parallel processing.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Normalizing 119 documents...\n",
      "🧠 Semantica is parsing: Document: An insufficient validation input flaw, one of 11 patched in an update this week, could allow for arbitrary code execution and is under active attack. 🔄🔍 (0.0s) | 🧠 Semantica is normalizing |███████████████| 100.0% ✅🔧  Normalized 50/119 documents...\n",
      "🧠 Semantica is parsing: Document: An insufficient validation input flaw, one of 11 patched in an update this week, could allow for arbitrary code execution and is under active attack. 🔄🔍 (0.0s) | 🧠 Semantica is normalizing |███████████████| 100.0% ✅🔧  Normalized 100/119 documents...\n",
      "🧠 Semantica is parsing: Document: An insufficient validation input flaw, one of 11 patched in an update this week, could allow for arbitrary code execution and is under active attack. 🔄🔍 (0.0s) | 🧠 Normalizing text 🔄🔧 (0.0s)  Normalized 119/119 documents...\n",
      "Chunking 119 documents...\n",
      "  Chunked 50/119 documents (205 chunks so far)\n",
      "  Chunked 100/119 documents (255 chunks so far)\n",
      "  Chunked 119/119 documents (299 chunks so far)\n",
      "Created 299 chunks from 119 documents\n"
     ]
    }
   ],
   "source": [
    "from semantica.normalize import TextNormalizer\n",
    "from semantica.split import TextSplitter\n",
    "\n",
    "normalizer = TextNormalizer()\n",
    "print(f\"Normalizing {len(parsed_documents)} documents...\")\n",
    "normalized_docs = []\n",
    "\n",
    "for i, doc in enumerate(parsed_documents, 1):\n",
    "    try:\n",
    "        normalized = normalizer.normalize(\n",
    "            doc if isinstance(doc, str) else str(doc),\n",
    "            clean_html=True,\n",
    "            normalize_entities=True,\n",
    "            remove_extra_whitespace=True\n",
    "        )\n",
    "        normalized_docs.append(normalized)\n",
    "    except Exception:\n",
    "        normalized_docs.append(doc if isinstance(doc, str) else str(doc))\n",
    "    if i % 50 == 0 or i == len(parsed_documents):\n",
    "        print(f\"  Normalized {i}/{len(parsed_documents)} documents...\")\n",
    "\n",
    "# Use sentence chunking for parallel processing\n",
    "sentence_splitter = TextSplitter(\n",
    "    method=\"sentence\",\n",
    "    chunk_size=CHUNK_SIZE,\n",
    "    chunk_overlap=CHUNK_OVERLAP\n",
    ")\n",
    "\n",
    "print(f\"Chunking {len(normalized_docs)} documents...\")\n",
    "chunked_docs = []\n",
    "for i, doc_text in enumerate(normalized_docs, 1):\n",
    "    try:\n",
    "        chunks = sentence_splitter.split(doc_text)\n",
    "        chunked_docs.extend([chunk.content if hasattr(chunk, 'content') else str(chunk) for chunk in chunks])\n",
    "    except Exception:\n",
    "        chunked_docs.append(doc_text)\n",
    "    if i % 50 == 0 or i == len(normalized_docs):\n",
    "        print(f\"  Chunked {i}/{len(normalized_docs)} documents ({len(chunked_docs)} chunks so far)\")\n",
    "\n",
    "print(f\"Created {len(chunked_docs)} chunks from {len(normalized_docs)} documents\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Entity Extraction\n",
    "\n",
    "Extract intelligence entities including sources, entities, events, locations, and timeframes from multi-source data.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s))sing pattern... 🔄🎯 (0.8s)Extracted 1532 entities\n"
     ]
    }
   ],
   "source": [
    "from semantica.semantic_extract import NERExtractor\n",
    "\n",
    "extractor = NERExtractor(method=\"ml\", model=\"en_core_web_sm\")\n",
    "\n",
    "chunks_to_process = chunked_docs\n",
    "entity_results = extractor.extract(chunks_to_process)\n",
    "\n",
    "all_entities = []\n",
    "relevant_types = [\"PERSON\", \"ORG\", \"GPE\", \"LOC\", \"EVENT\", \"DATE\"]\n",
    "for entities in entity_results:\n",
    "    all_entities.extend([e for e in entities if e.label in relevant_types])\n",
    "\n",
    "print(f\"Extracted {len(all_entities)} entities\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Relationship Extraction\n",
    "\n",
    "Extract intelligence relationships including source attribution, temporal relationships, location connections, and correlations.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.6s)9) |░░░░░░░░░░░░░░░| 0.0% [0/299] 🔄🎯DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'five', 'australia', 'canada', 'new zealand', 'the united kingdom', 'united states.[1][2][3][4][5]</p>\\\\n', 'li>webshell', 'china', 'li>c2 obfuscation', '3', '952']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['today', '3', '905']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['five', 'c2', '3', '961']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['first', 'may 2015', 'frutas', '2012.</p>\\\\n', '1', '528']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (3.1s)DEBUG: Entity map keys: ['wireshark', 'advanced persistent threat', 'apt', 'quasar', '1', '1259']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['java', 'windows', 'mac', 'pii', 'early 2018', '5', '964']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['early 2017', 'society for worldwide interbank financial telecommunication', 'windows registry', 'task', 'li>significant', 'ip', '1', '1084']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['end_index=7441', '3', '782']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['uk', 'china', '2012.</p>\\\\n', '>china chopper', 'china chopper', '4', 'two', '1', '1384']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['1', 'summer 2018', 'cve-2017-3066', '3', '905']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['adobe coldfusion', 'second', 'china chopper', '3', '560']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['first', 'href=\"https://owasp.org', 'one', 'china chopper', '4', '938']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['transport layer security', 'china chopper', 'linux', 'windows', '3', '716']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['hypertext preprocessor', 'php', 'end_index=12816', '5', '867']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['2007', 'mimikatz', 'windows', 'local security authority subsystem service', 'recent years', '4', '950']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['1', '77']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['mimikatz', 'powershell empire', '1', '1029']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['local area network', 'windows xp', '2003', 'windows 8.1', '2012r2', 'kerberos', 'mimikatz', 'powershell', 'invoke-mimikatz', 'several years', '2011', 'dutch', 'diginotar', '4', '864']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['diginotar', 'a month', 'mimikatz', 'notpetya', 'badrabbit', '2017', 'thousands', 'microsoft', 'end_index=16440', '2', '702']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['mimikatz', 'microsoft', 'windows', 'windows 8.1/server', 'href=\"https://support.microsoft.com', '2014-93434251-04ac', 'target=\"_blank', '2', '956']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['13', 'windows 10', 'windows server 2016', 'credential guard.</p>\\\\n', '>credential guard', 'microsoft', 'windows hardware compatibility program specifications', '2016', 'windows server semi-annual', 'li', 'href=\"https://learn.microsoft.com', 'windows', '3', '867']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['local administrator password solution', 'microsoft', 'kerberos', 'windows', 'microsoft advanced threat analytics', 'numerous mimikatz', '4', '846']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['mimikatz', 'third', 'wherever mimikatz', '4', '797']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['mimikatz', 'active directory', 'securing active', 'powershell', '2', '743']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['mimikatz', '>lateral movement framework', 'powershell', 'cobalt strike', 'metasploit', 'powershell empire', '2015', 'end_index=21635', '6', '982']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['powershell', 'powershell empire', 'recent years', 'end_index=22439', '4', '804']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['powershell empire', 'powershell', '2', '662']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['february 2018', 'uk', 'powershell empire', 'one', 'early 2018', 'winter olympics', 'south korean', '4', '926']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['powershell', 'december 2017', 'microsoft word', 'powershell empire', 'one', '3', '634']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['powershell empire', 'powershell', 'end_index=25473', '2', '809']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['powershell', 'href=\"https://reliaquest.com/blog', 'windows', 'end_index=26367', '4', '893']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['powershell', 'c2 obfuscation and exfiltration: huc packet', 'tor', 'htran', 'transmission control protocol', 'tcp', 'at least 2009.</p>\\\\n', '4', '872']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['htran', 'li>evade', 'li>obfuscate', 'c2', 'li>create', 'two', '1', '943']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['tcp', 'three', 'tran)</strong> - one', 'first', 'windows', 'htran', '5', '916']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['one', 'programdata', 'htran', '80', 'li>port', '3', '918']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['htran', 'several months', 'detected.</li>\\\\n</ul>\\\\n', 'tcp', '3', '957']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['htran', '2', '629']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['uk', '1', '373']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['business guide', 'five', 'uk', 'two', '2sv)\">setting', '1', '1011']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['software', 'uk', '1', '1198']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['uk', 'li>', 'li>update', '1', '946']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['microsoft office', 'uk', 'li>manage', 'li>restrict', '4', '943']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['third', 'uk', 'end_index=36816', '3', '737']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['uk', '1', '342']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['microsoft office', 'office', 'uk', 'ncsc’s macro security', 'microsoft office guidance', 'microsoft', '3', '891']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['microsoft office', 'anti-virus', 'anti-virus software</a>.<br>see', 'microsoft', 'li>layer', 'li>treat', 'first', '6', '915']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['social engineering', 'phishing attacks\">avoiding social engineering and phishing', 'li>deploy', '1', '710']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['li>defend', '2', '424']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['uk', '1', 'li>make', '1041']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['uk', '>additional resources', '1', '330']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['li>acsc', 'eight', 'target=\"_blank', 'li>', '10', 'hygiene - cyber', 'critical controls 2018', 'new zealand', '11', 'national cyber security centre', '1', '1213']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['li>', 'uk', 'ncsc', '10', 'cyber security\">10 steps', 'cyber', 'five', 'board\\\\', 'end_index=43752', '1', '1061']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: [\"chunk(text='for\", 'the united states', '+1-703', 'href=\"https://myservices.cisa.gov', 'end_index=44502', '2', '749']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['national cyber security centre', 'nz', 'href=\"https://www.ncsc.gov.uk/', 'kingdom national cyber security centre\">uk\\'', '1', '781']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['cyber security centre', 'uk', 'title=\"owasp top ten\">cybersecurity and infrastructure security agency', 'href=\"https://owasp.org', 'top ten\">owasp', 'ten', 'href=\"https://cloud.google.com', 'the china chopper web shell - part ii', 'href=\"https://support.microsoft.com', '2014-93434251-04ac', 'target=\"_blank', '3', '885']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['13', '2014\">microsoft security advisory: update', 'may 13, 2014 - microsoft', 'href=\"https://learn.microsoft.com', 'securing active directory\">best practices for', 'securing active directory', 'microsoft', 'href=\"https://reliaquest.com', 'october 11', '2018:</strong', '1', '653']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'the department of homeland security', 'national cybersecurity and communications integration center', 'the federal bureau of investigation (fbi', 'samsam', 'msil/samas', 'the united states', '6', '996']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['windows', 'early 2016', 'the jexboss exploit kit', 'jboss', 'mid-2016', 'fbi', 'remote desktop protocol', 'samsam', 'end_index=1808', '5', '812']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['rdp', 'fbi', 'samsam', 'hours', 'tor', '6', '913']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['bitcoin', 'samsam malware analysis reports', 'four', 'samsam', 'end_index=3080', '2', '358']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['dhs', 'fbi', '1', '859']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['li>verify', '3389', '3', '566']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['two', 'li>regularly', 'li>maintain', '90 days', 'third', 'li>minimize', 'rdp', 'end_index=5472', '3', '964']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['li>scan', '2', '459']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['active directory', 'special publication', 'malware incident prevention and handling for desktops', 'the national institute of standards and technology.[<a href=\"https://nvlpubs.nist.gov', 'guide to malware incident prevention and handling for desktops', 'fbi', 'cyber division', 'cyber division\\\\n', 'li>fbi', '1', '1382']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['href=\"https://nvlpubs.nist.gov', 'guide to malware incident prevention and handling for desktops', 'december 3', '1', '652']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'the national cybersecurity and communications integration center', 'the cybersecurity and infrastructure security agency', 'domain name system', 'dns', '2', '398']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['february 13, 2019', 'ip', '1', '1031']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['dns', 'li>next', 'address', 'mail exchanger', 'mx', 'name server', 'ns', '4', '823']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['dns', 'dnspionage campaign targets middle', '3', '965']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['dns hijacking campaign', 'dns', 'dns hijacking', 'li>crowdstrike', 'january 24', '2019:</strong', 'february 6', 'crowdstrike', 'br><strong', 'february 13', '3', '692']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'sap', 'href=\"https://github.com', 'title=\"(sap', 'mathieu', 'april 2019', 'operation for community development and empowerment', 'opcde', '10kblaze', '4', '960']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['sap', 'sap gateway', '0', 'opcde', 'u.s.', '1,181', 'start_index=961', '6', '987']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['sap', 'application servers', 'message servers', 'opcde', '693', 'the united states', '5', '676']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['snort', 'external_net', 'home_net', 'sap exploit', 'depth:3', 'distance:0', 'sap', 'opcde', 'li>restrict', 'sap message server', '1', '974']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['1408081', '821875', 'acl', 'gateways', 'message servers', '5]</li>\\\\n', '1421005', 'split ms', 'li>restrict', 'message server', 'snc', 'sap', 'li>remove', 'sap components.</li>\\\\n</ul>\\\\n</li>\\\\n</ul>\\\\n', '5', '751']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['title=\"(sap', 'mathieu geli\">comae technologies:', 'community development and empowerment', 'gateway access control lists', '1408081', 'br>[5', '821875', '1421005</p>\\\\n', 'may 2', '2019:</strong', '3', '653']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'microsoft windows operating systems', '64', 'li>', 'li>windows', 'li>windows xp</li>\\\\n', 'li>windows server', '2003', 'the remote desktop protocol', 'the microsoft windows', '1', '865']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['attacker', 'microsoft', 'rdp', 'href=\"https://msrc.microsoft.com', 'us', 'desktop services', '1', '619']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['bluekeep', 'wannacry', '2017.[2]</p>\\\\n', 'windows 2000', 'the microsoft security advisory', 'href=\"https://msrc.microsoft.com', 'us', 'desktop services', '2', '833']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['href=\"https://support.microsoft.com', '2019-0624e35b-5f5d-6da7-632c-27066a79262e', 'remote desktop services', 'may 14', '2019\">3</a', 'microsoft', 'windows vista', 'windows xp', 'windows server', '2003', '3', '993']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['microsoft', 'windows 10.</li>\\\\n', '2008', 'windows server', 'bluekeep', 'tcp', '3389', '4', '860']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['network.</li>\\\\n</ul>\\\\n', 'href=\"https://msrc.microsoft.com', 'us', 'desktop services', '2', '413']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['house press briefing', 'north korea', 'href=\"https://support.microsoft.com', '2019-0624e35b-5f5d-6da7-632c-27066a79262e', 'remote desktop services', 'may 14', '2019\">microsoft', 'june 17', '2019:</strong', 'end_index=5255', '1', '666']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'windows 7', 'microsoft', '2020', 'href=\"https://blogs.microsoft.com', 'january 14, 2020', '2008', '3', '713']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['windows 7', 'href=\"https://support.microsoft.com', 'microsoft', '2008', 'january 14, 2020', '3', '962']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['windows 7', '2008', '2', '298']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['the cybersecurity and infrastructure security agency', 'li>upgrade', 'li>identify', 'li>establish', 'microsoft end of support', 'href=\"https://support.microsoft.com', 'microsoft', 'href=\"https://docs.microsoft.com', 'microsoft windows upgrade', 'migration', 'computerworld', '1', '1481']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['non-windows', '133a', 'microsoft office 365 security', 'october 17, 2019', '18, 2019', '2', '325']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'the department of the treasury financial', 'cyber information group', 'the department of the treasury’s financial crimes enforcement network', 'treasury', 'the cybersecurity and infrastructure security agency', 'dridex', '4', '955']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['cisa', 'dridex', '1', '160']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['dridex', 'treasury', 'russia', 'sanctions evil corp', 'fbi', 'russian', 'decade', 'decade-long series', 'hacking', 'second', 'alert', '1', '1205']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['cig.</em></p>\\\\n', '339a', 'xml\">aa19-339a', 'dridex', '2', '870']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['dridex', 'first', '2012', '2015', 'trojans', 'end_index=4016', '4', '822']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.6s)DEBUG: Entity map keys: ['scan', '5', '892']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['######', '8', '886']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['zip', 'microsoft office', 'visual basic', 'javascript', 'ftp', 'dridex', '5', '832']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.8s)DEBUG: Entity map keys: ['dridex', 'cve-2017-0199', 'end_index=7612', '5', '983']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['microsoft office', 'wordpad', 'microsoft', '2017.</p>\\\\n', 'dridex', 'files.&nbsp', 'api', 'xml', '4', '993']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['dridex', 'dridex malware', 'cridex', 'bugat', '5', '853']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: [\"chunk(text='code\", 'bitpaymer', 'friedex', 'dridex', 'two', 'u.s.', 'locky', 'zepto', 'osiris', '6', '874']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['late 2015', 'early 2016', 'locky', 'dridex', 'english', 'bitpaymer', 'evil corp', 'ta505', '4', '565']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['up to millions', 'faturamento[@]sudestecaminhoes[.]com.br</td>\\\\n', 'treasury', 'cisa', 'li>contact', 'dridex', '1']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['fbi', 'cisa', 'li>report', '“cyber event indicators', 'ip', 'item 44', 'the suspicious activity report (sar', 'end_index=15080', '3', '662']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['sar', 'dridex', 'li>conduct', 'li>treasury', 'cisa', 'li>maintain', 'li>keep', '1', '1271']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['active directory', 'li>restrict', '1', '186']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['li>enforce', 'li>scan', 'usb', 'li>', 'the national institute of standards and technology', 'malware incident prevention and handling for desktops', 'the national security agency', 'nsa', '1', '1906']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['10', 'the nist cybersecurity framework', 'strategies', 'advance persistent threat', 'apt', 'nsa', '6', '953']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['n-day', 'zero-day', 'a privileged access management (pam', '8', '993']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['start_index=20395', 'end_index=21385', '6', '990']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['configurations', '9', '893']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['security information and event management', 'endpoint detection and response', 'edr', 'end_index=23232', '5', '953']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['unified extensible firmware interface', '5', '803']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['dns', 'ips', '6', '906']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['multi-factor authentication', '5', '888']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['1', '359']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: [\"chunk(text='to\", '1', 'fbi', 'cyber division', '855', 'a suspicious activity report', 'bank secrecy act', 'fincen', 'financial', 'sar', 'the fincen resource center', '1-800', 'u.s.', 'dridex', 'malware', 'us', '13', 'october', '2015.</li>\\\\n', 'threat profile', 'new jersey cybersecurity &amp', 'communications integration cell', 'threat profile\">https://www.cyber.nj.gov', '15', 'april 2019.</li>\\\\n', 'li>alert logic', 'locky ransomware', 'locky ransomware\">https://www.alertlogic.com/resources', '11', 'march 2019.</li>\\\\n', 'li>avast blog', 'locky', 'march 2016', 'href=\"https://blog.avast.com', 'the locky ransomware\">https://blog.avast.com', 'february 2019.</li>\\\\n', 'li>brett stone-gross', 'ph.d.', 'bugat', 'secureworks', '13 october 2015', 'li>brewster', 'thomas', 'cops knock down dridex malware', 'earned ‘evil corp’ cybercriminals at least $50 million', 'forbes', 'knock down dridex malware', 'earned ‘evil corp’ cybercriminals at least $50', 'li>chandler', 'andy', 'fox-it', 'https://www.fox-it.com/en/about-fox-it/corporate/news/fbi-announces-dridex-gang-indictments-praises-fox/', 'li>dhs', 'alert', 'dridex p2p malware', '4', 'june 2019.</li>\\\\n', 'li>', 'eduard kovacs', '19 october 2015', 'li>geoff white', 'millions', '26 september 2018', 'title=\"how the dridex gang', 'li>ms-isac', 'cybercrime technical desk reference', '31 august 2018', 'li>o’brien', 'dick', '4997']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)1.6s)DEBUG: Entity map keys: ['trojan', 'symantec', 'february 2016', 'href=\"https://docs.broadcom.com', 'doc', 'february 2019.</li>\\\\n', 'li>poslušný', 'michal', 'friedex', 'bitpaymer', 'dridex', 'eset', '26 january 2018', 'href=\"https://www.welivesecurity.com/2018/01/26', '1', '588']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['dridex', 'february 2019.</li>\\\\n', 'li>proofpoint', 'dridex campaigns hitting millions of recipients using unpatched microsoft zero-day', 'microsoft zero-day\">https://www.proofpoint.com/us', 'zero', 'trojan campaigns return', '1', '733']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['february 2019.</li>\\\\n', 'li>proofpoint', 'threat actor profile', 'ta505', 'dridex', 'href=\"https://www.cisa.gov//www.proofpoint.com', 'globeimposter\">https://www.proofpoint.com', 'li>', 'ran mosessco', '2', '857']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['year', 'ftp', 'forcepoint', '18 january 2018', 'https://blogs.forcepoint.com/blog/security-labs/new-year-new-look-dridex-compromised-ftp', 'february 2019.</li>\\\\n', 'li>sanghavi', 'mithun', 'dridex', '2', '255']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['official blog', '30 march 2015', 'href=\"https://community.broadcom.com', 'title=\"dridex', 'it\">https://community.broadcom.com', 'february 2019.</li>\\\\n', 'intelligence blog', 'ursnif', 'emotet', 'dridex', 'bitpaymer gangs linked', 'trend micro', '18 december 2018', 'title=\"ursnif', 'li>talos group', 'threat spotlight: spam served with a side of dridex', 'cisco blogs', '6 april 2015', 'february', 'december 5', '2019:</strong', 'treasury', 'fbi', 'br><strong', 'january 2', '1', '1581']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)�DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'nation', 'the islamic republic of iran', 'the united states', 'iran', '3', '952']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='flag\", 'iranian', 'cisa', 'contact information', '7', '752']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['iran', 'iranian', '3', '675']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['pii', 'u.s.', 'the islamic revolutionary guard corps', 'irgc', 'iranian', '1', '715']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['iranian', 'following:</p>\\\\n', 'late 2011', 'mid-2013 - ddos', 'u.s.', 'march 2016', 'the u.s. department of justice', 'seven', 'irgc', '3', '805']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['millions of dollars', 'august/september 2013', 'new york', 'march 2016', 'the u.s. department of justice', 'one', 'iranian', 'scada', 'the bowman dam', 'rye', '1', '633']\n",
      "DEBUG: Match found! Subject='the Bowman Dam', Object='Rye'\n",
      "DEBUG: Subject Entity found: True, Object Entity found: True\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['february 2014 -', 'the sands', 'las vegas', 'nevada', 'social security numbers', 'bloomberg', 'december 2014', 'sands', 'end_index=5249', '2', '712']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['september 2015', 'u.s.', 'national intelligence', 'iranian', 'the house permanent select committee', '2017', 'march 2018', 'the u.s. justice department', 'nine', 'the mabna institute', 'dozens', 'irgc', '2', '803']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['144', 'u.s.', '176', '21', '47', 'the u.s. department of labor', 'the federal energy regulatory commission', 'the state of hawaii', 'the state of indiana', 'the united nations', 'the united nations children’s fund', '3', '891']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['cisa', 'two', 'iranian', '1', '2', 'equipment.</strong> focus', 'powershell', '4', '971']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.7s)DEBUG: Entity map keys: ['powershell', 'publicly known iranian', 'iranian', 'apt', 'title=\"att&amp;ck matrix for enterprise\">mitre att&amp;ck', 'role=\"columnheader\"><strong>mitigation', 'href=\"https://attack.mitre.org', 'replicating directory changes', 'li>windows: monitor', 'li>linux', 'files', 'the antimalware scan interface', 'amsi', 'windows 10', '1', '2724']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)1.8s)DEBUG: Entity map keys: ['chunk(text=\\'title=\"data', 'li>network', 'href=\"https://attack.mitre.org', 'li>set powershell', 'li>remove powershell', 'the winrm service', 'powershell', '1', '1237']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['powershell', 'li>monitor', 'system', '1', '231']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['automation.dll', 'li>turn', 'powershell', 'href=\"https://attack.mitre.org', 'li>monitor', 'initial access', '1', '1246']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['deobfuscate/decode files or information', 'li>anti', 'li>endpoint', 'microsoft', 'pdf', 'powershell.exe', 'exploitation for client execution', 'href=\"https://attack.mitre.org', 'protected view', 'group policy', '1', '873']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['li>turn', 'vbscript', '1', '332']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['li>scripts', 'li>monitor', 'li>analyze office', 'href=\"https://attack.mitre.org', 'run keys/startup', 'end_index=15372', '2', '807']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: [\"chunk(text='this\", 'li>monitor', 'li>', 'sysinternals autoruns', \"keys\\\\' registry\", 'command', 'discovery', 'href=\"https://attack.mitre.org', 'file copy\">remote file', 'li>network', 'ftp', 'li>analyze', 'li>users', 'target=\"_blank', 'li>anti-virus', 'obfuscated files', '1', '4308']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)1.1s)DEBUG: Entity map keys: [\"chunk(text='for\", 'the united states', '+1-703', 'li><a', '2', '748']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['chunk(text=\\'title=\"seven iranians working for islamic revolutionary guard corps-affiliated entities charged for conducting coordinated campaign', 'justice', 'seven', 'iranians', 'iranian', 'the sands casino', 'an iranian hacker', '1', '625']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['the sands casino', 'an iranian hacker', 'iranians', 'the islamic revolutionary guard corps\">department', 'justice', 'nine', 'the islamic revolutionary guard corps</a><br>[4', 'title=\"att&amp;ck matrix for enterprise\">mitre\\'', '1', '617']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='att&amp;ck\", 'january 6', '2019:</strong', 'br><strong', 'october 23', '1', '448']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'cve-2019-11510', '2', '417']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['pulse secure', '2', 'april 2019', 'the cybersecurity and infrastructure security agency', 'cve-2019-11510.[<a', 'april 24, 2019', 'may 28, 2019', 'july 31, 2019 - full', 'li>', 'august 8, 2019 -', 'meh chang', 'orange tsai', 'vpn', 'august 24, 2019 - bad packets', '14,500', 'october 7, 2019', 'the national security agency', 'nsa', 'cybersecurity advisory on pulse secure', \"october 16, 2019 -'\", '1', '1665']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['cert coordination center', 'cert/cc', 'january 2020', 'pulse secure', 'revil', 'sodinokibi', '3', '553']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['9.0r1', '8.3r1', '8.1r1', '5.4r1', '5.3r1', '5.1r1', '1', '632']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['nvd', '1', '426']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['target=\"_blank\">cert/cc vulnerability note', 'multiple vpn applications', 'title=\"multiple vulnerabilities', 'pulse secure vpn\">multiple vulnerabilities', 'january 10', 'initial version', 'april 15', '1', '852']\n",
      "DEBUG: Match found! Subject='title=\"Multiple Vulnerabilities', Object='Pulse Secure VPN\">Multiple Vulnerabilities'\n",
      "DEBUG: Subject Entity found: True, Object Entity found: True\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='<div>\\\\n\", 'january 14, 2020', 'microsoft', '49', 'monthly', 'tuesday', 'windows cryptoapi,&nbsp;windows remote desktop gateway', 'rd', 'windows remote desktop&nbsp;client', '64-bit', 'windows 10', 'windows server', '2016', '2019', '4', '990']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['elliptic curve cryptography', 'windows cryptoapi', 'windows remote desktop client', 'cve-2020-0610', 'cve-2020-0611', 'windows server', '2012', 'windows 7', '5', '847']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['the windows remote desktop client', 'gateway server', 'server.</li>\\\\n</ul>\\\\n', 'the cybersecurity and infrastructure security agency', '4', '885']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['windows cryptoapi', 'microsoft', '4', '871']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['us', 'cve-2020-0601', 'windows cryptoapi', '1', '506']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['the microsoft security advisory', 'us', 'windows cryptoapi', 'the national security agency', 'nsa', 'cve-2020-0601', 'microsoft windows clients', '1', '1055']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['microsoft', 'windows remote desktop gateway', 'rdp', 'end_index=7473', '2', '378']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['us', 'windows server', '2012', '2008', 'january 14', '2020);</li>\\\\n', 'li>occurs', 'href=\"https://portal.msrc.microsoft.com', '>windows remote desktop client vulnerability - cve-2020', 'microsoft', 'the windows remote desktop client', '2', '988']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['href=\"https://portal.msrc.microsoft.com', 'us', 'domain name server', 'dns', 'the microsoft security advisory', 'end_index=9263', '2', '802']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['li>financial', 'li>potential', 'january 2020', 'href=\"https://csrc.nist.gov', '2', '973']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['u.s.', '5', '869']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['cisa', 'cyber essentials', '3', '562']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['us', 'microsoft security advisory', 'microsoft windows clients', '1', '750']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['us', 'microsoft security advisory', 'cert/cc vulnerability note', 'january 14, 2020', '14, 2020', '2', '970']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['europe', 'south america', 'three', 'europol', 'one', 'dutch', 'colombian', 'brazilian', 'third', 'greek', '2', '501']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['10 december 2025', 'europol', 'second', 'the global alliance', 'the european commission', '80', 'eu', 'states', 'third', '50', 'end_index=754', '4', '754']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['germany', 'colombia', 'europe', '3', '419']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['18', '3', '373']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['april 2025', 'sweden', 'europe', '3', '393']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['today', 'the impact of robotics and unmanned systems on law enforcement', 'the europol innovation lab', '2', '331']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['governance', 'jurgen ebner', 'heads', 'eu justice', 'home affairs agencies', 'vienna', 'eu', '25th', 'the eu charter of fundamental rights', '2', '403']\n",
      "DEBUG: Match found! Subject='Home Affairs Agencies', Object='Vienna'\n",
      "DEBUG: Subject Entity found: True, Object Entity found: True\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['today', 'eu', 'recent years', '2025', 'european', '5', '715']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['last month', 'earlier this week', 'years', 'europe', '2', '425']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['sweden', 'spain', 'between 28 and 29 november', 'stockholm', 'nordic', '3', '485']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: [\"chunk(text='krebsonsecurity.com\", '16th', 'today', 'this past year', 'days', '2025', '4', '430']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['trump', 'this past year', '2', '473']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['1', '351']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['today', 'at least 56', 'windows', 'tuesday', '2025', 'zero-day', 'two', '2', '263']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['chunk(text=\"a', 'google ads', 'nearly $25 million', 'kremlin', 'russian', 'russia', 'ukraine', 'start_index=0', 'end_index=242', '1', '242']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['the holiday shopping season', 'apple', 'google', 'sms', '2', '478']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['scattered lapsus$ hunters', 'this year', 'dozens', 'rey', 'earlier this week', 'krebsonsecurity', '2', '476']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['superbox', 'bestbuy', 'walmart', 'more than 2,200', 'netflix', 'espn', 'one', 'around $400', 'start_index=0', '2', '509']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['march 2024', 'mozilla', 'firefox', 'hundreds', 'krebsonsecurity', 'onerep', 'dozens', 'at least one', 'sixteen months later', 'this week', 'next month', 'start_index=0', 'end_index=520', '3', '520']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['cloudflare', 'tuesday', 'start_index=0', '3', '458']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['china', '1', '196']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['ai', 'one', 'americans', '6', '902']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.7s)DEBUG: Entity map keys: ['coleoid', '6', '923']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.1s)DEBUG: Entity map keys: ['2', '286']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.0s)DEBUG: Entity map keys: ['italian', 'france', '1', '254']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.6s)DEBUG: Entity map keys: ['ten', 'ai', 'claude', 'gemini', 'microsoft copilot', 'deepseek', 'grok', 'meta ai.</p>\\\\n', '8220;executor&#8221', '4', '870']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.3s)0s)DEBUG: Entity map keys: ['russia', 'two', 'the danish defence intelligence service', 'thursday', 'moscow', 'danish', '2024', 'first', 'pro-russian', 'z-pentest', 'second', 'russian', '1', '797']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.0s)�DEBUG: Entity map keys: ['twenty-six years', 'microsoft', 'href=\"https://arstechnica.com', 'decades', 'active directory', 'aes', 'windows', '5', '728']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.2s)DEBUG: Entity map keys: ['reddit', 'end_index=454', '1', '454']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.9s)DEBUG: Entity map keys: ['andreessen horowitz', 'at least hundreds', 'ai', 'more than 1,000', 'october 31', '4', '902']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.2s)0s)DEBUG: Entity map keys: ['ba', '1', '466']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.6s)DEBUG: Entity map keys: ['chunk(text=\"with', 'start_index=0', '1', '176']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.0s)DEBUG: Entity map keys: ['salt typhoon', 'react2shell', '1', '132']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (3.2s)DEBUG: Entity map keys: ['webster bank', '1', '181']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.2s)DEBUG: Entity map keys: ['ai', '2026', '1', '137']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.3s)2.4s)DEBUG: Entity map keys: ['dark reading', '1', '140']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.2s)0s)DEBUG: Entity map keys: ['chunk(text=\"healthcare', 'start_index=0', 'end_index=143', '1', '143']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.3s)DEBUG: Entity map keys: ['servicenow', 'ai', '1', '159']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.9s)DEBUG: Entity map keys: ['north korean', 'end_index=143', '1', '143']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.8s)DEBUG: Entity map keys: ['19', '574', '$3 million', '1', '230']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.0s)DEBUG: Entity map keys: ['watchguard', 'recent weeks', '1', '150']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.6s)DEBUG: Entity map keys: ['uzbekistan', 'android', 'start_index=0', '1', '142']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.0s)DEBUG: Entity map keys: ['one', 'five', '1', '112']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.9s)DEBUG: Entity map keys: ['china', 'apt', 'group policy', 'southeast asia', 'japan', '1', '123']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.7s)DEBUG: Entity map keys: ['1', '171']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.7s)DEBUG: Entity map keys: ['chunk(text=\"ai', 'today', 'ai', '2', '216']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (3.4s)DEBUG: Entity map keys: ['korea', 'fish&quot', '1', '163']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (3.1s)DEBUG: Entity map keys: ['sma1000', 'zero-day', 'earlier this year', 'start_index=0', '1', '165']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.8s)DEBUG: Entity map keys: ['1', '168']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.8s)DEBUG: Entity map keys: ['1', '171']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.9s)DEBUG: Entity map keys: ['start_index=0', '1', '157']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['2', '158']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['trojan', 'the play store', 'start_index=0', '1', '135']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['securing iot', 'first', 'three', '3', '167']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['react2shell', '2', '165']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['quantum', '1', '158']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['aws identity and access management', 'iam', 'ec', '1', '163']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.6s)DEBUG: Entity map keys: ['1', '150']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['ai', '1', '144']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['start_index=0', '2', '200']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['pdvsa', '1', '121']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['russia', '1', '131']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['claude', 'gemini', 'copilot', 'ai', 'start_index=0', '1', '153']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['2026', 'ai', '1', '148']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['mga', '2', '195']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['apple', 'zero-day', 'this month', 'google', 'last week', '1', '133']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: [\"chunk(text='etay maor\", '1', '164']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['volklocker', 'pro-russia', 'cybervolk', 'one', '1', '122']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['2', '170']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['cve-2025-55182', '1', '171']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['1', '107']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['security copilot', '12', 'microsoft', 'last week', 'start_index=0', '1', '155']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['week', 'black hat europe', 'two', 'github', 'start_index=0', '1', '185']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.6s)DEBUG: Entity map keys: ['trump', 'chinese', 'us', '1', '196']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['start_index=0', '1', '124']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['five', '2', '147']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['tech talks and ask the expert', '2', '136']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['rce', 'last year', '1', '140']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['1', '136']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['ai', '2', '136']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.6s)DEBUG: Entity map keys: ['edr', 'windows', '1', '150']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['million', '1', '90']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['apt ta423', 'scanbox', 'javascript', '1', '149']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.8s)DEBUG: Entity map keys: ['130', '1', '108']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['two', 'conti', '1', '108']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: [\"chunk(text='tens of thousands\", '11-month-old', 'cve', 'thousands', '1', '123']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['1', '172']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.5s)DEBUG: Entity map keys: ['palo alto networks', 'pan', 'asap', '1', '100']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['1', '145']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['webkit', '1', '151']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['one', '11', 'this week', '1', '149']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['sec', 'us', 'more than $14', '1', '111']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['the middle east', 'north africa', '1', '134']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['two', 'us', '1', '128']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['armis', '7.75bn', \"the second half of 2026'\", '1', '111']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.8s)DEBUG: Entity map keys: ['christmas', '1', '77']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['macos malware mimics', 'apps code-', 'apple', '1', '90']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['university of phoenix', 'nearly 3.5 million', 'clop', '1', '127']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['2025', '1', '72']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['over 20,000', 'third', '1', '117']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['19', 'african', 'month', '1', '107']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['86%', 'the past month', '1', '133']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['nezha', '1', '100']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: [\"chunk(text='view red notices\", 'interpol', 'secretariat governance', 'the control of interpol’s files crimes corruption counterfeit', 'cybercrime drug trafficking environmental', 'terrorism vehicle', 'border', 'capacity building command', 'databases forensics fugitive', 'innovation interpol', 'notices safeguarding', '5', '965']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)1.2s)DEBUG: Entity map keys: ['view red notices home how', 'red notices', 'disclaimerthe notices', 'interpol', 'end_index=1922', '7', '956']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['notices filter', 'filter', 'family', 'forename nationality gender all female male unknown current', 'keyword search total', 'red notices', '0', '160', '8', '924']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['contact interpol careers procurement', 'map cookie', 'interpol', '2025', '2', '290']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['the united nationsعربي中文englishfrançaisрусскийespañolunited nationsoffice on drugs', 'searchabout', 'unodc', '1', '274']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.3s)DEBUG: Entity map keys: ['narcotic drugs alternative', 'aidsorganized crimeun convention against transnational organized crime border', 'cybercrimefirearms', 'un convention', 'crime prevention and criminal justice', 'ccpcj', 'prison reformviolence', 'researchlaboratory', 'commission on crime prevention and criminal justicecommission on narcotic drugscongress on crime prevention and criminal justiceun convention', '1', '1023']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.4s)DEBUG: Entity map keys: ['convention against transnational organized crimead hoc committee', 'un convention', 'cybercrimeinformation formember statescivil societymediadonors', 'europe', 'west', 'central', 'asia - regional officeiran', 'islamic republic', 'afghanistan', 'neighbouring countries africa', 'the middle easteastern africamiddle east', 'north africasouthern africawest', 'central africanigerialatin america', 'the caribbeanandean region', 'central america', 'the caribbeanmexicosouth asia', 'east asia', 'the pacificsouth east asia', '4', '866']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['viet namsouth asialiaison office - brusselsliaison office - new yorknews home about statistics research publications data', 'programunodc', 'unodc', 'the coming months/year', '3', '950']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['arab', 'migrants research on trafficking in persons crimes', 'the environment world wildlife crime drug', 'statistical', 'transnational', 'illicit financial flows', 'narcotics united nations office on drugs', 'end_index=3861', '3', '744']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['alerts & advisories', 'the united states', 'cyber servicessecure', 'holiday online shopping safetyshields upreport', 'collaboration physical security risk management', '7', '905']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: [\"chunk(text='governmenteducational institutionsindustrystate, local\", 'familiessmall', 'communityexecutiveshigh-risk communities spotlight resources & tools resources & tools all resources & tools services programs resources training groups news & events news & events news events cybersecurity alerts & advisories', 'directives request', 'congressional testimony cisa conferences cisa', 'divisions & offices regions leadership doing business', 'accountability policies & plans', 'cyber servicessecure', \"holiday online shopping safetyshields upreport'\", '2', '914']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)1.0s)DEBUG: Entity map keys: ['cyber issue', 'breadcrumb home news & events cybersecurity alerts & advisories', 'end_index=1939', '1', '118']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['advisory type alert analysis report cybersecurity advisory audience educational institutions', 'territorial government co-sealers', 'partners cyber national mission force federal bureau of investigation federal civilian executive branch agencies', 'five', 'analysis center national security agency office', 'united states', 'states cyber command mitre att&ck', 'command and control (ta0011) credential access', 'discovery', 'initial access', 'lateral movement', 'resource development', 'nation-state', 'china', 'iran', 'north korea', 'year 2025 2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007', '2006 2005 2004', \"energy sector financial services'\", '1', '1459']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)1.1s)DEBUG: Entity map keys: ['agriculture sector government services', 'healthcare', 'cybersecurity best practices incident detection', 'prevention information sharing medical technology organizations', 'ransomware zero trust industrial control systems securing networks critical infrastructure security', 'collaboration risk management information and communications technology supply chain security cyber threats', '45', 'mitsubishi electric', '44', 'schneider electric', '41', 'siemens', '38', '1', '919']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)DEBUG: Entity map keys: ['33', 'delta electronics', '25', 'abb', '13', 'iconics', 'mitsubishi electric', '11', 'fuji electric', '10', '7', 'johnson controls', 'johnson controls inc.', '6', 'festo', 'advantech', '5', 'subnet solutions inc.', '4', '3', 'emerson', 'hms networks', 'honeywell', 'national instruments', '2', 'becton', 'dickinson', 'bd', 'keysight technologies', 'kunbus', 'microsoft', '22', 'azeotech', '1', 'ge healthcare', 'invt electric', 'desenvolvimento de sistemas ltda me', 'ls electric', 'measuresoft', 'medtronic', 'mitsubishi electric europe b.v.', 'motorola solutions', 'ocean data', 'opw fuel management systems', 'schneider electric', 'schweitzer engineering laboratories', 'sdg technologies', 'sma solar technology ag', 'snapone', 'reset cybersecurity alerts & advisories advisory definitionscybersecurity advisoriesindustrial control systems', 'dec 29, 2025', 'one', 'dec 22, 2025', 'dec 22', 'protecting tokens and', 'dec 19, 2025', 'partners release update', 'dec 18, 2025', 'nine', 'dec 17, 2025', 'three', 'dec 16, 2025', 'six', '8', '9', '2357']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.0s)1.3s)DEBUG: Entity map keys: ['end_index=7594', '5', '917']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: ['malware analysis report', 'malware metadata', 'topics spotlight resources & tools news & events', 'cybersecurity & infrastructure security agency', '1', 'the u.s. department of homeland security', '7', '912']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.1s)DEBUG: Entity map keys: ['alerts & advisories', 'the united states', 'cyber servicessecure', 'holiday online shopping safetyshields upreport', 'collaboration physical security risk management', '7', '905']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: [\"chunk(text='governmenteducational institutionsindustrystate, local\", 'familiessmall', 'communityexecutiveshigh-risk communities spotlight resources & tools resources & tools all resources & tools services programs resources training groups news & events news & events news events cybersecurity alerts & advisories', 'directives request', 'congressional testimony cisa conferences cisa', 'divisions & offices regions leadership doing business', 'accountability policies & plans', 'cyber servicessecure', \"holiday online shopping safetyshields upreport'\", '2', '914']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['cyber issue', 'breadcrumb home news & events cybersecurity alerts & advisories', 'end_index=1939', '1', '118']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (1.2s)DEBUG: Entity map keys: ['advisory type alert analysis report cybersecurity advisory audience educational institutions', 'territorial government co-sealers', 'partners cyber national mission force federal bureau of investigation federal civilian executive branch agencies', 'five', 'analysis center national security agency office', 'united states', 'states cyber command mitre att&ck', 'command and control (ta0011) credential access', 'discovery', 'initial access', 'lateral movement', 'resource development', 'nation-state', 'china', 'iran', 'north korea', 'year 2025 2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007', '2006 2005 2004', \"energy sector financial services'\", '1', '1459']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['agriculture sector government services', 'healthcare', 'cybersecurity best practices incident detection', 'prevention information sharing medical technology organizations', 'ransomware zero trust industrial control systems securing networks critical infrastructure security', 'collaboration risk management information and communications technology supply chain security cyber threats', '45', 'mitsubishi electric', '44', 'schneider electric', '41', 'siemens', '38', '1', '919']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['33', 'delta electronics', '25', 'abb', '13', 'iconics', 'mitsubishi electric', '11', 'fuji electric', '10', '7', 'johnson controls', 'johnson controls inc.', '6', 'festo', 'advantech', '5', 'subnet solutions inc.', '4', '3', 'emerson', 'hms networks', 'honeywell', 'national instruments', '2', 'becton', 'dickinson', 'bd', 'keysight technologies', 'kunbus', 'microsoft', '22', 'azeotech', '1', 'ge healthcare', 'invt electric', 'desenvolvimento de sistemas ltda me', 'ls electric', 'measuresoft', 'medtronic', 'mitsubishi electric europe b.v.', 'motorola solutions', 'ocean data', 'opw fuel management systems', 'schneider electric', 'schweitzer engineering laboratories', 'sdg technologies', 'sma solar technology ag', 'snapone', 'reset cybersecurity alerts & advisories advisory definitionscybersecurity advisoriesindustrial control systems', 'dec 29, 2025', 'one', 'dec 22, 2025', 'dec 22', 'protecting tokens and', 'dec 19, 2025', 'partners release update', 'dec 18, 2025', 'nine', 'dec 17, 2025', 'three', 'dec 16, 2025', 'six', '8', '9', '2357']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)0.9s)DEBUG: Entity map keys: ['end_index=7594', '5', '917']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['malware analysis report', 'malware metadata', 'topics spotlight resources & tools news & events', 'cybersecurity & infrastructure security agency', '1', 'the u.s. department of homeland security', '7', '912']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.7s)DEBUG: Entity map keys: ['europolyou', 'javascript', '3', '98']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['javascript', '1', '50']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.9s)DEBUG: Entity map keys: [\"chunk(text='news\", 'the united states', 'cbp home', '3,000', 'the end of the year', 'apps blog comunicados de prensa', '6', '957']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (0.8s)DEBUG: Entity map keys: ['focus 2025 -', '2024', 'the public get involved get involved get involved blue campaign', 'nationwide sar initiative ready.gov secure our world us coast guard', 'dhs', 'dhs budget & performance contact us employee resources history homeland security careers', 'memoriam laws & regulations leadership mission organization site links breadcrumb home news news all dhs news', 'apps blog comunicados de prensa', '11', '926']\n",
      "DEBUG: Match found! Subject='DHS Budget & Performance Contact Us Employee Resources History Homeland Security Careers', Object='Memoriam Laws & Regulations Leadership Mission Organization Site Links Breadcrumb Home News News All DHS News'\n",
      "DEBUG: Subject Entity found: True, Object Entity found: True\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.8s)1.0s)DEBUG: Entity map keys: ['the department of homeland security', '3', '935']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.3s)DEBUG: Entity map keys: ['dhs', 'national terrorism advisory system image information', 'american', 'congress', 'media contacts image media', 'comunicados de prensa', 'del departamento de seguridad nacional de ee', 'uu', 'one', 'library image find', 'library image guidance', 'social media directory image follow dhs', 'start_index=2821', '13', '984']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using pattern... 🔄🎯 (2.8s)2.4s)DEBUG: Entity map keys: ['dhs', 'dhs data image statistical', 'subscribe image subscribe', 'topics news', 'the u.s. department of homeland security', 'the white house', 'usa.gov', 'u.s.', 'end_index=4617', '10', '811']\n",
      "🧠 Semantica is extracting: Extracted 12 entities using ml |███████████████| 100.0% ✅🎯 | 🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s)Extracted 2111 relationships\n",
      "Relationship types found: ['access', 'affect', 'announce', 'associate', 'be', \"chunk(text='now\", 'end', 'include', 'indict', 'located_in', 'make', 'produce', 'provides', 'related_to', 'release', 'upgrade', 'use']\n"
     ]
    }
   ],
   "source": [
    "from semantica.semantic_extract import RelationExtractor\n",
    "\n",
    "intelligence_relation_types = [\n",
    "    \"from_source\", \"occurs_at\", \"located_in\", \"happens_during\", \"correlated_with\",\n",
    "    \"targets\", \"associated_with\", \"operates_in\", \"based_in\", \"related_to\",\n",
    "    \"part_of\", \"works_for\", \"founded_by\", \"member_of\", \"collaborates_with\",\n",
    "    \"affiliated_with\", \"before\", \"after\", \"during\", \"causes\", \"affects\",\n",
    "    \"influences\", \"uses\", \"employs\", \"owns\", \"controls\", \"manages\"\n",
    "]\n",
    "\n",
    "relation_extractor = RelationExtractor(\n",
    "    method=[\"dependency\", \"pattern\", \"cooccurrence\"],\n",
    "    model=\"en_core_web_sm\",\n",
    "    relation_types=intelligence_relation_types,\n",
    "    confidence_threshold=0.5,\n",
    "    max_distance=100\n",
    ")\n",
    "\n",
    "chunks_to_process = chunked_docs\n",
    "relation_results = relation_extractor.extract(chunks_to_process, entity_results)\n",
    "\n",
    "all_relationships = []\n",
    "seen = set()\n",
    "for relationships in relation_results:\n",
    "    for rel in relationships:\n",
    "        key = (rel.subject.text, rel.predicate, rel.object.text)\n",
    "        if key not in seen:\n",
    "            seen.add(key)\n",
    "            all_relationships.append(rel)\n",
    "\n",
    "relationship_types = set(rel.predicate for rel in all_relationships)\n",
    "print(f\"Extracted {len(all_relationships)} relationships\")\n",
    "print(f\"Relationship types found: {sorted(relationship_types)}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Conflict Detection\n",
    "\n",
    "Detect and resolve conflicts in intelligence data from multiple sources. This is unique to this notebook and critical for multi-source integration.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Detecting conflicts in 1532 entities...\n",
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 8/872 (remaining: 864) |░░░░░░░░░░░░░░░| 0.9% [8/872] 🔄⚠️ (ETA: 1.6m | 9.1/s))"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: China Chopper.label has conflicting values: ['PERSON', 'ORG']\n",
      "Value conflict detected: Windows.label has conflicting values: ['ORG', 'LOC']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 40/872 (remaining: 832) |░░░░░░░░░░░░░░░| 4.6% [40/872] 🔄⚠️ (ETA: 18.3s | 45.3/s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: PowerShell Empire.label has conflicting values: ['ORG', 'GPE']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 272/872 (remaining: 600) |████░░░░░░░░░░░| 31.2% [272/872] 🔄⚠️ (ETA: 2.1s | 283.6/s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: Dridex.label has conflicting values: ['ORG', 'PERSON']\n",
      "Value conflict detected: CISA.label has conflicting values: ['ORG', 'GPE']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 424/872 (remaining: 448) |███████░░░░░░░░| 48.6% [424/872] 🔄⚠️ (ETA: 1.0s | 430.6/s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: IRGC.label has conflicting values: ['ORG', 'GPE', 'LOC']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 600/872 (remaining: 272) |██████████░░░░░| 68.8% [600/872] 🔄⚠️ (ETA: 0.5s | 569.9/s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: AI.label has conflicting values: ['ORG', 'GPE']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Checking entity groups for conflicts... 792/872 (remaining: 80) |█████████████░░| 90.8% [792/872] 🔄⚠️ (ETA: 0.1s | 685.6/s))"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Value conflict detected: Schneider Electric.label has conflicting values: ['PERSON', 'ORG']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Detected 0 conflicts |███████████████| 100.0% [848/872] ✅⚠️ (698.7/s)██████████░| 97.2% [848/872] 🔄⚠️ (ETA: 0.0s | 700.4/s))Detecting conflicts in 2111 relationships...\n",
      "🧠 Semantica is extracting: Extracting relations using cooccurrence... 🔄🎯 (2.9s) | 🧠 Semantica is resolving: Detected 0 relationship conflicts |███████████████| 100.0% [0/2111] ✅⚠️░░| 0.0% [0/2111] 🔄⚠️(1562.9/s) | 1569.0/s)))Detected 8 conflicts from multiple sources\n",
      "🧠 Semantica is resolving: Detected 0 relationship conflicts |███████████████| 100.0% [0/2111] ✅⚠️ | 🧠 Semantica is resolving: Resolving conflicts... 0/8 (remaining: 8) |░░░░░░░░░░░░░░░| 0.0% [0/8] 🔄⚠️Resolved 8 conflicts\n"
     ]
    }
   ],
   "source": [
    "from semantica.conflicts import ConflictDetector, ConflictResolver\n",
    "\n",
    "conflict_detector = ConflictDetector()\n",
    "conflict_resolver = ConflictResolver()\n",
    "\n",
    "entity_dicts = [\n",
    "    {\n",
    "        \"id\": getattr(e, \"text\", str(e)),\n",
    "        \"text\": getattr(e, \"text\", str(e)),\n",
    "        \"label\": getattr(e, \"label\", \"\"),\n",
    "        \"type\": getattr(e, \"label\", \"\"),\n",
    "        \"confidence\": getattr(e, \"confidence\", 1.0),\n",
    "        \"metadata\": getattr(e, \"metadata\", {})\n",
    "    }\n",
    "    for e in all_entities\n",
    "]\n",
    "\n",
    "print(f\"Detecting conflicts in {len(entity_dicts)} entities...\")\n",
    "entity_conflicts = conflict_detector.detect_entity_conflicts(entity_dicts)\n",
    "\n",
    "relationship_dicts = [\n",
    "    {\n",
    "        \"id\": f\"{getattr(rel.subject, 'text', str(rel.subject))}_{rel.predicate}_{getattr(rel.object, 'text', str(rel.object))}\",\n",
    "        \"source_id\": getattr(rel.subject, \"text\", str(rel.subject)),\n",
    "        \"target_id\": getattr(rel.object, \"text\", str(rel.object)),\n",
    "        \"type\": rel.predicate,\n",
    "        \"confidence\": getattr(rel, \"confidence\", 1.0),\n",
    "        \"metadata\": getattr(rel, \"metadata\", {})\n",
    "    }\n",
    "    for rel in all_relationships\n",
    "]\n",
    "\n",
    "print(f\"Detecting conflicts in {len(relationship_dicts)} relationships...\")\n",
    "relationship_conflicts = conflict_detector.detect_relationship_conflicts(relationship_dicts)\n",
    "\n",
    "all_conflicts = entity_conflicts + relationship_conflicts\n",
    "print(f\"Detected {len(all_conflicts)} conflicts from multiple sources\")\n",
    "\n",
    "if all_conflicts:\n",
    "    resolved = conflict_resolver.resolve_conflicts(\n",
    "        all_conflicts,\n",
    "        strategy=\"credibility_weighted\"\n",
    "    )\n",
    "    print(f\"Resolved {len(resolved)} conflicts\")\n",
    "else:\n",
    "    print(\"No conflicts detected\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Temporal Knowledge Graph Construction\n",
    "\n",
    "Build a temporal knowledge graph with time-aware relationships for intelligence analysis over time.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is resolving: Resolving conflicts... 0/8 (remaining: 8) |░░░░░░░░░░░░░░░| 0.0% [0/8] 🔄⚠️ | 🧠 Semantica is building: Processed 2111 relationships |███████████████| 100.0% [2111/2111] ✅🧠 (12942.7/s)13184.4/s) 13788.2/s)Resolving 1532 entities (this may take a while for large sets)...\n",
      "  Detecting duplicates and merging entities...\n",
      "🧠 Semantica is deduplicating: Merging groups... 1/1 (remaining: 0) |███████████████| 100.0% [1/1] 🔄🔄 (9.2/s) | 🧠 Semantica is deduplicating: Building merged entity... (4/4, remaining: 0 steps) |███████████████| 100.0% [4/4] 🔄🔄 (213.4/s)) 🔄🔄 (ETA: 0.0s | 203.7/s)200.1/s) 1263.9/s)))))✅ Resolved to 74 unique entities (51.20s)\n",
      "Building graph structure...\n",
      "✅ Graph structure built (0.00s)\n",
      "🧠 Semantica is deduplicating: Merging groups... 1/1 (remaining: 0) |███████████████| 100.0% [1/1] 🔄🔄 (9.2/s) | 🧠 Semantica is deduplicating: Building merged entity... (4/4, remaining: 0 steps) |███████████████| 100.0% [4/4] 🔄🔄 (213.4/s)\n",
      "============================================================\n",
      "✅ Knowledge Graph Build Complete\n",
      "   Entities: 74\n",
      "   Relationships: 2111\n",
      "   Total time: 54.99s\n",
      "============================================================\n",
      "Built temporal KG with 74 entities and 2111 relationships\n"
     ]
    }
   ],
   "source": [
    "from semantica.kg import GraphBuilder\n",
    "\n",
    "builder = GraphBuilder(\n",
    "    enable_temporal=True,\n",
    "    temporal_granularity=TEMPORAL_GRANULARITY,\n",
    "    merge_entities=True,\n",
    "    resolve_conflicts=True\n",
    ")\n",
    "\n",
    "kg = builder.build({\n",
    "    \"entities\": all_entities,\n",
    "    \"relationships\": all_relationships\n",
    "})\n",
    "\n",
    "print(f\"Built temporal KG with {len(kg.get('entities', []))} entities and {len(kg.get('relationships', []))} relationships\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Embedding Generation & Vector Store\n",
    "\n",
    "Generate embeddings for intelligence documents and store them in a vector database for semantic search.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "fastembed not available. Install with: pip install fastembed. Using fallback embedding method.\n",
      "fastembed not available. Install with: pip install fastembed. Using fallback embedding method.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is deduplicating: Building merged entity... (4/4, remaining: 0 steps) |███████████████| 100.0% [4/4] 🔄🔄 (213.4/s) | 🧠 Semantica is indexing: Storing 20 vectors 🔄📊 (0.0s)Generated 20 embeddings and stored 20 vectors in vector database\n"
     ]
    }
   ],
   "source": [
    "from semantica.embeddings import EmbeddingGenerator\n",
    "from semantica.vector_store import VectorStore\n",
    "\n",
    "embedding_gen = EmbeddingGenerator(\n",
    "    model_name=EMBEDDING_MODEL,\n",
    "    dimension=EMBEDDING_DIMENSION\n",
    ")\n",
    "\n",
    "chunks_to_embed = chunked_docs[:20]\n",
    "embeddings = embedding_gen.generate_embeddings(chunks_to_embed, data_type=\"text\")\n",
    "\n",
    "vector_store = VectorStore(backend=\"faiss\", dimension=EMBEDDING_DIMENSION)\n",
    "vector_ids = vector_store.store_vectors(\n",
    "    vectors=embeddings,\n",
    "    metadata=[{\"text\": chunk[:100]} for chunk in chunks_to_embed]\n",
    ")\n",
    "\n",
    "print(f\"Generated {len(embeddings)} embeddings and stored {len(vector_ids)} vectors in vector database\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Temporal Graph Queries\n",
    "\n",
    "Query the temporal knowledge graph to analyze intelligence data over time and identify temporal patterns.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Retrieved temporal paths for entity: Active Directory\n",
      "Analyzed event evolution over time\n"
     ]
    }
   ],
   "source": [
    "from semantica.kg import TemporalGraphQuery\n",
    "\n",
    "temporal_query = TemporalGraphQuery(temporal_granularity=TEMPORAL_GRANULARITY)\n",
    "\n",
    "entities = kg.get('entities', [])\n",
    "if entities:\n",
    "    first_entity = entities[0]\n",
    "    entity_id = first_entity.get('id') or first_entity.get('text', '')\n",
    "    if entity_id:\n",
    "        paths = temporal_query.find_temporal_paths(\n",
    "            graph=kg,\n",
    "            source=entity_id,\n",
    "            target=entity_id,\n",
    "            start_time=None,\n",
    "            end_time=None\n",
    "        )\n",
    "        print(f\"Retrieved temporal paths for entity: {entity_id}\")\n",
    "\n",
    "evolution = temporal_query.analyze_evolution(\n",
    "    graph=kg,\n",
    "    entity_type=\"Event\"\n",
    ")\n",
    "print(f\"Analyzed event evolution over time\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## GraphRAG Queries\n",
    "\n",
    "Use hybrid retrieval combining vector search and graph traversal to answer complex multi-source intelligence questions.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is reasoning: Inferring facts 🔄🤔 (0.0s) | 🧠 Semantica is processing: Building graph from 74 entities and 2111 relationships 🔄🔗 (0.0s)Intelligence Context Graph: 1082 nodes, 2111 edges\n",
      "🧠 Semantica is embedding: Generated embedding (dim: 128) |███████████████| 100.0% ✅💾 | 🧠 Semantica is processing: Generating embedding... 🔄🔗 (0.0s)less, having a greater understa... 🔄🔗 (0.0s)rab... 🔄💾 (0.0s)\n",
      "================================================================================\n",
      "Intelligence Analysis - GraphRAG with Multi-Hop Reasoning\n",
      "================================================================================\n",
      "\n",
      "================================================================================\n",
      "Intelligence Query: What entities are mentioned in multiple intelligence sources?\n",
      "================================================================================\n",
      "\n",
      "🧠 Semantica is processing: Generating embedding... 🔄🔗 (0.0s) | 🧠 Semantica is processing: Querying with reasoning: What entities are mentioned in multiple intelligen... 🔄🔗 (0.0s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Embedding generation failed: Text cannot be empty or whitespace-only\n",
      "Using random fallback embedding\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Generated Response:\n",
      "Based on the retrieved context, the entities mentioned in multiple intelligence sources are:\n",
      "\n",
      "1. **Ransomware**: It is mentioned in Context 1 (Score: 0.85) as a security threat and in Context 3 (Score: 0.76) as a type of malware.\n",
      "2. **Malware**: It is mentioned in Context 1 (Score: 0.85) as a security threat and in Context 3 (Score: 0.76) as a type of incident to be prevented.\n",
      "3. **Industrial Control Systems**: It is mentioned in Context 1 (Score: 0.85) as a critical infrastructure to be secured.\n",
      "4. **Zero Trust**: It is mentioned in Context 1 (Score: 0.85) as a security approach.\n",
      "5. **Antimalware Scan Interface**: It is mentioned in Context 2 (Score: 0.84) as a security tool.\n",
      "\n",
      "The multi-hop connections between these entities can be explained as follows:\n",
      "\n",
      "* Ransomware is a type of malware (Context 3), and malware is a security threat (Context 1).\n",
      "* Industrial Control Systems are critical infrastructure to be secured (Context 1), and securing networks is essential for protecting these systems (Context 1).\n",
      "* Zero Trust is a security approach that can be applied to protect Industrial Control Systems (Context 1).\n",
      "\n",
      "Note that the entities mentioned in multiple intelligence sources are primarily related to security threats and security measures.\n",
      "\n",
      "Confidence Score: 0.459\n",
      "Intelligence Sources: 15\n",
      "Reasoning Paths: 0\n",
      "\n",
      "\n",
      "================================================================================\n",
      "Intelligence Query: What are the temporal patterns in the intelligence data?\n",
      "================================================================================\n",
      "\n",
      "🧠 Semantica is processing: Generating embedding... 🔄🔗 (0.0s) | 🧠 Semantica is processing: Querying with reasoning: What are the temporal patterns in the intelligence... 🔄🔗 (0.0s)"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Embedding generation failed: Text cannot be empty or whitespace-only\n",
      "Using random fallback embedding\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is processing: Generating embedding... 🔄🔗 (0.0s) | 🧠 Semantica is processing: Retrieved 15 results |███████████████| 100.0% ✅🔗Generated Response:\n",
      "Based on the retrieved context, I found that there is limited information about temporal patterns in intelligence data. However, I can provide some insights related to cybersecurity and threat intelligence.\n",
      "\n",
      "The China Chopper Web Shell - Part II (Context 5) is a known web shell used in cyber attacks. It is often used by threat actors to gain unauthorized access to systems. The temporal patterns of its usage can be inferred from the context of cybersecurity threat intelligence.\n",
      "\n",
      "The National Cybersecurity and Communications Integration Center (Context 3) and the Cybersecurity and Infrastructure Security Agency (Context 4) are both part of the US Department of Homeland Security, which is responsible for monitoring and responding to cyber threats. They may have information on the temporal patterns of cyber attacks, including those involving the China Chopper Web Shell.\n",
      "\n",
      "However, I couldn't find any direct information on temporal patterns in intelligence data from the retrieved context. The Danish Defence Intelligence Service (Context 2) and the Antimalware Scan Interface (Context 1) are not directly related to the topic.\n",
      "\n",
      "To answer the question, I would need to make an assumption or infer based on the available context. Assuming that the question is related to the temporal patterns of cyber attacks, I would say that the China Chopper Web Shell - Part II is a known threat that has been used in various cyber attacks over time. The temporal patterns of its usage can be inferred from the context of cybersecurity threat intelligence, but specific information is not available in the retrieved context.\n",
      "\n",
      "Multi-hop connections:\n",
      "\n",
      "* The China Chopper Web Shell - Part II (Context 5) is related to the National Cybersecurity and Communications Integration Center (Context 3) and the Cybersecurity and Infrastructure Security Agency (Context 4) through the context of cybersecurity threat intelligence.\n",
      "* The Danish Defence Intelligence Service (Context 2) is not directly related to the topic, but it may have information on intelligence data that is not available in the retrieved context.\n",
      "\n",
      "In conclusion, while I couldn't find direct information on temporal patterns in intelligence data, I can provide some insights related to cybersecurity and threat intelligence. The China Chopper Web Shell - Part II is a known threat that has been used in various cyber attacks over time, and its temporal patterns can be inferred from the context of cybersecurity threat intelligence.\n",
      "\n",
      "Confidence Score: 0.469\n",
      "Intelligence Sources: 15\n",
      "Reasoning Paths: 0\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from semantica.context import AgentContext, ContextGraph\n",
    "from semantica.llms import Groq\n",
    "import os\n",
    "\n",
    "context_graph = ContextGraph()\n",
    "context_graph.build_from_entities_and_relationships(\n",
    "    entities=kg.get('entities', []),\n",
    "    relationships=[{**r, 'source_id': r.get('source_id') or r.get('source'), 'target_id': r.get('target_id') or r.get('target')} for r in kg.get('relationships', [])]\n",
    ")\n",
    "\n",
    "graph_stats = context_graph.stats()\n",
    "print(f\"Intelligence Context Graph: {graph_stats['node_count']} nodes, {graph_stats['edge_count']} edges\")\n",
    "\n",
    "context = AgentContext(\n",
    "    vector_store=vector_store,\n",
    "    knowledge_graph=context_graph,\n",
    "    hybrid_alpha=0.7,\n",
    "    use_graph_expansion=True,\n",
    "    max_expansion_hops=3\n",
    ")\n",
    "\n",
    "for chunk in chunked_docs[:30]:\n",
    "    if chunk and chunk.strip():\n",
    "        context.store(\n",
    "            content=chunk,\n",
    "            metadata={'source': 'intelligence_analysis'},\n",
    "            extract_entities=True,\n",
    "            link_entities=True\n",
    "        )\n",
    "\n",
    "llm = Groq(model=\"llama-3.1-8b-instant\", api_key=os.getenv(\"GROQ_API_KEY\"))\n",
    "\n",
    "intelligence_queries = [\n",
    "    \"What entities are mentioned in multiple intelligence sources?\",\n",
    "    \"What are the temporal patterns in the intelligence data?\"\n",
    "]\n",
    "\n",
    "print(\"\\n\" + \"=\" * 80)\n",
    "print(\"Intelligence Analysis - GraphRAG with Multi-Hop Reasoning\")\n",
    "print(\"=\" * 80)\n",
    "\n",
    "for query in intelligence_queries:\n",
    "    print(f\"\\n{'='*80}\")\n",
    "    print(f\"Intelligence Query: {query}\")\n",
    "    print(f\"{'='*80}\\n\")\n",
    "    \n",
    "    result = context.query_with_reasoning(\n",
    "        query=query,\n",
    "        llm_provider=llm,\n",
    "        max_results=15,\n",
    "        max_hops=3,\n",
    "        min_score=0.2\n",
    "    )\n",
    "    \n",
    "    print(f\"Generated Response:\\n{result.get('response', 'No response available')}\\n\")\n",
    "    \n",
    "    if result.get('reasoning_path'):\n",
    "        print(f\"Reasoning Path:\\n{result.get('reasoning_path')}\\n\")\n",
    "    \n",
    "    print(f\"Confidence Score: {result.get('confidence', 0):.3f}\")\n",
    "    print(f\"Intelligence Sources: {result.get('num_sources', 0)}\")\n",
    "    print(f\"Reasoning Paths: {result.get('num_reasoning_paths', 0)}\")\n",
    "    print()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Visualization\n",
    "\n",
    "Visualize the intelligence knowledge graph to explore relationships, temporal patterns, and multi-source correlations.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\umap\\__init__.py:9: ImportWarning: Tensorflow not installed; ParametricUMAP will be unavailable\n",
      "  warn(\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is processing: Retrieved 15 results |███████████████| 100.0% ✅🔗 | 🧠 Semantica is visualizing: Visualization generated: 74 nodes, 25 edges |███████████████| 100.0% ✅📈"
     ]
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hoverinfo": "none",
         "line": {
          "color": "#888",
          "width": 1
         },
         "mode": "lines",
         "opacity": 0.5,
         "showlegend": false,
         "type": "scatter",
         "x": [
          -0.42199496637345546,
          -0.8280365851717089,
          null,
          0.7120473665214152,
          0.8893623108391249,
          null,
          0.11954429100065235,
          -0.5824925705697847,
          null,
          -0.5824925705697847,
          -0.5824925705697847,
          null,
          0.9154124421551354,
          0.9154124421551354,
          null,
          -0.8558834126517558,
          -0.9067375777707498,
          null,
          -0.9067375777707498,
          -0.9067375777707498,
          null,
          -0.9564522010120188,
          -0.9564522010120188,
          null,
          -0.08365111438465035,
          0.08490006323144923,
          null,
          0.08490006323144923,
          -0.3756016753227434,
          null,
          0.08490006323144923,
          0.08490006323144923,
          null,
          -0.2628122506754005,
          0.08490006323144923,
          null,
          0.08490006323144923,
          0.3164705887210871,
          null,
          0.08490006323144923,
          -0.2628122506754005,
          null,
          0.3164705887210871,
          -0.2628122506754005,
          null,
          0.24316407465027537,
          0.08490006323144923,
          null,
          0.5443684794596161,
          -0.027492160393869793,
          null,
          0.3164705887210871,
          0.08490006323144923,
          null,
          0.08490006323144923,
          0.5774038578413685,
          null,
          0.41115446474891204,
          -0.08365111438465035,
          null,
          -0.4715229386194042,
          -0.24241815436413022,
          null,
          0.4249750646746793,
          0.5477731308773482,
          null,
          0.4249750646746793,
          0.09560551594938178,
          null,
          0.5477731308773482,
          0.09560551594938178,
          null,
          -0.24241815436413022,
          -0.6744680464309178,
          null
         ],
         "y": [
          -0.7305137861287453,
          0.509844008724767,
          null,
          -0.658060106763627,
          0.461796964805805,
          null,
          0.9796456906012542,
          0.856916348281853,
          null,
          0.856916348281853,
          0.856916348281853,
          null,
          0.4118800586017539,
          0.4118800586017539,
          null,
          -0.40678192419756665,
          0.4622308881112661,
          null,
          0.4622308881112661,
          0.4622308881112661,
          null,
          -0.10561489398925779,
          -0.10561489398925779,
          null,
          -0.9090535698938054,
          -0.4491474162411359,
          null,
          -0.4491474162411359,
          -0.2106059731686926,
          null,
          -0.4491474162411359,
          -0.4491474162411359,
          null,
          -0.913431978853603,
          -0.4491474162411359,
          null,
          -0.4491474162411359,
          -0.24283945468810347,
          null,
          -0.4491474162411359,
          -0.913431978853603,
          null,
          -0.24283945468810347,
          -0.913431978853603,
          null,
          -0.8884896480934111,
          -0.4491474162411359,
          null,
          0.8258015765392287,
          0.9647427073810292,
          null,
          -0.24283945468810347,
          -0.4491474162411359,
          null,
          -0.4491474162411359,
          0.23313711347782134,
          null,
          -0.04893501694147032,
          -0.9090535698938054,
          null,
          -0.5553574933744359,
          -0.7961959481046859,
          null,
          -0.5760055544490937,
          -0.7360693241864533,
          null,
          -0.5760055544490937,
          -0.9163428518037301,
          null,
          -0.7360693241864533,
          -0.9163428518037301,
          null,
          -0.7961959481046859,
          -0.5395377271132678,
          null
         ]
        },
        {
         "hoverinfo": "none",
         "mode": "text",
         "showlegend": false,
         "text": [
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to",
          "related_to"
         ],
         "textfont": {
          "color": "#555",
          "size": 8
         },
         "textposition": "middle center",
         "type": "scatter",
         "x": [
          -0.6250157757725822,
          0.80070483868027,
          -0.23147413978456616,
          -0.5824925705697847,
          0.9154124421551354,
          -0.8813104952112528,
          -0.9067375777707498,
          -0.9564522010120188,
          0.0006244744233994404,
          -0.1453508060456471,
          0.08490006323144923,
          -0.08895609372197563,
          0.20068532597626815,
          -0.08895609372197563,
          0.026829169022843297,
          0.1640320689408623,
          0.25843815953287314,
          0.20068532597626815,
          0.3311519605364089,
          0.16375167518213085,
          -0.3569705464917672,
          0.4863740977760138,
          0.26029029031203055,
          0.32168932341336504,
          -0.458443100397524
         ],
         "y": [
          -0.11033488870198915,
          -0.09813157097891101,
          0.9182810194415536,
          0.856916348281853,
          0.4118800586017539,
          0.027724481956849734,
          0.4622308881112661,
          -0.10561489398925779,
          -0.6791004930674707,
          -0.32987669470491426,
          -0.4491474162411359,
          -0.6812896975473695,
          -0.3459934354646197,
          -0.6812896975473695,
          -0.5781357167708533,
          -0.6688185321672735,
          0.8952721419601289,
          -0.3459934354646197,
          -0.10800515138165728,
          -0.47899429341763783,
          -0.6757767207395609,
          -0.6560374393177735,
          -0.7461742031264119,
          -0.8262060879950917,
          -0.6678668376089768
         ]
        },
        {
         "hoverinfo": "text",
         "hovertext": [
          "<b>Active Directory</b><br>Type: PERSON",
          "<b>ABB</b><br>Type: ORG",
          "<b>target=\"_blank</b><br>Type: PERSON",
          "<b>TCP</b><br>Type: ORG",
          "<b>UNODC</b><br>Type: ORG",
          "<b>Locky</b><br>Type: GPE",
          "<b>Message Servers</b><br>Type: ORG",
          "<b>FTP</b><br>Type: ORG",
          "<b>faturamento[@]sudestecaminhoes[.]com.br</td>\\n</b><br>Type: PERSON",
          "<b>JavaScript</b><br>Type: ORG",
          "<b>Justice</b><br>Type: ORG",
          "<b>Johnson Controls</b><br>Type: PERSON",
          "<b>PII</b><br>Type: ORG",
          "<b>PHP</b><br>Type: ORG",
          "<b>PowerShell</b><br>Type: ORG",
          "<b>Pulse Secure</b><br>Type: ORG",
          "<b>Emerson</b><br>Type: PERSON",
          "<b>IP</b><br>Type: ORG",
          "<b>INTERPOL</b><br>Type: ORG",
          "<b>>China Chopper</b><br>Type: ORG",
          "<b>href=\"https://owasp.org</b><br>Type: ORG",
          "<b>HMS Networks</b><br>Type: ORG",
          "<b>Honeywell</b><br>Type: ORG",
          "<b>2014-93434251-04ac</b><br>Type: DATE",
          "<b>Russia</b><br>Type: GPE",
          "<b>Bugat</b><br>Type: ORG",
          "<b>BitPaymer</b><br>Type: ORG",
          "<b>Dridex</b><br>Type: ORG",
          "<b>13 October 2015</b><br>Type: DATE",
          "<b>Onerep</b><br>Type: ORG",
          "<b>OPW Fuel Management Systems</b><br>Type: ORG",
          "<b>Kunbus</b><br>Type: GPE",
          "<b>3389</b><br>Type: DATE",
          "<b>Guide to Malware Incident Prevention and Handling for Desktops</b><br>Type: ORG",
          "<b>Gemini</b><br>Type: GPE",
          "<b>44</b><br>Type: DATE",
          "<b>year</b><br>Type: DATE",
          "<b>1011</b><br>Type: DATE",
          "<b>China</b><br>Type: GPE",
          "<b>26 September 2018</b><br>Type: DATE",
          "<b>network.</li>\\n</ul>\\n</b><br>Type: GPE",
          "<b>WannaCry</b><br>Type: ORG",
          "<b>summer 2018</b><br>Type: DATE",
          "<b>PDF</b><br>Type: ORG",
          "<b>keys\\' Registry</b><br>Type: ORG",
          "<b>View Red Notices Home How</b><br>Type: ORG",
          "<b>31 August 2018</b><br>Type: DATE",
          "<b>ZIP</b><br>Type: ORG",
          "<b>Quasar</b><br>Type: PERSON",
          "<b>Hypertext Preprocessor</b><br>Type: PERSON",
          "<b>>Lateral Movement Framework</b><br>Type: ORG",
          "<b>Business Guide</b><br>Type: ORG",
          "<b>Hygiene - Cyber</b><br>Type: PERSON",
          "<b>JBoss</b><br>Type: PERSON",
          "<b>90 days</b><br>Type: DATE",
          "<b>821875</b><br>Type: DATE",
          "<b>CIG.</em></p>\\n</b><br>Type: ORG",
          "<b>XML</b><br>Type: ORG",
          "<b>Osiris</b><br>Type: GPE",
          "<b>Evil Corp</b><br>Type: ORG",
          "<b>“Cyber Event Indicators</b><br>Type: ORG",
          "<b>Knock Down Dridex Malware</b><br>Type: PERSON",
          "<b>4997</b><br>Type: DATE",
          "<b>GlobeImposter\">https://www.proofpoint.com</b><br>Type: ORG",
          "<b>6 April 2015</b><br>Type: DATE",
          "<b>VBScript</b><br>Type: ORG",
          "<b>>Windows Remote Desktop Client Vulnerability - CVE-2020</b><br>Type: ORG",
          "<b>Dark Reading</b><br>Type: ORG",
          "<b>VolkLocker</b><br>Type: ORG",
          "<b>GitHub</b><br>Type: ORG",
          "<b>11-month-old</b><br>Type: DATE",
          "<b>Afghanistan</b><br>Type: GPE",
          "<b>CBP Home</b><br>Type: ORG",
          "<b>Memoriam Laws & Regulations Leadership Mission Organization Site Links Breadcrumb Home News News All DHS News</b><br>Type: ORG"
         ],
         "marker": {
          "color": [
           "#4ECDC4",
           "#FFA07A",
           "#4ECDC4",
           "#FFA07A",
           "#FFA07A",
           "#45B7D1",
           "#FFA07A",
           "#FFA07A",
           "#4ECDC4",
           "#FFA07A",
           "#FFA07A",
           "#4ECDC4",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#4ECDC4",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FF6B6B",
           "#45B7D1",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FF6B6B",
           "#FFA07A",
           "#FFA07A",
           "#45B7D1",
           "#FF6B6B",
           "#FFA07A",
           "#45B7D1",
           "#FF6B6B",
           "#FF6B6B",
           "#FF6B6B",
           "#45B7D1",
           "#FF6B6B",
           "#45B7D1",
           "#FFA07A",
           "#FF6B6B",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FF6B6B",
           "#FFA07A",
           "#4ECDC4",
           "#4ECDC4",
           "#FFA07A",
           "#FFA07A",
           "#4ECDC4",
           "#4ECDC4",
           "#FF6B6B",
           "#FF6B6B",
           "#FFA07A",
           "#FFA07A",
           "#45B7D1",
           "#FFA07A",
           "#FFA07A",
           "#4ECDC4",
           "#FF6B6B",
           "#FFA07A",
           "#FF6B6B",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FFA07A",
           "#FF6B6B",
           "#45B7D1",
           "#FFA07A",
           "#FFA07A"
          ],
          "line": {
           "color": "white",
           "width": 2
          },
          "opacity": 1,
          "size": [
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10,
           10
          ]
         },
         "mode": "markers+text",
         "showlegend": false,
         "text": [
          "Active Directory",
          "ABB",
          "target=\"_blank",
          "TCP",
          "UNODC",
          "Locky",
          "Message Servers",
          "FTP",
          "faturamento[@]sudestecaminhoes[.]com.br</td>\\n",
          "JavaScript",
          "Justice",
          "Johnson Controls",
          "PII",
          "PHP",
          "PowerShell",
          "Pulse Secure",
          "Emerson",
          "IP",
          "INTERPOL",
          ">China Chopper",
          "href=\"https://owasp.org",
          "HMS Networks",
          "Honeywell",
          "2014-93434251-04ac",
          "Russia",
          "Bugat",
          "BitPaymer",
          "Dridex",
          "13 October 2015",
          "Onerep",
          "OPW Fuel Management Systems",
          "Kunbus",
          "3389",
          "Guide to Malware Incident Prevention and Handling for Desktops",
          "Gemini",
          "44",
          "year",
          "1011",
          "China",
          "26 September 2018",
          "network.</li>\\n</ul>\\n",
          "WannaCry",
          "summer 2018",
          "PDF",
          "keys\\' Registry",
          "View Red Notices Home How",
          "31 August 2018",
          "ZIP",
          "Quasar",
          "Hypertext Preprocessor",
          ">Lateral Movement Framework",
          "Business Guide",
          "Hygiene - Cyber",
          "JBoss",
          "90 days",
          "821875",
          "CIG.</em></p>\\n",
          "XML",
          "Osiris",
          "Evil Corp",
          "“Cyber Event Indicators",
          "Knock Down Dridex Malware",
          "4997",
          "GlobeImposter\">https://www.proofpoint.com",
          "6 April 2015",
          "VBScript",
          ">Windows Remote Desktop Client Vulnerability - CVE-2020",
          "Dark Reading",
          "VolkLocker",
          "GitHub",
          "11-month-old",
          "Afghanistan",
          "CBP Home",
          "Memoriam Laws & Regulations Leadership Mission Organization Site Links Breadcrumb Home News News All DHS News"
         ],
         "textfont": {
          "color": "#333",
          "size": 10
         },
         "textposition": "top center",
         "type": "scatter",
         "x": [
          -0.6344539986104939,
          -0.4715229386194042,
          0.8893623108391249,
          -0.8558834126517558,
          -0.9078519786996507,
          -0.2628122506754005,
          0.41585169663510974,
          -0.08365111438465035,
          0.8941437649801682,
          -0.37814089145143637,
          0.9759215593655634,
          -0.24241815436413022,
          -0.6646072503081388,
          -0.8280365851717089,
          -0.5824925705697847,
          -0.16281315522967538,
          0.4249750646746793,
          -0.027492160393869793,
          0.6674138055496573,
          -0.4865212241743028,
          -0.4604699823803778,
          0.5477731308773482,
          0.09560551594938178,
          0.7120473665214152,
          -0.9564522010120188,
          -0.3756016753227434,
          0.3164705887210871,
          0.08490006323144923,
          -0.6152260093798788,
          0.9123407524572855,
          -0.029740115290625393,
          -0.6744680464309178,
          -0.9067375777707498,
          0.9154124421551354,
          0.7743328736580127,
          -0.5140532455466044,
          0.41115446474891204,
          0.4641299266076592,
          -0.849832423540146,
          -0.7427543252489891,
          0.28942846217465806,
          0.04259845166354215,
          0.9808481780246069,
          0.5037994213127422,
          0.7520657195184386,
          -0.3689570996404672,
          0.9306036538169964,
          -0.2672625988381252,
          0.6568236020159589,
          -0.42199496637345546,
          0.11954429100065235,
          0.1460354023747057,
          0.38374616270515166,
          0.9623940422329329,
          0.9349624323845835,
          -0.9304994386226021,
          -0.7922954395051602,
          -0.08704559576127936,
          -0.8431706820957529,
          0.24316407465027537,
          0.5443684794596161,
          0.8342103960003796,
          -0.7821993752451547,
          0.5774038578413685,
          0.7841540945033795,
          -0.931228188813725,
          -0.8469743798141431,
          0.2844147819282231,
          -0.9658827688009344,
          0.8642173981702258,
          0.2073534677231381,
          -0.6071561851417774,
          -0.9233662003479001,
          0.9380945097543668
         ],
         "y": [
          0.6207742271607068,
          -0.5553574933744359,
          0.461796964805805,
          -0.40678192419756665,
          0.06463125554372041,
          -0.913431978853603,
          -0.8791889634443265,
          -0.9090535698938054,
          0.319555783189524,
          0.9292849735907334,
          0.004178257394694681,
          -0.7961959481046859,
          -0.7459584145268705,
          0.509844008724767,
          0.856916348281853,
          0.9588687128954906,
          -0.5760055544490937,
          0.9647427073810292,
          0.6746771721384155,
          0.8610778903045142,
          -0.7217543187498774,
          -0.7360693241864533,
          -0.9163428518037301,
          -0.658060106763627,
          -0.10561489398925779,
          -0.2106059731686926,
          -0.24283945468810347,
          -0.4491474162411359,
          -0.6799390646735481,
          -0.36671573050193385,
          -0.9441039634150151,
          -0.5395377271132678,
          0.4622308881112661,
          0.4118800586017539,
          -0.5447987461342519,
          -0.8081920227518224,
          -0.04893501694147032,
          0.84244349942087,
          0.14678208878975493,
          0.4082285349819926,
          -0.931285171075168,
          0.9999999999999999,
          -0.16733609623087012,
          -0.8135198000234528,
          -0.634103349571109,
          0.7945929317883017,
          -0.07620696106707596,
          0.9740018719613636,
          0.8354395774926746,
          -0.7305137861287453,
          0.9796456906012542,
          -0.858192442217351,
          0.9002787219765658,
          0.11341914512150097,
          -0.25856543526981013,
          0.34445532386619465,
          -0.60819212109671,
          0.8286213041145976,
          0.26029412459138207,
          -0.8884896480934111,
          0.8258015765392287,
          -0.39432160334196054,
          0.4953447413708467,
          0.23313711347782134,
          0.676057543102383,
          -0.2194513519627128,
          -0.29758214414462586,
          0.930628069789133,
          0.025537544678549195,
          -0.5146995656625085,
          0.8795755211436738,
          0.7277957141336291,
          -0.3944685428101575,
          0.21901858959625445
         ]
        }
       ],
       "layout": {
        "annotations": [
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.42199496637345546,
          "axref": "x",
          "ay": -0.7305137861287453,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.8280365851717089,
          "xref": "x",
          "y": 0.509844008724767,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.7120473665214152,
          "axref": "x",
          "ay": -0.658060106763627,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.8893623108391249,
          "xref": "x",
          "y": 0.461796964805805,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.11954429100065235,
          "axref": "x",
          "ay": 0.9796456906012542,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.5824925705697847,
          "xref": "x",
          "y": 0.856916348281853,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.5824925705697847,
          "axref": "x",
          "ay": 0.856916348281853,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.5824925705697847,
          "xref": "x",
          "y": 0.856916348281853,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.9154124421551354,
          "axref": "x",
          "ay": 0.4118800586017539,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.9154124421551354,
          "xref": "x",
          "y": 0.4118800586017539,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.8558834126517558,
          "axref": "x",
          "ay": -0.40678192419756665,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.9067375777707498,
          "xref": "x",
          "y": 0.4622308881112661,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.9067375777707498,
          "axref": "x",
          "ay": 0.4622308881112661,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.9067375777707498,
          "xref": "x",
          "y": 0.4622308881112661,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.9564522010120188,
          "axref": "x",
          "ay": -0.10561489398925779,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.9564522010120188,
          "xref": "x",
          "y": -0.10561489398925779,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.08365111438465035,
          "axref": "x",
          "ay": -0.9090535698938054,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.08490006323144923,
          "xref": "x",
          "y": -0.4491474162411359,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.08490006323144923,
          "axref": "x",
          "ay": -0.4491474162411359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.3756016753227434,
          "xref": "x",
          "y": -0.2106059731686926,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.08490006323144923,
          "axref": "x",
          "ay": -0.4491474162411359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.08490006323144923,
          "xref": "x",
          "y": -0.4491474162411359,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.2628122506754005,
          "axref": "x",
          "ay": -0.913431978853603,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.08490006323144923,
          "xref": "x",
          "y": -0.4491474162411359,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.08490006323144923,
          "axref": "x",
          "ay": -0.4491474162411359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.3164705887210871,
          "xref": "x",
          "y": -0.24283945468810347,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.08490006323144923,
          "axref": "x",
          "ay": -0.4491474162411359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.2628122506754005,
          "xref": "x",
          "y": -0.913431978853603,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.3164705887210871,
          "axref": "x",
          "ay": -0.24283945468810347,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.2628122506754005,
          "xref": "x",
          "y": -0.913431978853603,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.24316407465027537,
          "axref": "x",
          "ay": -0.8884896480934111,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.08490006323144923,
          "xref": "x",
          "y": -0.4491474162411359,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.5443684794596161,
          "axref": "x",
          "ay": 0.8258015765392287,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.027492160393869793,
          "xref": "x",
          "y": 0.9647427073810292,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.3164705887210871,
          "axref": "x",
          "ay": -0.24283945468810347,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.08490006323144923,
          "xref": "x",
          "y": -0.4491474162411359,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.08490006323144923,
          "axref": "x",
          "ay": -0.4491474162411359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.5774038578413685,
          "xref": "x",
          "y": 0.23313711347782134,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.41115446474891204,
          "axref": "x",
          "ay": -0.04893501694147032,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.08365111438465035,
          "xref": "x",
          "y": -0.9090535698938054,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.4715229386194042,
          "axref": "x",
          "ay": -0.5553574933744359,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.24241815436413022,
          "xref": "x",
          "y": -0.7961959481046859,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.4249750646746793,
          "axref": "x",
          "ay": -0.5760055544490937,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.5477731308773482,
          "xref": "x",
          "y": -0.7360693241864533,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.4249750646746793,
          "axref": "x",
          "ay": -0.5760055544490937,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.09560551594938178,
          "xref": "x",
          "y": -0.9163428518037301,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": 0.5477731308773482,
          "axref": "x",
          "ay": -0.7360693241864533,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": 0.09560551594938178,
          "xref": "x",
          "y": -0.9163428518037301,
          "yref": "y"
         },
         {
          "arrowcolor": "#888",
          "arrowhead": 2,
          "arrowsize": 1,
          "arrowwidth": 1,
          "ax": -0.24241815436413022,
          "axref": "x",
          "ay": -0.7961959481046859,
          "ayref": "y",
          "opacity": 0.6,
          "standoff": 15,
          "x": -0.6744680464309178,
          "xref": "x",
          "y": -0.5395377271132678,
          "yref": "y"
         }
        ],
        "hovermode": "closest",
        "margin": {
         "b": 20,
         "l": 5,
         "r": 5,
         "t": 40
        },
        "plot_bgcolor": "white",
        "showlegend": false,
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermap": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermap"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "text": "Knowledge Graph Network"
        },
        "xaxis": {
         "showgrid": false,
         "showticklabels": false,
         "zeroline": false
        },
        "yaxis": {
         "showgrid": false,
         "showticklabels": false,
         "zeroline": false
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from semantica.visualization import KGVisualizer\n",
    "\n",
    "visualizer = KGVisualizer(layout=\"force\", color_scheme=\"vibrant\")\n",
    "visualizer.visualize_network(kg, output=\"interactive\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "## Export\n",
    "\n",
    "Export the knowledge graph in multiple formats for intelligence reporting and further analysis.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🧠 Semantica is exporting: Exporting graph to graphml: intelligence_analysis.graphml 🔄💾 (0.0s) | 🧠 Semantica is exporting: Exported JSON (json) to: intelligence_analysis.json |███████████████| 100.0% ✅💾Exported knowledge graph in JSON, GraphML, and CSV formats\n"
     ]
    }
   ],
   "source": [
    "from semantica.export import GraphExporter, JSONExporter, CSVExporter\n",
    "\n",
    "GraphExporter().export_knowledge_graph(kg, \"intelligence_analysis.graphml\", format=\"graphml\")\n",
    "JSONExporter().export_knowledge_graph(kg, \"intelligence_analysis.json\")\n",
    "CSVExporter().export_knowledge_graph(kg, \"intelligence_analysis.csv\")\n",
    "\n",
    "print(\"Exported knowledge graph in JSON, GraphML, and CSV formats\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
