Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

Merge main and resolve conflicts by prioritizing audited reasoning refactor

KaifAhmad17046c92b3aa4
diff --cc README.md
index f1fae4cf,0d40a410..206b44af
--- a/README.md
+++ b/README.md
@@@ -227,8 -229,6 +229,11 @@@ python -c "import semantica; print(sema
**Current Version:** [![PyPI version](https://badge.fury.io/py/semantica.svg)](https://pypi.org/project/semantica/0.0.1/) β€’ [View on PyPI](https://pypi.org/project/semantica/0.0.1/)
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+=======
++=======
++>>>>>>> main
## 🍳 Semantica Cookbook
> **Interactive Jupyter Notebooks** designed to take you from beginner to expert.
@@@ -240,7 -240,7 +245,11 @@@
| **Recipe** | **Description** | **Link** |
|:-----------|:----------------|:---------|
| **GraphRAG Complete** | Build a production-ready **Graph Retrieval Augmented Generation** system. Features **Graph Validation**, **Hybrid Retrieval**, and **Logical Inference**. | [Open Notebook](cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb) |
++<<<<<<< HEAD
+| **RAG vs. GraphRAG** | Side-by-side comparison. Demonstrates the **Reasoning Gap** and how GraphRAG solves it. | [Open Notebook](cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb) |
++=======
+ | **RAG vs. GraphRAG** | Side-by-side comparison. Demonstrates the **Reasoning Gap** and how GraphRAG solves it with **Inference Engines**. | [Open Notebook](cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb) |
++>>>>>>> main
| **First Knowledge Graph** | Go from raw text to a queryable knowledge graph in 20 minutes. | [Open Notebook](cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb) |
| **Real-Time Anomalies** | Detect anomalies in streaming data using dynamic graphs. | [Open Notebook](cookbook/use_cases/cybersecurity/01_Anomaly_Detection_Real_Time.ipynb) |
@@@ -253,7 -253,6 +262,10 @@@
> **Note:** Once published to PyPI, you'll be able to install with `pip install semantica`
++<<<<<<< HEAD
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
### Install from Source (Development)
```bash
diff --cc cookbook/introduction/01_Welcome_to_Semantica.ipynb
index 3fa59a67,b9e86174..1d4496f9
--- a/cookbook/introduction/01_Welcome_to_Semantica.ipynb
+++ b/cookbook/introduction/01_Welcome_to_Semantica.ipynb
@@@ -1,857 -1,515 +1,1130 @@@
{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Hawksight-AI/semantica/blob/main/cookbook/introduction/01_Welcome_to_Semantica.ipynb)\n",
- "\n",
- "# Welcome to Semantica\n",
- "\n",
- "## Overview\n",
- "\n",
- "This notebook introduces you to the **Semantica framework** - a comprehensive knowledge graph and semantic processing framework for building production-ready semantic AI applications.\n",
- "\n",
- "**Documentation**: [Getting Started](https://semantica.readthedocs.io/getting-started/) β€’ [Concepts](https://semantica.readthedocs.io/concepts/) β€’ [API Reference](https://semantica.readthedocs.io/reference/)\n",
- "\n",
- "### What You'll Learn\n",
- "\n",
- "- What Semantica is and why it's useful\n",
- "- How to install and configure the framework\n",
- "- Understanding the framework architecture\n",
- "- Key concepts and terminology\n",
- "- Next steps for getting started\n",
- "\n",
- "## What is Semantica?\n",
- "\n",
- "**Semantica** is a production-ready framework for:\n",
- "\n",
- "- **Building Knowledge Graphs**: Transform unstructured data into structured knowledge graphs\n",
- "- **Semantic Processing**: Extract entities, relationships, and meaning from text\n",
- "- **GraphRAG**: Graph-based retrieval augmented generation\n",
- "- **Temporal Analysis**: Time-aware knowledge graphs\n",
- "- **Text Processing**: Handle text and structured data\n",
- "- **Enterprise Features**: Quality assurance, conflict resolution, ontology generation\n",
- "\n",
- "### Use Cases\n",
- "\n",
- "- Threat intelligence and cybersecurity\n",
- "- Healthcare and medical research\n",
- "- Financial analysis and fraud detection\n",
- "- Supply chain optimization\n",
- "- Research and knowledge management\n",
- "- Multi-agent AI systems\n",
- "\n",
- "\n",
- "## Installation & Setup\n",
- "\n",
- "### Prerequisites\n",
- "\n",
- "Before installing Semantica, ensure you have:\n",
- "- Python 3.8 or higher\n",
- "- pip package manager\n",
- "- (Optional) Virtual environment for isolation\n",
- "\n",
- "### Installation Methods\n",
- "\n",
- "```bash\n",
- "# Method 1: Install from PyPI (Recommended)\n",
- "pip install semantica\n",
- "\n",
- "# Or install with all optional dependencies:\n",
- "pip install semantica[all]\n",
- "\n",
- "# Method 2: Install from source (development version)\n",
- "git clone https://github.com/Hawksight-AI/semantica.git\n",
- "cd semantica\n",
- "pip install -e .\n",
- "\n",
- "# Or with all optional dependencies:\n",
- "pip install -e \".[all]\"\n",
- "\n",
- "# Verify installation\n",
- "import semantica\n",
- "print(semantica.__version__)\n",
- "```\n",
- "\n",
- "### Configuration\n",
- "\n",
- "```bash\n",
- "# Set up environment variables for API keys and configuration\n",
- "# export SEMANTICA_API_KEY=your_openai_key\n",
- "# export SEMANTICA_EMBEDDING_PROVIDER=openai\n",
- "# export SEMANTICA_MODEL_NAME=gpt-4\n",
- "\n",
- "# Or use a config file (config.yaml):\n",
- "# api_keys:\n",
- "# openai: your_key_here\n",
- "# anthropic: your_key_here\n",
- "# embedding:\n",
- "# provider: openai\n",
- "# model: text-embedding-3-large\n",
- "# dimensions: 3072\n",
- "# knowledge_graph:\n",
- "# backend: networkx # or neo4j, arangodb\n",
- "# temporal: true\n",
- "```\n",
- "\n",
- "---\n",
- "\n",
- "## Framework Architecture Overview\n",
- "\n",
- "Semantica is organized into modular components, each handling a specific aspect of semantic processing:\n",
- "\n",
- "### 1. INGEST MODULE - Data Ingestion\n",
- "**Purpose**: Ingest data from various sources\n",
- "**Components**:\n",
- "- `FileIngestor`: Read files (PDF, DOCX, HTML, JSON, CSV, etc.)\n",
- "- `WebIngestor`: Scrape and ingest web pages\n",
- "- `FeedIngestor`: Process RSS/Atom feeds\n",
- "- `StreamIngestor`: Real-time data streaming (Kafka, RabbitMQ, Kinesis, Pulsar)\n",
- "- `DBIngestor`: Database queries and ingestion (PostgreSQL, MySQL, SQLite, Oracle, SQL Server)\n",
- "- `EmailIngestor`: Process email messages (IMAP, POP3)\n",
- "- `RepoIngestor`: Git repository analysis\n",
- "- `MCPIngestor`: Model Context Protocol server integration\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.ingest import FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
- "file_ingestor = FileIngestor()\n",
- "web_ingestor = WebIngestor()\n",
- "documents = file_ingestor.ingest(\"data/\")\n",
- "web_docs = web_ingestor.ingest(\"https://example.com\")\n",
- "```\n",
- "\n",
- "### 2. PARSE MODULE - Document Parsing\n",
- "**Purpose**: Parse and extract content from various formats\n",
- "**Components**:\n",
- "- `DocumentParser`: Main parser orchestrator\n",
- "- `PDFParser`: Extract text, tables, images from PDFs\n",
- "- `DOCXParser`: Parse Word documents\n",
- "- `HTMLParser`: Extract content from HTML\n",
- "- `JSONParser`: Parse structured JSON data\n",
- "- `ExcelParser`: Process spreadsheets\n",
- "- `ImageParser`: OCR and image analysis\n",
- "- `CodeParser`: Parse source code files\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.parse import DocumentParser\n",
- "parser = DocumentParser()\n",
- "parsed_docs = parser.parse(documents)\n",
- "```\n",
- "\n",
- "### 3. NORMALIZE MODULE - Text Normalization\n",
- "**Purpose**: Clean and normalize text for processing\n",
- "**Components**:\n",
- "- `TextNormalizer`: Main normalization orchestrator\n",
- "- `TextCleaner`: Remove noise, fix encoding\n",
- "- `DataCleaner`: Clean structured data\n",
- "- `EntityNormalizer`: Normalize entity names\n",
- "- `DateNormalizer`: Standardize date formats\n",
- "- `NumberNormalizer`: Normalize numeric values\n",
- "- `LanguageDetector`: Detect document language\n",
- "- `EncodingHandler`: Handle character encoding\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.normalize import TextNormalizer\n",
- "normalizer = TextNormalizer()\n",
- "normalized = normalizer.normalize(parsed_docs)\n",
- "```\n",
- "\n",
- "### 4. SEMANTIC_EXTRACT MODULE - Entity & Relationship Extraction\n",
- "**Purpose**: Extract entities, relationships, and semantic information\n",
- "**Components**:\n",
- "- `NERExtractor`: Named Entity Recognition\n",
- "- `RelationExtractor`: Extract relationships between entities\n",
- "- `SemanticAnalyzer`: Deep semantic analysis\n",
- "- `SemanticNetworkExtractor`: Extract semantic networks\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor\n",
- "extractor = NERExtractor()\n",
- "entities = extractor.extract(normalized_docs)\n",
- "relation_extractor = RelationExtractor()\n",
- "relationships = relation_extractor.extract(normalized_docs, entities)\n",
- "```\n",
- "\n",
- "### 5. KG MODULE - Knowledge Graph Construction\n",
- "**Purpose**: Build and manage knowledge graphs\n",
- "**Components**:\n",
- "- `GraphBuilder`: Construct knowledge graphs from entities/relationships\n",
- "- `GraphAnalyzer`: Analyze graph structure and properties\n",
- "- `GraphValidator`: Validate graph quality and consistency\n",
- "- `EntityResolver`: Resolve entity conflicts and duplicates\n",
- "- `ConflictDetector`: Detect conflicting information\n",
- "- `CentralityCalculator`: Calculate node importance metrics\n",
- "- `CommunityDetector`: Detect communities in graphs\n",
- "- `ConnectivityAnalyzer`: Analyze graph connectivity\n",
- "- `TemporalQuery`: Query temporal knowledge graphs\n",
- "- `Deduplicator`: Remove duplicate entities/relationships\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.kg import GraphBuilder, GraphAnalyzer\n",
- "builder = GraphBuilder()\n",
- "kg = builder.build(entities, relationships)\n",
- "analyzer = GraphAnalyzer()\n",
- "metrics = analyzer.analyze(kg)\n",
- "```\n",
- "\n",
- "### 6. EMBEDDINGS MODULE - Embedding Generation\n",
- "**Purpose**: Generate vector embeddings for text data\n",
- "**Components**:\n",
- "- `EmbeddingGenerator`: Main embedding orchestrator\n",
- "- `TextEmbedder`: Generate text embeddings\n",
- "- `VectorEmbeddingManager`: Manage embeddings for vector databases\n",
- "- `GraphEmbeddingManager`: Manage embeddings for graph databases\n",
- "- `ProviderAdapters`: Support for OpenAI, BGE, FastEmbed, Llama, etc.\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.embeddings import EmbeddingGenerator\n",
- "generator = EmbeddingGenerator()\n",
- "embeddings = generator.generate_embeddings(documents, data_type=\"text\")\n",
- "```\n",
- "\n",
- "### 7. VECTOR_STORE MODULE - Vector Database Operations\n",
- "**Purpose**: Store and search vector embeddings\n",
- "**Components**:\n",
- "- `VectorStore`: Main vector store interface\n",
- "- `FAISSAdapter`: FAISS integration\n",
- "- `HybridSearch`: Combine vector and keyword search\n",
- "- `VectorRetriever`: Retrieve relevant vectors\n",
- "\n",
- "**Example**:\n",
- "```python\n",
- "from semantica.vector_store import VectorStore, HybridSearch\n",
- "vector_store = VectorStore()\n",
- "vector_store.store(embeddings, documents, metadata)\n",
- "hybrid_search = HybridSearch(vector_store)\n",
- "results = hybrid_search.search(query, top_k=10)\n",
- "```\n",
- "\n",
- "### 8. GRAPH_STORE MODULE - Persistent Graph Database Operations\n",
- "**Purpose**: Store and query property graphs in Neo4j or FalkorDB\n",
- "**Components**:\n",
- "- `GraphStore`: Main graph store interface\n",
- "- `Neo4jAdapter`: Neo4j integration (enterprise features)\n",
- "- `FalkorDBAdapter`: FalkorDB integration (Redis-based, ultra-fast)\n",
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Hawksight-AI/semantica/blob/main/cookbook/introduction/01_Welcome_to_Semantica.ipynb)\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.graph_store import GraphStore\n",
+ "store = GraphStore(backend=\"neo4j\", uri=\"bolt://localhost:7687\", user=\"neo4j\", password=\"password\")\n",
+ "store.connect()\n",
+ "node1 = store.create_node(\n",
+ " labels=[\"Person\"],\n",
+ " properties={\"name\": \"John\", \"age\": 30}\n",
+ ")\n",
+ "node2 = store.create_node(\n",
+ " labels=[\"Person\"],\n",
+ " properties={\"name\": \"Jane\", \"age\": 28}\n",
+ ")\n",
+ "store.create_relationship(\n",
+ " start_node_id=node1[\"id\"],\n",
+ " end_node_id=node2[\"id\"],\n",
+ " rel_type=\"KNOWS\",\n",
+ " properties={\"since\": 2020}\n",
+ ")\n",
+ "results = store.execute_query(\"MATCH (p:Person) RETURN p.name\")\n",
+ "store.close()\n",
+ "```\n",
+ "\n",
+ "### 9. REASONING MODULE - Inference and Reasoning\n",
+ "**Purpose**: Perform logical inference and reasoning\n",
+ "**Components**:\n",
+ "- `InferenceEngine`: Main inference orchestrator\n",
+ "- `RuleManager`: Manage inference rules\n",
+ "- `DeductiveReasoner`: Deductive reasoning\n",
+ "- `AbductiveReasoner`: Abductive reasoning\n",
+ "- `ExplanationGenerator`: Generate explanations for inferences\n",
+ "- `RETEEngine`: RETE algorithm for rule matching\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager\n",
+ "inference_engine = InferenceEngine()\n",
+ "rule_manager = RuleManager()\n",
+ "new_facts = inference_engine.forward_chain()\n",
+ "```\n",
+ "\n",
+ "### 10. ONTOLOGY MODULE - Ontology Generation\n",
+ "**Purpose**: Generate and manage ontologies\n",
+ "**Components**:\n",
+ "- `OntologyGenerator`: Generate ontologies from knowledge graphs\n",
+ "- `OntologyValidator`: Validate ontology structure\n",
+ "- `OWLGenerator`: Generate OWL format ontologies\n",
+ "- `PropertyGenerator`: Generate ontology properties\n",
+ "- `ClassInferrer`: Infer ontology classes\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.ontology import OntologyGenerator\n",
+ "generator = OntologyGenerator()\n",
+ "ontology = generator.generate_from_graph(kg)\n",
+ "```\n",
+ "\n",
+ "### 11. EXPORT MODULE - Data Export\n",
+ "**Purpose**: Export data in various formats\n",
+ "**Components**:\n",
+ "- `JSONExporter`: Export to JSON\n",
+ "- `RDFExporter`: Export to RDF/XML\n",
+ "- `CSVExporter`: Export to CSV\n",
+ "- `GraphExporter`: Export to graph formats (GraphML, GEXF)\n",
+ "- `OWLExporter`: Export to OWL\n",
+ "- `VectorExporter`: Export vectors\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.export import JSONExporter, RDFExporter\n",
+ "json_exporter = JSONExporter()\n",
+ "json_exporter.export(kg, \"output.json\")\n",
+ "```\n",
+ "\n",
+ "### 12. VISUALIZATION MODULE - Graph Visualization\n",
+ "**Purpose**: Visualize knowledge graphs and analytics\n",
+ "**Components**:\n",
+ "- `KGVisualizer`: Visualize knowledge graphs\n",
+ "- `EmbeddingVisualizer`: Visualize embeddings (t-SNE, PCA, UMAP)\n",
+ "- `QualityVisualizer`: Visualize quality metrics\n",
+ "- `AnalyticsVisualizer`: Visualize graph analytics\n",
+ "- `TemporalVisualizer`: Visualize temporal data\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.visualization import KGVisualizer\n",
+ "visualizer = KGVisualizer()\n",
+ "visualizer.visualize(kg)\n",
+ "```\n",
+ "\n",
+ "### 13. PIPELINE MODULE - Pipeline Orchestration\n",
+ "**Purpose**: Build and execute processing pipelines\n",
+ "**Components**:\n",
+ "- `PipelineBuilder`: Build complex pipelines\n",
+ "- `ExecutionEngine`: Execute pipelines\n",
+ "- `FailureHandler`: Handle pipeline failures\n",
+ "- `ParallelismManager`: Enable parallel processing\n",
+ "- `ResourceScheduler`: Schedule resources\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.pipeline import PipelineBuilder\n",
+ "builder = PipelineBuilder()\n",
+ "pipeline = builder.add_step(\"ingest\", FileIngestor()) \\\\\n",
+ " .add_step(\"parse\", DocumentParser()) \\\\\n",
+ " .build()\n",
+ "```\n",
+ "\n",
+ "### 14. CORE MODULE - Framework Orchestration\n",
+ "**Purpose**: Framework initialization, configuration, lifecycle management, and plugin system\n",
+ "**Components**:\n",
+ "- `Semantica`: Main framework class coordinating all components\n",
+ "- `ConfigManager`: Configuration loading, validation, and management\n",
+ "- `Config`: Configuration data class with validation\n",
+ "- `LifecycleManager`: System lifecycle management with hooks and health monitoring\n",
+ "- `PluginRegistry`: Dynamic plugin discovery and loading\n",
+ "- `MethodRegistry`: Registry for custom orchestration methods\n",
+ "\n",
+ "**Example**:\n",
+ "```python\n",
+ "from semantica.core import Semantica, ConfigManager\n",
+ "\n",
+ "# Load configuration\n",
+ "config_manager = ConfigManager()\n",
+ "config = config_manager.load_from_file(\"config.yaml\")\n",
+ "\n",
+ "# Initialize framework\n",
+ "framework = Semantica(config=config)\n",
+ "framework.initialize()\n",
+ "\n",
+ "# Build knowledge base\n",
+ "result = framework.build_knowledge_base(\n",
+ " sources=[\"doc1.pdf\", \"doc2.docx\"],\n",
+ " embeddings=True,\n",
+ " graph=True\n",
+ ")\n",
+ "\n",
+ "# Shutdown gracefully\n",
+ "framework.shutdown()\n",
+ "```\n",
+ "\n",
+ "---\n",
+ "\n",
+ "## Key Concepts Explained\n",
+ "\n",
+ "Understanding these concepts is crucial for working with Semantica:\n",
+ "\n",
+ "### 1. KNOWLEDGE GRAPHS\n",
+ "**Definition**: A knowledge graph is a structured representation of entities (nodes) and their relationships (edges) with properties and attributes.\n",
+ "\n",
+ "**Structure**:\n",
+ "- **Nodes**: Represent entities (people, places, concepts, events)\n",
+ "- **Edges**: Represent relationships (works_for, located_in, causes)\n",
+ "- **Properties**: Attributes of entities and relationships\n",
+ "- **Metadata**: Additional information (sources, timestamps, confidence)\n",
+ "\n",
+ "**Example**:\n",
+ "- Entity: \"John Doe\" (Person)\n",
+ "- Relationship: \"works_for\" -> \"Acme Corp\" (Organization)\n",
+ "- Properties: `{start_date: \"2020-01-01\", role: \"Engineer\"}`\n",
+ "\n",
+ "**Benefits**:\n",
+ "- Structured representation of unstructured data\n",
+ "- Enables complex queries and reasoning\n",
+ "- Supports temporal tracking\n",
+ "- Facilitates knowledge discovery\n",
+ "\n",
+ "### 2. ENTITY EXTRACTION (NER - Named Entity Recognition)\n",
+ "**Definition**: The process of identifying and classifying named entities in text into predefined categories.\n",
+ "\n",
+ "**Entity Types**:\n",
+ "- **Person**: Names of people\n",
+ "- **Organization**: Companies, institutions\n",
+ "- **Location**: Places, geographic entities\n",
+ "- **Date/Time**: Temporal expressions\n",
+ "- **Money**: Monetary values\n",
+ "- **Product**: Products and services\n",
+ "- **Event**: Events and occurrences\n",
+ "- **Custom**: Domain-specific entities\n",
+ "\n",
+ "**Example**:\n",
+ "Text: \"Apple Inc. was founded by Steve Jobs in Cupertino, California.\"\n",
+ "Entities:\n",
+ "- \"Apple Inc.\" -> Organization\n",
+ "- \"Steve Jobs\" -> Person\n",
+ "- \"Cupertino, California\" -> Location\n",
+ "\n",
+ "**Methods**:\n",
+ "- Rule-based: Pattern matching\n",
+ "- Machine Learning: Trained models (spaCy, transformers)\n",
+ "- LLM-based: Using large language models\n",
+ "\n",
+ "### 3. RELATIONSHIP EXTRACTION\n",
+ "**Definition**: Identifying and extracting relationships between entities in text.\n",
+ "\n",
+ "**Relationship Types**:\n",
+ "- **Semantic**: \"works_for\", \"located_in\", \"causes\"\n",
+ "- **Temporal**: \"before\", \"after\", \"during\"\n",
+ "- **Causal**: \"causes\", \"results_in\", \"prevents\"\n",
+ "- **Hierarchical**: \"part_of\", \"subclass_of\", \"instance_of\"\n",
+ "\n",
+ "**Example**:\n",
+ "Text: \"John works for Acme Corp in New York.\"\n",
+ "Relationships:\n",
+ "- (John, works_for, Acme Corp)\n",
+ "- (Acme Corp, located_in, New York)\n",
+ "\n",
+ "**Methods**:\n",
+ "- Pattern matching\n",
+ "- Dependency parsing\n",
+ "- Machine learning models\n",
+ "- LLM-based extraction\n",
+ "\n",
+ "### 4. EMBEDDINGS\n",
+ "**Definition**: Dense vector representations of text, images, or other data that capture semantic meaning in a continuous vector space.\n",
+ "\n",
+ "**Properties**:\n",
+ "- Similar entities have similar embeddings (close in vector space)\n",
+ "- Enable semantic search and similarity calculations\n",
+ "- Fixed or variable dimensions (typically 128-4096)\n",
+ "\n",
+ "**Example**:\n",
+ "Text: \"machine learning\"\n",
+ "Embedding: `[0.123, -0.456, 0.789, ..., 0.234]` (vector of 1536 dimensions)\n",
+ "\n",
+ "**Use Cases**:\n",
+ "- Semantic search\n",
+ "- Clustering and classification\n",
+ "- Recommendation systems\n",
+ "- Anomaly detection\n",
+ "\n",
+ "### 5. TEMPORAL GRAPHS\n",
+ "**Definition**: Knowledge graphs that track changes over time, allowing queries about the state of the graph at specific time points.\n",
+ "\n",
+ "**Features**:\n",
+ "- Timestamps on entities and relationships\n",
+ "- Version history\n",
+ "- Time-point queries\n",
+ "- Temporal pattern detection\n",
+ "\n",
+ "**Example**:\n",
+ "- Entity: \"Company X\"\n",
+ "- Relationship: (Company X, has_CEO, Person Y)\n",
+ "- Temporal: `valid_from=\"2020-01-01\", valid_to=\"2023-12-31\"`\n",
+ "\n",
+ "**Use Cases**:\n",
+ "- Tracking organizational changes\n",
+ "- Monitoring system evolution\n",
+ "- Analyzing trends over time\n",
+ "- Historical analysis\n",
+ "\n",
+ "### 6. GraphRAG (Graph-based Retrieval Augmented Generation)\n",
+ "**Definition**: An advanced RAG approach that combines vector search with knowledge graph traversal to provide more accurate and contextually relevant information to LLMs.\n",
+ "\n",
+ "**Components**:\n",
+ "- **Vector Store**: For semantic similarity search\n",
+ "- **Knowledge Graph**: For structured relationship traversal\n",
+ "- **Hybrid Search**: Combines both approaches\n",
+ "- **LLM Integration**: Uses retrieved context for generation\n",
+ "\n",
+ "**Advantages over Traditional RAG**:\n",
+ "- Better handling of complex queries\n",
+ "- Relationship-aware retrieval\n",
+ "- Reduced hallucinations\n",
+ "- More accurate answers\n",
+ "\n",
+ "**Example Workflow**:\n",
+ "1. Query: \"Who worked with John at Acme Corp?\"\n",
+ "2. Vector search finds relevant documents\n",
+ "3. Knowledge graph traversal finds relationships\n",
+ "4. Combined context sent to LLM\n",
+ "5. LLM generates accurate answer using both sources\n",
+ "\n",
+ "### 7. ONTOLOGY\n",
+ "**Definition**: A formal specification of concepts, relationships, and constraints in a domain, typically expressed in OWL (Web Ontology Language).\n",
+ "\n",
+ "**Components**:\n",
+ "- **Classes**: Categories of entities\n",
+ "- **Properties**: Relationships and attributes\n",
+ "- **Individuals**: Specific instances\n",
+ "- **Axioms**: Rules and constraints\n",
+ "\n",
+ "**Example**:\n",
+ "- Class: Person\n",
+ "- SubClass: Employee, Customer\n",
+ "- Property: worksFor (domain: Person, range: Organization)\n",
+ "\n",
+ "**Use Cases**:\n",
+ "- Standardize domain knowledge\n",
+ "- Enable reasoning\n",
+ "- Facilitate data integration\n",
+ "- Support semantic web\n",
+ "\n",
+ "### 8. QUALITY ASSURANCE\n",
+ "**Definition**: Processes and metrics to ensure knowledge graph quality, including completeness, consistency, and accuracy.\n",
+ "\n",
+ "**Metrics**:\n",
+ "- **Completeness**: Percentage of entities with required properties\n",
+ "- **Consistency**: Absence of contradictions\n",
+ "- **Accuracy**: Correctness of extracted information\n",
+ "- **Coverage**: Breadth of domain coverage\n",
+ "\n",
+ "**Methods**:\n",
+ "- Validation rules\n",
+ "- Automated quality checks\n",
+ "- Conflict detection\n",
+ "- Source verification\n",
+ "---\n",
+ "\n",
+ "## Next Steps\n",
+ "\n",
+ "Now that you understand the basics, here are recommended next steps:\n",
+ "\n",
+ "1. **Your First Knowledge Graph** (`01_Your_First_Knowledge_Graph.ipynb`)\n",
+ " - Build your first knowledge graph from a document\n",
+ " - Learn the basic workflow\n",
+ "\n",
+ "2. **Configuration Basics** (`02_Configuration_Basics.ipynb`)\n",
+ " - Set up configuration files\n",
+ " - Configure API keys and providers\n",
+ "\n",
+ "3. **Core Workflows** (`01_core_workflows/`)\n",
+ " - Learn common patterns and workflows\n",
+ " - Start with \"From Unstructured to Structured\"\n",
+ "\n",
+ "4. **Use Cases** (`03_use_cases/`)\n",
+ " - Explore domain-specific applications\n",
+ " - Find examples relevant to your domain\n",
+ "\n",
+ "---\n",
+ "\n",
+ "## Best Practices\n",
+ "\n",
+ "### 1. START SMALL\n",
+ "- Begin with simple documents\n",
+ "- Validate each step before moving forward\n",
+ "- Build incrementally\n",
+ "\n",
+ "### 2. CONFIGURE PROPERLY\n",
+ "- Use environment variables for sensitive data\n",
+ "- Set up proper logging\n",
+ "- Configure appropriate model sizes\n",
+ "\n",
+ "### 3. VALIDATE DATA\n",
+ "- Always validate extracted entities\n",
+ "- Check relationship quality\n",
+ "- Use quality assurance tools\n",
+ "\n",
+ "### 4. HANDLE ERRORS\n",
+ "- Implement error handling\n",
+ "- Use retry mechanisms\n",
+ "- Log errors for debugging\n",
+ "\n",
+ "### 5. OPTIMIZE PERFORMANCE\n",
+ "- Use batch processing for large datasets\n",
+ "- Enable parallel processing where possible\n",
+ "- Cache embeddings and results\n",
+ "\n",
+ "### 6. DOCUMENT YOUR WORKFLOWS\n",
+ "- Document data sources\n",
+ "- Track processing steps\n",
+ "- Maintain metadata\n",
+ "\n",
+ "---\n",
+ "\n",
+ "## Troubleshooting\n",
+ "\n",
+ "Common issues and solutions:\n",
+ "\n",
+ "### Issue 1: Import Errors\n",
+ "**Solution**:\n",
+ "- Ensure Semantica is properly installed\n",
+ "- Check Python version (3.8+)\n",
+ "- Verify virtual environment is activated\n",
+ "- Install missing dependencies: `pip install -r requirements.txt`\n",
+ "\n",
+ "### Issue 2: API Key Errors\n",
+ "**Solution**:\n",
+ "- Set environment variables: `export SEMANTICA_API_KEY=your_key`\n",
+ "- Check config file for correct key format\n",
+ "- Verify API key is valid and has sufficient credits\n",
+ "\n",
+ "### Issue 3: Memory Issues\n",
+ "**Solution**:\n",
+ "- Process documents in batches\n",
+ "- Use smaller embedding models\n",
+ "- Enable garbage collection\n",
+ "- Consider using streaming for large datasets\n",
+ "\n",
+ "### Issue 4: Low Quality Extractions\n",
+ "**Solution**:\n",
+ "- Preprocess and normalize text\n",
+ "- Use domain-specific models\n",
+ "- Adjust extraction parameters\n",
+ "- Validate and clean extracted entities\n",
+ "\n",
+ "### Issue 5: Slow Processing\n",
+ "**Solution**:\n",
+ "- Enable parallel processing\n",
+ "- Use GPU acceleration if available\n",
+ "- Cache intermediate results\n",
+ "- Optimize batch sizes\n",
+ "\n"
+=======
+ "Semantica is a **semantic intelligence and knowledge engineering framework**. It helps you:\n",
+ "\n",
+ "- Build **knowledge graphs** from unstructured and semi-structured data\n",
+ "- Create a unified **semantic layer** on top of diverse data sources\n",
+ "- Power **GraphRAG**, AI agents, and multi-agent systems with structured knowledge\n",
+ "- Incorporate **temporal and quality-aware reasoning** into your applications\n",
+ "\n",
+ "### Core Capabilities\n",
+ "\n",
+ "- **Universal ingestion**: Files, web, feeds, databases, repositories, streams\n",
+ "- **Rich parsing**: PDFs, Office documents, HTML, JSON, CSV, images, code\n",
+ "- **Normalization**: Cleaning, language detection, entity normalization, date/number standardization\n",
+ "- **Semantic extraction**: Named entities, relationships, events, semantic networks\n",
+ "- **Knowledge graph construction**: Property graphs from entities and relations\n",
+ "- **Embeddings and vector search**: Text and graph embeddings, hybrid retrieval\n",
+ "- **Reasoning and ontology**: Rule-based inference, ontology generation and validation\n",
+ "- **Visualization and analytics**: Graph visualizations and quality metrics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Who Is Semantica For?\n",
+ "\n",
+ "- **AI/ML engineers** building GraphRAG systems, agents, and tools that need long-term memory\n",
+ "- **Data engineers** orchestrating semantic enrichment pipelines over large, heterogeneous datasets\n",
+ "- **Knowledge engineers and ontologists** designing and maintaining formal knowledge structures\n",
+ "- **Researchers and analysts** creating domain knowledge graphs from documents and data feeds\n",
+ "- **Product and platform teams** embedding semantic intelligence into applications and services"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Architecture Overview\n",
+ "\n",
+ "Semantica is organized as three conceptual layers and multiple concrete modules.\n",
+ "\n",
+ "### Layers\n",
+ "\n",
+ "- **Input Layer**\n",
+ " - Connects to files, web pages, APIs, databases, email, feeds, repositories, and streams\n",
+ " - Normalizes these different sources into a unified internal representation\n",
+ "\n",
+ "- **Semantic Layer**\n",
+ " - Performs parsing, cleaning, semantic extraction, graph construction, embeddings, and reasoning\n",
+ " - This is where **unstructured data becomes structured knowledge**\n",
+ "\n",
+ "- **Output Layer**\n",
+ " - Exposes knowledge graphs, embeddings, ontologies, and analytics\n",
+ " - Integrates with vector stores, graph databases, and downstream applications"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## \ud83e\udde9 Semantica Modules Reference\n",
+ "\n",
+ "Semantica is modular by design. Here is a comprehensive guide to all available modules, grouped by functionality.\n",
+ "\n",
+ "### \ud83d\udce5 Ingestion & Parsing\n",
+ "Modules that handle raw data input and structure.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`ingest`** | **Data Ingestion**<br>Connects to data sources. | \u2022 File, Web, Feed, Stream ingestion<br>\u2022 DB, Email, Repo, MCP support |\n",
+ "| **`parse`** | **Document Parsing**<br>Parses raw content into structures. | \u2022 PDF, HTML, JSON, CSV, Excel<br>\u2022 Image & Code parsing |\n",
+ "\n",
+ "### \u2699\ufe0f Data Processing\n",
+ "Modules that clean, normalize, and split data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`normalize`** | **Data Normalization**<br>Cleans and standardizes text. | \u2022 Text cleaning & Language detection<br>\u2022 Entity, Date, Number normalization |\n",
+ "| **`split`** | **Chunking**<br>Splits documents for RAG. | \u2022 Recursive character splitting<br>\u2022 Semantic & Token-based splitting |\n",
+ "\n",
+ "### \ud83e\udde0 Extraction & Enrichment\n",
+ "Modules that extract meaning, structure, and vectors from raw data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`semantic_extract`** | **Information Extraction**<br>Extracts entities and relations. | \u2022 NER & Relation Extraction<br>\u2022 Event & Semantic Network detection |\n",
+ "| **`context`** | **Agent Memory**<br>Manages state for AI agents. | \u2022 Long-term memory & history<br>\u2022 Context graph & RAG integration |\n",
+ "\n",
+ "### \ud83d\udd78\ufe0f Knowledge Graph Core\n",
+ "Modules for building, refining, and resolving knowledge graphs.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`kg`** | **Graph Construction**<br>Builds and analyzes graphs. | \u2022 Graph Building & Analysis<br>\u2022 Validation & Entity Resolution |\n",
+ "| **`conflicts`** | **Conflict Resolution**<br>Resolves data contradictions. | \u2022 Source reliability scoring<br>\u2022 Truth discovery algorithms |\n",
+ "| **`deduplication`** | **Entity Resolution**<br>Merges duplicate entities. | \u2022 Similarity-based blocking<br>\u2022 Clustering & Canonicalization |\n",
+ "\n",
+ "### \ud83d\udcbe Storage & Retrieval\n",
+ "Modules for persisting and querying data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`embeddings`** | **Vector Embeddings**<br>Generates semantic vectors. | \u2022 Text & Graph embeddings<br>\u2022 Multi-provider support (OpenAI, etc.) |\n",
+ "| **`vector_store`** | **Vector Database**<br>Stores and searches vectors. | \u2022 Similarity search & Filtering<br>\u2022 Hybrid search (Vector + Keyword) |\n",
+ "| **`graph_store`** | **Property Graph Store**<br>Persists graph data. | \u2022 Neo4j, FalkorDB adapters<br>\u2022 Cypher query support |\n",
+ "| **`triplet_store`** | **RDF Store**<br>Persists semantic triplets. | \u2022 SPARQL endpoints<br>\u2022 BlazeGraph, Jena, Virtuoso adapters |\n",
+ "\n",
+ "### \ud83d\udd0e Reasoning & Analysis\n",
+ "Modules for deriving new knowledge and evaluating quality.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`reasoning`** | **Inference Engine**<br>Derives new facts via rules. | \u2022 Datalog/Rule-based inference<br>\u2022 Forward/Backward chaining |\n",
+ "| **`ontology`** | **Ontology Management**<br>Manages schema and definitions. | \u2022 Ontology generation from data<br>\u2022 Validation & Evolution |\n",
+ "| **`visualization`** | **Visual Analytics**<br>Visualizes graphs and metrics. | \u2022 2D/3D Graph visualization<br>\u2022 Interactive plots & dashboards |\n",
+ "| **`evals`** | **Evaluation**<br>Benchmarks pipeline quality. | \u2022 RAG & Graph quality metrics<br>\u2022 Ground truth comparison |\n",
+ "\n",
+ "### \ud83d\udee0\ufe0f Orchestration & Utils\n",
+ "Modules for managing the framework and workflows.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`core`** | **Framework Core**<br>Main entry point and config. | \u2022 Lifecycle management<br>\u2022 Plugin system & Configuration |\n",
+ "| **`pipeline`** | **Workflow Orchestration**<br>Manages complex flows. | \u2022 DAG execution & Retries<br>\u2022 Error handling & Observability |\n",
+ "| **`seed`** | **Data Seeding**<br>Initializes knowledge bases. | \u2022 Taxonomy & Ontology seeding<br>\u2022 Reference data loading |\n",
+ "| **`export`** | **Data Export**<br>Exports data to files. | \u2022 JSON, CSV, RDF, GEXF export<br>\u2022 Report generation |\n",
+ "| **`utils`** | **Utilities**<br>Common helper functions. | \u2022 Logging, Async, Hashing<br>\u2022 Text processing helpers |"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Core Concepts (High-Level)\n",
+ "\n",
+ "- **Knowledge graph**\n",
+ " - Nodes represent entities such as people, organizations, locations, events, or concepts\n",
+ " - Edges represent relationships such as `works_for`, `located_in`, `founded_by`\n",
+ " - Properties capture attributes and metadata such as timestamps, sources, and confidence\n",
+ "\n",
+ "- **Entities and relationships**\n",
+ " - Entities are extracted from text and data using NER\n",
+ " - Relationships connect entities and are extracted using pattern-based, model-based, or LLM-based methods\n",
+ "\n",
+ "- **Embeddings**\n",
+ " - Numerical vectors that encode semantic meaning of text or graph structures\n",
+ " - Used for semantic search, clustering, and similarity-based retrieval\n",
+ "\n",
+ "- **GraphRAG**\n",
+ " - Combines vector search with graph traversal\n",
+ " - Uses both embeddings and graph structure to retrieve rich, context-aware information\n",
+ "\n",
+ "- **Ontology**\n",
+ " - A formal model of classes, relationships, and constraints in a domain\n",
+ " - Used to standardize meaning, enable reasoning, and integrate heterogeneous data\n",
+ "\n",
+ "- **Quality and governance**\n",
+ " - Quality metrics (completeness, consistency, accuracy, coverage)\n",
+ " - Conflict detection and resolution at the knowledge graph level"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Installation\n",
+ "\n",
+ "You can install Semantica from PyPI. In this notebook, we use a pip cell so it can run in local Jupyter or Colab.\n",
+ "\n",
+ "Equivalent shell commands:\n",
+ "\n",
+ "```bash\n",
+ "pip install semantica\n",
+ "pip install semantica[all]\n",
+ "```"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Basic Configuration\n",
+ "\n",
+ "Semantica uses configuration for API keys, embedding providers, and knowledge graph options. The example below mirrors a typical configuration while staying simple enough for a notebook."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'api_keys:\\n openai: your_key_here\\n anthropic: your_key_here\\nembedding:\\n provider: openai\\n model: text-embedding-3-large\\n dimensions: 3072\\nknowledge_graph:\\n backend: networkx\\n temporal: true\\n'"
+>>>>>>> Stashed changes
+ ]
+ }
+ ],
+ "metadata": {
+ "language_info": {
+ "name": "python"
+ }
+ },
+<<<<<<< Updated upstream
+ "nbformat": 4,
+ "nbformat_minor": 2
+=======
++=======
+ "# Welcome to Semantica\n",
+ "\n",
+ "**Open Source Framework for Semantic Layer & Knowledge Engineering**\n",
+ "\n",
+ "Semantica is a Python framework for transforming raw, messy, multi-source data into **semantic layers** and **knowledge graphs** that are ready to power GraphRAG, AI agents, multi-agent systems, and analytical applications.\n",
+ "\n",
+ "This notebook is an executable introduction. It combines:\n",
+ "\n",
+ "- High-level explanation of what Semantica is and why it exists\n",
+ "- A structured tour of the architecture and key modules\n",
+ "- Small, runnable code snippets that show the end-to-end flow\n",
+ "\n",
+ "**You should use this notebook to understand the big picture, not to learn every API in depth.**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Requirement already satisfied: semantica in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (0.0.5)\n",
+ "Requirement already satisfied: numpy>=1.21.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.26.4)\n",
+ "Requirement already satisfied: pandas>=1.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.1.4)\n",
+ "Requirement already satisfied: scikit-learn>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.6.1)\n",
+ "Requirement already satisfied: spacy>=3.4.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.8.11)\n",
+ "Requirement already satisfied: transformers>=4.20.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.53.2)\n",
+ "Requirement already satisfied: torch>=1.12.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.2.1)\n",
+ "Requirement already satisfied: sentence-transformers>=2.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.2.1)\n",
+ "Requirement already satisfied: rdflib>=6.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (7.4.0)\n",
+ "Requirement already satisfied: networkx>=2.8.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.5)\n",
+ "Requirement already satisfied: matplotlib>=3.5.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.10.1)\n",
+ "Requirement already satisfied: seaborn>=0.11.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.13.2)\n",
+ "Requirement already satisfied: plotly>=5.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (5.17.0)\n",
+ "Requirement already satisfied: requests>=2.28.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.32.5)\n",
+ "Requirement already satisfied: beautifulsoup4>=4.11.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.12.3)\n",
+ "Requirement already satisfied: lxml>=4.9.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (6.0.2)\n",
+ "Requirement already satisfied: pypdf2>=2.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.0.1)\n",
+ "Requirement already satisfied: python-docx>=0.8.11 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.1.2)\n",
+ "Requirement already satisfied: openpyxl>=3.0.10 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.1.5)\n",
+ "Requirement already satisfied: pillow>=9.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (10.4.0)\n",
+ "Requirement already satisfied: librosa>=0.9.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.11.0)\n",
+ "Requirement already satisfied: opencv-python>=4.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.9.0.80)\n",
+ "Requirement already satisfied: faiss-cpu>=1.7.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.9.0)\n",
+ "Requirement already satisfied: weaviate-client>=3.15.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.18.1)\n",
+ "Requirement already satisfied: qdrant-client>=1.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.12.2)\n",
+ "Requirement already satisfied: neo4j>=5.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (6.0.3)\n",
+ "Requirement already satisfied: falkordb>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.2.2)\n",
+ "Requirement already satisfied: pymongo>=4.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.15.4)\n",
+ "Requirement already satisfied: sqlalchemy>=1.4.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.0.23)\n",
+ "Requirement already satisfied: psycopg2-binary>=2.9.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.9.9)\n",
+ "Requirement already satisfied: pymysql>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.1.2)\n",
+ "Requirement already satisfied: redis>=4.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (6.4.0)\n",
+ "Requirement already satisfied: celery>=5.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (5.3.4)\n",
+ "Requirement already satisfied: kafka-python>=2.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.3.0)\n",
+ "Requirement already satisfied: pulsar-client>=3.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (3.3.0)\n",
+ "Requirement already satisfied: pika>=1.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.3.2)\n",
+ "Requirement already satisfied: boto3>=1.24.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.36.0)\n",
+ "Requirement already satisfied: azure-storage-blob>=12.12.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (12.27.1)\n",
+ "Requirement already satisfied: google-cloud-storage>=2.5.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.18.2)\n",
+ "Requirement already satisfied: pydantic>=1.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (2.12.3)\n",
+ "Requirement already satisfied: click>=8.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (8.2.1)\n",
+ "Requirement already satisfied: rich>=12.5.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (13.7.1)\n",
+ "Requirement already satisfied: tqdm>=4.64.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.67.1)\n",
+ "Requirement already satisfied: pyyaml>=6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (6.0.1)\n",
+ "Requirement already satisfied: toml>=0.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.10.2)\n",
+ "Requirement already satisfied: python-dotenv>=0.20.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.1.1)\n",
+ "Requirement already satisfied: loguru>=0.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.7.3)\n",
+ "Requirement already satisfied: structlog>=22.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (24.4.0)\n",
+ "Requirement already satisfied: prometheus-client>=0.14.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.18.0)\n",
+ "Requirement already satisfied: opentelemetry-api>=1.12.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.38.0)\n",
+ "Requirement already satisfied: opentelemetry-sdk>=1.12.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.38.0)\n",
+ "Requirement already satisfied: opentelemetry-instrumentation in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.59b0)\n",
+ "Requirement already satisfied: fastapi>=0.78.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.120.4)\n",
+ "Requirement already satisfied: uvicorn>=0.18.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.38.0)\n",
+ "Requirement already satisfied: pytest>=7.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (7.4.3)\n",
+ "Requirement already satisfied: pytest-cov>=3.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (7.0.0)\n",
+ "Requirement already satisfied: pytest-asyncio>=0.19.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (0.21.1)\n",
+ "Requirement already satisfied: black>=22.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (23.11.0)\n",
+ "Requirement already satisfied: isort>=5.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (5.12.0)\n",
+ "Requirement already satisfied: flake8>=4.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (7.3.0)\n",
+ "Requirement already satisfied: mypy>=0.971 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (1.17.1)\n",
+ "Requirement already satisfied: pre-commit>=2.19.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from semantica) (4.4.0)\n",
+ "Requirement already satisfied: azure-core>=1.30.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from azure-storage-blob>=12.12.0->semantica) (1.35.0)\n",
+ "Requirement already satisfied: cryptography>=2.1.4 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from azure-storage-blob>=12.12.0->semantica) (43.0.3)\n",
+ "Requirement already satisfied: typing-extensions>=4.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from azure-storage-blob>=12.12.0->semantica) (4.14.1)\n",
+ "Requirement already satisfied: isodate>=0.6.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from azure-storage-blob>=12.12.0->semantica) (0.7.2)\n",
+ "Requirement already satisfied: six>=1.11.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from azure-core>=1.30.0->azure-storage-blob>=12.12.0->semantica) (1.16.0)\n",
+ "Requirement already satisfied: soupsieve>1.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from beautifulsoup4>=4.11.0->semantica) (2.5)\n",
+ "Requirement already satisfied: mypy-extensions>=0.4.3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from black>=22.6.0->semantica) (1.0.0)\n",
+ "Requirement already satisfied: packaging>=22.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from black>=22.6.0->semantica) (24.2)\n",
+ "Requirement already satisfied: pathspec>=0.9.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from black>=22.6.0->semantica) (0.11.2)\n",
+ "Requirement already satisfied: platformdirs>=2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from black>=22.6.0->semantica) (3.11.0)\n",
+ "Requirement already satisfied: botocore<1.37.0,>=1.36.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from boto3>=1.24.0->semantica) (1.36.26)\n",
+ "Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from boto3>=1.24.0->semantica) (1.0.1)\n",
+ "Requirement already satisfied: s3transfer<0.12.0,>=0.11.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from boto3>=1.24.0->semantica) (0.11.3)\n",
+ "Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from botocore<1.37.0,>=1.36.0->boto3>=1.24.0->semantica) (2.9.0.post0)\n",
+ "Requirement already satisfied: urllib3!=2.2.0,<3,>=1.25.4 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from botocore<1.37.0,>=1.36.0->boto3>=1.24.0->semantica) (1.26.20)\n",
+ "Requirement already satisfied: billiard<5.0,>=4.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (4.2.1)\n",
+ "Requirement already satisfied: kombu<6.0,>=5.3.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (5.5.3)\n",
+ "Requirement already satisfied: vine<6.0,>=5.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (5.1.0)\n",
+ "Requirement already satisfied: click-didyoumean>=0.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (0.3.1)\n",
+ "Requirement already satisfied: click-repl>=0.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (0.3.0)\n",
+ "Requirement already satisfied: click-plugins>=1.1.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (1.1.1)\n",
+ "Requirement already satisfied: tzdata>=2022.7 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from celery>=5.2.0->semantica) (2025.2)\n",
+ "Requirement already satisfied: colorama in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from click>=8.1.0->semantica) (0.4.6)\n",
+ "Requirement already satisfied: amqp<6.0.0,>=5.1.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from kombu<6.0,>=5.3.2->celery>=5.2.0->semantica) (5.3.1)\n",
+ "Requirement already satisfied: prompt-toolkit>=3.0.36 in c:\\users\\mohd kaif\\appdata\\roaming\\python\\python311\\site-packages (from click-repl>=0.2.0->celery>=5.2.0->semantica) (3.0.40)\n",
+ "Requirement already satisfied: cffi>=1.12 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from cryptography>=2.1.4->azure-storage-blob>=12.12.0->semantica) (1.17.1)\n",
+ "Requirement already satisfied: pycparser in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from cffi>=1.12->cryptography>=2.1.4->azure-storage-blob>=12.12.0->semantica) (2.22)\n",
+ "Requirement already satisfied: starlette<0.50.0,>=0.40.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from fastapi>=0.78.0->semantica) (0.46.2)\n",
+ "Requirement already satisfied: annotated-doc>=0.0.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from fastapi>=0.78.0->semantica) (0.0.3)\n",
+ "Requirement already satisfied: annotated-types>=0.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pydantic>=1.10.0->semantica) (0.7.0)\n",
+ "Requirement already satisfied: pydantic-core==2.41.4 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pydantic>=1.10.0->semantica) (2.41.4)\n",
+ "Requirement already satisfied: typing-inspection>=0.4.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pydantic>=1.10.0->semantica) (0.4.2)\n",
+ "Requirement already satisfied: anyio<5,>=3.6.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from starlette<0.50.0,>=0.40.0->fastapi>=0.78.0->semantica) (4.11.0)\n",
+ "Requirement already satisfied: idna>=2.8 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from anyio<5,>=3.6.2->starlette<0.50.0,>=0.40.0->fastapi>=0.78.0->semantica) (3.10)\n",
+ "Requirement already satisfied: sniffio>=1.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from anyio<5,>=3.6.2->starlette<0.50.0,>=0.40.0->fastapi>=0.78.0->semantica) (1.3.1)\n",
+ "Requirement already satisfied: mccabe<0.8.0,>=0.7.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from flake8>=4.0.0->semantica) (0.7.0)\n",
+ "Requirement already satisfied: pycodestyle<2.15.0,>=2.14.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from flake8>=4.0.0->semantica) (2.14.0)\n",
+ "Requirement already satisfied: pyflakes<3.5.0,>=3.4.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from flake8>=4.0.0->semantica) (3.4.0)\n",
+ "Requirement already satisfied: google-auth<3.0dev,>=2.26.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-cloud-storage>=2.5.0->semantica) (2.36.0)\n",
+ "Requirement already satisfied: google-api-core<3.0.0dev,>=2.15.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-cloud-storage>=2.5.0->semantica) (2.23.0)\n",
+ "Requirement already satisfied: google-cloud-core<3.0dev,>=2.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-cloud-storage>=2.5.0->semantica) (2.4.1)\n",
+ "Requirement already satisfied: google-resumable-media>=2.7.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-cloud-storage>=2.5.0->semantica) (2.7.2)\n",
+ "Requirement already satisfied: google-crc32c<2.0dev,>=1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-cloud-storage>=2.5.0->semantica) (1.6.0)\n",
+ "Requirement already satisfied: googleapis-common-protos<2.0.dev0,>=1.56.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-api-core<3.0.0dev,>=2.15.0->google-cloud-storage>=2.5.0->semantica) (1.66.0)\n",
+ "Requirement already satisfied: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.19.5 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-api-core<3.0.0dev,>=2.15.0->google-cloud-storage>=2.5.0->semantica) (4.25.8)\n",
+ "Requirement already satisfied: proto-plus<2.0.0dev,>=1.22.3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-api-core<3.0.0dev,>=2.15.0->google-cloud-storage>=2.5.0->semantica) (1.25.0)\n",
+ "Requirement already satisfied: cachetools<6.0,>=2.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage>=2.5.0->semantica) (5.5.2)\n",
+ "Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage>=2.5.0->semantica) (0.4.1)\n",
+ "Requirement already satisfied: rsa<5,>=3.1.4 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from google-auth<3.0dev,>=2.26.1->google-cloud-storage>=2.5.0->semantica) (4.9)\n",
+ "Requirement already satisfied: charset_normalizer<4,>=2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from requests>=2.28.0->semantica) (3.4.0)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from requests>=2.28.0->semantica) (2025.8.3)\n",
+ "Requirement already satisfied: pyasn1>=0.1.3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from rsa<5,>=3.1.4->google-auth<3.0dev,>=2.26.1->google-cloud-storage>=2.5.0->semantica) (0.6.1)\n",
+ "Requirement already satisfied: audioread>=2.1.9 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (3.0.1)\n",
+ "Requirement already satisfied: numba>=0.51.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (0.61.2)\n",
+ "Requirement already satisfied: scipy>=1.6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (1.15.2)\n",
+ "Requirement already satisfied: joblib>=1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (1.3.2)\n",
+ "Requirement already satisfied: decorator>=4.3.0 in c:\\users\\mohd kaif\\appdata\\roaming\\python\\python311\\site-packages (from librosa>=0.9.0->semantica) (5.1.1)\n",
+ "Requirement already satisfied: soundfile>=0.12.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (0.13.1)\n",
+ "Requirement already satisfied: pooch>=1.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (1.8.2)\n",
+ "Requirement already satisfied: soxr>=0.3.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (0.5.0.post1)\n",
+ "Requirement already satisfied: lazy_loader>=0.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (0.4)\n",
+ "Requirement already satisfied: msgpack>=1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from librosa>=0.9.0->semantica) (1.1.0)\n",
+ "Requirement already satisfied: win32-setctime>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from loguru>=0.6.0->semantica) (1.1.0)\n",
+ "Requirement already satisfied: contourpy>=1.0.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from matplotlib>=3.5.0->semantica) (1.3.2)\n",
+ "Requirement already satisfied: cycler>=0.10 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from matplotlib>=3.5.0->semantica) (0.12.1)\n",
+ "Requirement already satisfied: fonttools>=4.22.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from matplotlib>=3.5.0->semantica) (4.57.0)\n",
+ "Requirement already satisfied: kiwisolver>=1.3.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from matplotlib>=3.5.0->semantica) (1.4.8)\n",
+ "Requirement already satisfied: pyparsing>=2.3.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from matplotlib>=3.5.0->semantica) (3.2.0)\n",
+ "Requirement already satisfied: pytz in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from neo4j>=5.0.0->semantica) (2024.2)\n",
+ "Requirement already satisfied: llvmlite<0.45,>=0.44.0dev0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from numba>=0.51.0->librosa>=0.9.0->semantica) (0.44.0)\n",
+ "Requirement already satisfied: et-xmlfile in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from openpyxl>=3.0.10->semantica) (2.0.0)\n",
+ "Requirement already satisfied: importlib-metadata<8.8.0,>=6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from opentelemetry-api>=1.12.0->semantica) (6.8.0)\n",
+ "Requirement already satisfied: zipp>=0.5 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from importlib-metadata<8.8.0,>=6.0->opentelemetry-api>=1.12.0->semantica) (3.17.0)\n",
+ "Requirement already satisfied: opentelemetry-semantic-conventions==0.59b0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from opentelemetry-sdk>=1.12.0->semantica) (0.59b0)\n",
+ "Requirement already satisfied: tenacity>=6.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from plotly>=5.10.0->semantica) (8.5.0)\n",
+ "Requirement already satisfied: cfgv>=2.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pre-commit>=2.19.0->semantica) (3.5.0)\n",
+ "Requirement already satisfied: identify>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pre-commit>=2.19.0->semantica) (2.6.15)\n",
+ "Requirement already satisfied: nodeenv>=0.11.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pre-commit>=2.19.0->semantica) (1.9.1)\n",
+ "Requirement already satisfied: virtualenv>=20.10.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pre-commit>=2.19.0->semantica) (20.24.6)\n",
+ "Requirement already satisfied: wcwidth in c:\\users\\mohd kaif\\appdata\\roaming\\python\\python311\\site-packages (from prompt-toolkit>=3.0.36->click-repl>=0.2.0->celery>=5.2.0->semantica) (0.2.9)\n",
+ "Requirement already satisfied: dnspython<3.0.0,>=1.16.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pymongo>=4.2.0->semantica) (2.4.2)\n",
+ "Requirement already satisfied: iniconfig in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pytest>=7.1.0->semantica) (2.0.0)\n",
+ "Requirement already satisfied: pluggy<2.0,>=0.12 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pytest>=7.1.0->semantica) (1.5.0)\n",
+ "Requirement already satisfied: coverage>=7.10.6 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from coverage[toml]>=7.10.6->pytest-cov>=3.0.0->semantica) (7.12.0)\n",
+ "Requirement already satisfied: grpcio>=1.41.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from qdrant-client>=1.3.0->semantica) (1.68.0)\n",
+ "Requirement already satisfied: grpcio-tools>=1.41.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from qdrant-client>=1.3.0->semantica) (1.62.3)\n",
+ "Requirement already satisfied: httpx>=0.20.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (0.28.1)\n",
+ "Requirement already satisfied: portalocker<3.0.0,>=2.7.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from qdrant-client>=1.3.0->semantica) (2.10.1)\n",
+ "Requirement already satisfied: pywin32>=226 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from portalocker<3.0.0,>=2.7.0->qdrant-client>=1.3.0->semantica) (311)\n",
+ "Requirement already satisfied: setuptools in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from grpcio-tools>=1.41.0->qdrant-client>=1.3.0->semantica) (80.9.0)\n",
+ "Requirement already satisfied: httpcore==1.* in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from httpx>=0.20.0->httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (1.0.9)\n",
+ "Requirement already satisfied: h11>=0.16 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from httpcore==1.*->httpx>=0.20.0->httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (0.16.0)\n",
+ "Requirement already satisfied: h2<5,>=3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (4.1.0)\n",
+ "Requirement already satisfied: hyperframe<7,>=6.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from h2<5,>=3->httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (6.0.1)\n",
+ "Requirement already satisfied: hpack<5,>=4.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from h2<5,>=3->httpx[http2]>=0.20.0->qdrant-client>=1.3.0->semantica) (4.0.0)\n",
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from rich>=12.5.0->semantica) (3.0.0)\n",
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from rich>=12.5.0->semantica) (2.19.2)\n",
+ "Requirement already satisfied: mdurl~=0.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from markdown-it-py>=2.2.0->rich>=12.5.0->semantica) (0.1.2)\n",
+ "Requirement already satisfied: threadpoolctl>=3.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from scikit-learn>=1.0.0->semantica) (3.2.0)\n",
+ "Requirement already satisfied: huggingface-hub>=0.20.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from sentence-transformers>=2.2.0->semantica) (0.30.2)\n",
+ "Requirement already satisfied: filelock in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from transformers>=4.20.0->semantica) (3.16.1)\n",
+ "Requirement already satisfied: regex!=2019.12.17 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from transformers>=4.20.0->semantica) (2024.11.6)\n",
+ "Requirement already satisfied: tokenizers<0.22,>=0.21 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from transformers>=4.20.0->semantica) (0.21.4)\n",
+ "Requirement already satisfied: safetensors>=0.4.3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from transformers>=4.20.0->semantica) (0.5.3)\n",
+ "Requirement already satisfied: fsspec>=2023.5.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from huggingface-hub>=0.20.0->sentence-transformers>=2.2.0->semantica) (2023.10.0)\n",
+ "Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (3.0.12)\n",
+ "Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (1.0.5)\n",
+ "Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (1.0.15)\n",
+ "Requirement already satisfied: cymem<2.1.0,>=2.0.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (2.0.13)\n",
+ "Requirement already satisfied: preshed<3.1.0,>=3.0.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (3.0.12)\n",
+ "Requirement already satisfied: thinc<8.4.0,>=8.3.4 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (8.3.10)\n",
+ "Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (1.1.3)\n",
+ "Requirement already satisfied: srsly<3.0.0,>=2.4.3 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (2.5.2)\n",
+ "Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (2.0.10)\n",
+ "Requirement already satisfied: weasel<0.5.0,>=0.4.2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (0.4.3)\n",
+ "Requirement already satisfied: typer-slim<1.0.0,>=0.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (0.20.0)\n",
+ "Requirement already satisfied: jinja2 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from spacy>=3.4.0->semantica) (3.1.6)\n",
+ "Requirement already satisfied: blis<1.4.0,>=1.3.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from thinc<8.4.0,>=8.3.4->spacy>=3.4.0->semantica) (1.3.3)\n",
+ "Requirement already satisfied: confection<1.0.0,>=0.0.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from thinc<8.4.0,>=8.3.4->spacy>=3.4.0->semantica) (0.1.5)\n",
+ "Requirement already satisfied: cloudpathlib<1.0.0,>=0.7.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from weasel<0.5.0,>=0.4.2->spacy>=3.4.0->semantica) (0.23.0)\n",
+ "Requirement already satisfied: smart-open<8.0.0,>=5.2.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from weasel<0.5.0,>=0.4.2->spacy>=3.4.0->semantica) (7.1.0)\n",
+ "Requirement already satisfied: wrapt in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from smart-open<8.0.0,>=5.2.1->weasel<0.5.0,>=0.4.2->spacy>=3.4.0->semantica) (1.17.2)\n",
+ "Requirement already satisfied: greenlet!=0.4.17 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from sqlalchemy>=1.4.0->semantica) (3.2.3)\n",
+ "Requirement already satisfied: sympy in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from torch>=1.12.0->semantica) (1.13.3)\n",
+ "Requirement already satisfied: distlib<1,>=0.3.7 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from virtualenv>=20.10.0->pre-commit>=2.19.0->semantica) (0.3.7)\n",
+ "Requirement already satisfied: validators<1.0.0,>=0.34.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from weaviate-client>=3.15.0->semantica) (0.35.0)\n",
+ "Requirement already satisfied: authlib<2.0.0,>=1.2.1 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from weaviate-client>=3.15.0->semantica) (1.6.0)\n",
+ "Requirement already satisfied: deprecation<3.0.0,>=2.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from weaviate-client>=3.15.0->semantica) (2.1.0)\n",
+ "Requirement already satisfied: MarkupSafe>=2.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from jinja2->spacy>=3.4.0->semantica) (2.1.3)\n",
+ "Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\\users\\mohd kaif\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from sympy->torch>=1.12.0->semantica) (1.3.0)\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 -U semantica\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## What Is Semantica?\n",
+ "\n",
+ "Semantica is a **semantic intelligence and knowledge engineering framework**. It helps you:\n",
+ "\n",
+ "- Build **knowledge graphs** from unstructured and semi-structured data\n",
+ "- Create a unified **semantic layer** on top of diverse data sources\n",
+ "- Power **GraphRAG**, AI agents, and multi-agent systems with structured knowledge\n",
+ "- Incorporate **temporal and quality-aware reasoning** into your applications\n",
+ "\n",
+ "### Core Capabilities\n",
+ "\n",
+ "- **Universal ingestion**: Files, web, feeds, databases, repositories, streams\n",
+ "- **Rich parsing**: PDFs, Office documents, HTML, JSON, CSV, images, code\n",
+ "- **Normalization**: Cleaning, language detection, entity normalization, date/number standardization\n",
+ "- **Semantic extraction**: Named entities, relationships, events, semantic networks\n",
+ "- **Knowledge graph construction**: Property graphs from entities and relations\n",
+ "- **Embeddings and vector search**: Text and graph embeddings, hybrid retrieval\n",
+ "- **Reasoning and ontology**: Rule-based inference, ontology generation and validation\n",
+ "- **Visualization and analytics**: Graph visualizations and quality metrics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Who Is Semantica For?\n",
+ "\n",
+ "- **AI/ML engineers** building GraphRAG systems, agents, and tools that need long-term memory\n",
+ "- **Data engineers** orchestrating semantic enrichment pipelines over large, heterogeneous datasets\n",
+ "- **Knowledge engineers and ontologists** designing and maintaining formal knowledge structures\n",
+ "- **Researchers and analysts** creating domain knowledge graphs from documents and data feeds\n",
+ "- **Product and platform teams** embedding semantic intelligence into applications and services"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Architecture Overview\n",
+ "\n",
+ "Semantica is organized as three conceptual layers and multiple concrete modules.\n",
+ "\n",
+ "### Layers\n",
+ "\n",
+ "- **Input Layer**\n",
+ " - Connects to files, web pages, APIs, databases, email, feeds, repositories, and streams\n",
+ " - Normalizes these different sources into a unified internal representation\n",
+ "\n",
+ "- **Semantic Layer**\n",
+ " - Performs parsing, cleaning, semantic extraction, graph construction, embeddings, and reasoning\n",
+ " - This is where **unstructured data becomes structured knowledge**\n",
+ "\n",
+ "- **Output Layer**\n",
+ " - Exposes knowledge graphs, embeddings, ontologies, and analytics\n",
+ " - Integrates with vector stores, graph databases, and downstream applications"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 🧩 Semantica Modules Reference\n",
+ "\n",
+ "Semantica is modular by design. Here is a comprehensive guide to all available modules, grouped by functionality.\n",
+ "\n",
+ "### πŸ“₯ Ingestion & Parsing\n",
+ "Modules that handle raw data input and structure.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`ingest`** | **Data Ingestion**<br>Connects to data sources. | β€’ File, Web, Feed, Stream ingestion<br>β€’ DB, Email, Repo, MCP support |\n",
+ "| **`parse`** | **Document Parsing**<br>Parses raw content into structures. | β€’ PDF, HTML, JSON, CSV, Excel<br>β€’ Image & Code parsing |\n",
+ "\n",
+ "### βš™οΈ Data Processing\n",
+ "Modules that clean, normalize, and split data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`normalize`** | **Data Normalization**<br>Cleans and standardizes text. | β€’ Text cleaning & Language detection<br>β€’ Entity, Date, Number normalization |\n",
+ "| **`split`** | **Chunking**<br>Splits documents for RAG. | β€’ Recursive character splitting<br>β€’ Semantic & Token-based splitting |\n",
+ "\n",
+ "### 🧠 Extraction & Enrichment\n",
+ "Modules that extract meaning, structure, and vectors from raw data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`semantic_extract`** | **Information Extraction**<br>Extracts entities and relations. | β€’ NER & Relation Extraction<br>β€’ Event & Semantic Network detection |\n",
+ "| **`context`** | **Agent Memory**<br>Manages state for AI agents. | β€’ Long-term memory & history<br>β€’ Context graph & RAG integration |\n",
+ "\n",
+ "### πŸ•ΈοΈ Knowledge Graph Core\n",
+ "Modules for building, refining, and resolving knowledge graphs.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`kg`** | **Graph Construction**<br>Builds and analyzes graphs. | β€’ Graph Building & Analysis<br>β€’ Validation & Entity Resolution |\n",
+ "| **`conflicts`** | **Conflict Resolution**<br>Resolves data contradictions. | β€’ Source reliability scoring<br>β€’ Truth discovery algorithms |\n",
+ "| **`deduplication`** | **Entity Resolution**<br>Merges duplicate entities. | β€’ Similarity-based blocking<br>β€’ Clustering & Canonicalization |\n",
+ "\n",
+ "### πŸ’Ύ Storage & Retrieval\n",
+ "Modules for persisting and querying data.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`embeddings`** | **Vector Embeddings**<br>Generates semantic vectors. | β€’ Text & Graph embeddings<br>β€’ Multi-provider support (OpenAI, etc.) |\n",
+ "| **`vector_store`** | **Vector Database**<br>Stores and searches vectors. | β€’ Similarity search & Filtering<br>β€’ Hybrid search (Vector + Keyword) |\n",
+ "| **`graph_store`** | **Property Graph Store**<br>Persists graph data. | β€’ Neo4j, FalkorDB adapters<br>β€’ Cypher query support |\n",
+ "| **`triplet_store`** | **RDF Store**<br>Persists semantic triplets. | β€’ SPARQL endpoints<br>β€’ BlazeGraph, Jena, Virtuoso adapters |\n",
+ "\n",
+ "### πŸ”Ž Reasoning & Analysis\n",
+ "Modules for deriving new knowledge and evaluating quality.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`reasoning`** | **Inference Engine**<br>Derives new facts via rules. | β€’ Datalog/Rule-based inference<br>β€’ Forward/Backward chaining |\n",
+ "| **`ontology`** | **Ontology Management**<br>Manages schema and definitions. | β€’ Ontology generation from data<br>β€’ Validation & Evolution |\n",
+ "| **`visualization`** | **Visual Analytics**<br>Visualizes graphs and metrics. | β€’ 2D/3D Graph visualization<br>β€’ Interactive plots & dashboards |\n",
+ "| **`evals`** | **Evaluation**<br>Benchmarks pipeline quality. | β€’ RAG & Graph quality metrics<br>β€’ Ground truth comparison |\n",
+ "\n",
+ "### πŸ› οΈ Orchestration & Utils\n",
+ "Modules for managing the framework and workflows.\n",
+ "\n",
+ "| Module | Description | Key Capabilities |\n",
+ "| :--- | :--- | :--- |\n",
+ "| **`core`** | **Framework Core**<br>Main entry point and config. | β€’ Lifecycle management<br>β€’ Plugin system & Configuration |\n",
+ "| **`pipeline`** | **Workflow Orchestration**<br>Manages complex flows. | β€’ DAG execution & Retries<br>β€’ Error handling & Observability |\n",
+ "| **`seed`** | **Data Seeding**<br>Initializes knowledge bases. | β€’ Taxonomy & Ontology seeding<br>β€’ Reference data loading |\n",
+ "| **`export`** | **Data Export**<br>Exports data to files. | β€’ JSON, CSV, RDF, GEXF export<br>β€’ Report generation |\n",
+ "| **`utils`** | **Utilities**<br>Common helper functions. | β€’ Logging, Async, Hashing<br>β€’ Text processing helpers |"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Core Concepts (High-Level)\n",
+ "\n",
+ "- **Knowledge graph**\n",
+ " - Nodes represent entities such as people, organizations, locations, events, or concepts\n",
+ " - Edges represent relationships such as `works_for`, `located_in`, `founded_by`\n",
+ " - Properties capture attributes and metadata such as timestamps, sources, and confidence\n",
+ "\n",
+ "- **Entities and relationships**\n",
+ " - Entities are extracted from text and data using NER\n",
+ " - Relationships connect entities and are extracted using pattern-based, model-based, or LLM-based methods\n",
+ "\n",
+ "- **Embeddings**\n",
+ " - Numerical vectors that encode semantic meaning of text or graph structures\n",
+ " - Used for semantic search, clustering, and similarity-based retrieval\n",
+ "\n",
+ "- **GraphRAG**\n",
+ " - Combines vector search with graph traversal\n",
+ " - Uses both embeddings and graph structure to retrieve rich, context-aware information\n",
+ "\n",
+ "- **Ontology**\n",
+ " - A formal model of classes, relationships, and constraints in a domain\n",
+ " - Used to standardize meaning, enable reasoning, and integrate heterogeneous data\n",
+ "\n",
+ "- **Quality and governance**\n",
+ " - Quality metrics (completeness, consistency, accuracy, coverage)\n",
+ " - Conflict detection and resolution at the knowledge graph level"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Installation\n",
+ "\n",
+ "You can install Semantica from PyPI. In this notebook, we use a pip cell so it can run in local Jupyter or Colab.\n",
+ "\n",
+ "Equivalent shell commands:\n",
+ "\n",
+ "```bash\n",
+ "pip install semantica\n",
+ "pip install semantica[all]\n",
+ "```"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Basic Configuration\n",
+ "\n",
+ "Semantica uses configuration for API keys, embedding providers, and knowledge graph options. The example below mirrors a typical configuration while staying simple enough for a notebook."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'api_keys:\\n openai: your_key_here\\n anthropic: your_key_here\\nembedding:\\n provider: openai\\n model: text-embedding-3-large\\n dimensions: 3072\\nknowledge_graph:\\n backend: networkx\\n temporal: true\\n'"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "import os\n",
+ "from pathlib import Path\n",
+ "\n",
+ "os.environ[\"SEMANTICA_API_KEY\"] = \"your_openai_key\"\n",
+ "os.environ[\"SEMANTICA_EMBEDDING_PROVIDER\"] = \"openai\"\n",
+ "os.environ[\"SEMANTICA_MODEL_NAME\"] = \"gpt-4\"\n",
+ "\n",
+ "config_text = \"\"\"api_keys:\n",
+ " openai: your_key_here\n",
+ " anthropic: your_key_here\n",
+ "embedding:\n",
+ " provider: openai\n",
+ " model: text-embedding-3-large\n",
+ " dimensions: 3072\n",
+ "knowledge_graph:\n",
+ " backend: networkx\n",
+ " temporal: true\n",
+ "\"\"\"\n",
+ "Path(\"config.yaml\").write_text(config_text, encoding=\"utf-8\")\n",
+ "Path(\"config.yaml\").read_text(encoding=\"utf-8\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Setup: Create Sample Data\n",
+ "\n",
+ "First, let's create a small sample document to work with."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Created sample document at welcome_docs\\apple.txt\n"
+ ]
+ }
+ ],
+ "source": [
+ "from pathlib import Path\n",
+ "\n",
+ "docs_dir = Path(\"welcome_docs\")\n",
+ "docs_dir.mkdir(exist_ok=True)\n",
+ "text_path = docs_dir / \"apple.txt\"\n",
+ "text_content = (\n",
+ " \"Apple Inc. was founded by Steve Jobs, Steve Wozniak and Ronald Wayne in\"\n",
+ " \" Cupertino, California.\"\n",
+ ")\n",
+ "text_path.write_text(text_content, encoding=\"utf-8\")\n",
+ "print(f\"Created sample document at {text_path}\")"
+ ]
+ },
++>>>>>>> main
{
"cell_type": "markdown",
"metadata": {},
@@@ -885,7 -543,7 +1158,11 @@@
{
"data": {
"text/html": [
++<<<<<<< HEAD
+ "<div style='font-family: monospace;'><h4>\ud83e\udde0 Semantica - \ud83d\udcca Current Progress</h4><table style='width: 100%; border-collapse: collapse;'><tr><th>Status</th><th>Action</th><th>Module</th><th>Submodule</th><th>File</th><th>Time</th></tr><tr><td>\u2705</td><td>Semantica is building</td><td>\ud83e\udde0 kg</td><td>CommunityDetector</td><td>-</td><td>0.02s</td></tr><tr><td>\u2705</td><td>Semantica is indexing</td><td>\ud83d\udcca vector_store</td><td>VectorStore</td><td>-</td><td>0.00s</td></tr><tr><td>\u2705</td><td>Semantica is indexing</td><td>\ud83d\udcca vector_store</td><td>HybridSearch</td><td>-</td><td>3.15s</td></tr><tr><td>\u2705</td><td>Semantica is embedding</td><td>\ud83d\udcbe embeddings</td><td>TextEmbedder</td><td>-</td><td>0.02s</td></tr><tr><td>\u2705</td><td>Semantica is visualizing</td><td>\ud83d\udcc8 visualization</td><td>KGVisualizer</td><td>-</td><td>0.17s</td></tr><tr><td>\u2705</td><td>Semantica is generating</td><td>\ud83d\udcda ontology</td><td>OntologyGenerator</td><td>-</td><td>0.04s</td></tr><tr><td>\u2705</td><td>Semantica is generating</td><td>\ud83d\udcda ontology</td><td>ClassInferrer</td><td>-</td><td>0.01s</td></tr><tr><td>\u2705</td><td>Semantica is generating</td><td>\ud83d\udcda ontology</td><td>PropertyGenerator</td><td>-</td><td>0.01s</td></tr><tr><td>\u2705</td><td>Semantica is reasoning</td><td>\ud83e\udd14 reasoning</td><td>RuleManager</td><td>-</td><td>0.02s</td></tr><tr><td>\u2705</td><td>Semantica is reasoning</td><td>\ud83e\udd14 reasoning</td><td>InferenceEngine</td><td>-</td><td>0.01s</td></tr></table></div>"
++=======
+ "<div style='font-family: monospace;'><h4>🧠 Semantica - πŸ“Š Current Progress</h4><table style='width: 100%; border-collapse: collapse;'><tr><th>Status</th><th>Action</th><th>Module</th><th>Submodule</th><th>File</th><th>Time</th></tr><tr><td>βœ…</td><td>Semantica is building</td><td>🧠 kg</td><td>CommunityDetector</td><td>-</td><td>0.02s</td></tr><tr><td>βœ…</td><td>Semantica is indexing</td><td>πŸ“Š vector_store</td><td>VectorStore</td><td>-</td><td>0.00s</td></tr><tr><td>βœ…</td><td>Semantica is indexing</td><td>πŸ“Š vector_store</td><td>HybridSearch</td><td>-</td><td>3.15s</td></tr><tr><td>βœ…</td><td>Semantica is embedding</td><td>πŸ’Ύ embeddings</td><td>TextEmbedder</td><td>-</td><td>0.02s</td></tr><tr><td>βœ…</td><td>Semantica is visualizing</td><td>πŸ“ˆ visualization</td><td>KGVisualizer</td><td>-</td><td>0.17s</td></tr><tr><td>βœ…</td><td>Semantica is generating</td><td>πŸ“š ontology</td><td>OntologyGenerator</td><td>-</td><td>0.04s</td></tr><tr><td>βœ…</td><td>Semantica is generating</td><td>πŸ“š ontology</td><td>ClassInferrer</td><td>-</td><td>0.01s</td></tr><tr><td>βœ…</td><td>Semantica is generating</td><td>πŸ“š ontology</td><td>PropertyGenerator</td><td>-</td><td>0.01s</td></tr><tr><td>βœ…</td><td>Semantica is reasoning</td><td>πŸ€” reasoning</td><td>RuleManager</td><td>-</td><td>0.02s</td></tr><tr><td>βœ…</td><td>Semantica is reasoning</td><td>πŸ€” reasoning</td><td>InferenceEngine</td><td>-</td><td>0.01s</td></tr></table></div>"
++>>>>>>> main
],
"text/plain": [
"<IPython.core.display.HTML object>"
@@@ -1989,14 -1647,14 +2266,22 @@@
}
],
"source": [
++<<<<<<< HEAD
+ "# # from semantica.reasoning import InferenceEngine\n",
++=======
+ "from semantica.reasoning import InferenceEngine\n",
++>>>>>>> main
"\n",
"# Simple rule: If X founded Y, then X works_for Y\n",
"rule = \"\"\"\n",
"IF (?x founded ?y) THEN (?x works_for ?y)\n",
"\"\"\"\n",
"\n",
++<<<<<<< HEAD
+ "# # engine = InferenceEngine()\n",
++=======
+ "engine = InferenceEngine()\n",
++>>>>>>> main
"engine.add_rule(rule)\n",
"inferred_facts = engine.infer(kg)\n",
"\n",
@@@ -2103,5 -1761,4 +2388,9 @@@
},
"nbformat": 4,
"nbformat_minor": 2
++<<<<<<< HEAD
+>>>>>>> Stashed changes
- }
++}
++=======
+ }
++>>>>>>> main
diff --cc cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb
index 87b31778,c5179528..6008f171
--- a/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb
+++ b/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb
@@@ -2,168 -2,19 +2,180 @@@
"cells": [
{
"cell_type": "markdown",
+ "id": "31d1a12c",
"metadata": {},
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "[![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/advanced_rag/01_GraphRAG_Complete.ipynb)\n",
+ "\n",
+ "# GraphRAG Complete - End-to-End Pipeline\n",
+=======
+ "# \ud83e\uddea GraphRAG: Skincare Intelligence System\n",
+ "## \ud83d\udcd6 Overview\n",
+ "This notebook demonstrates the construction and querying of a **highly detailed Knowledge Graph** for the Skincare and Dermatology domain using the Semantica framework.\n",
+ "\n",
+ "### \ud83c\udfd7\ufe0f Pipeline Architecture\n",
++=======
+ "# πŸ§ͺ GraphRAG: Skincare Intelligence System\n",
+ "## πŸ“– Overview\n",
+ "This notebook demonstrates the construction and querying of a **highly detailed Knowledge Graph** for the Skincare and Dermatology domain using the Semantica framework.\n",
+ "\n",
+ "### πŸ—οΈ Pipeline Architecture\n",
++>>>>>>> main
"1. **Phase 0: Foundation**: Environment setup and \"Ground Truth\" seeding.\n",
"2. **Phase 1: Multi-Source Ingestion**: Aggregating knowledge from Expert RSS Feeds and clinical guides.\n",
"3. **Phase 2: Semantic Extraction**: Deep extraction of entities and relationships using Llama 3.1.\n",
"4. **Phase 3: Refinement**: Autonomous deduplication and conflict resolution.\n",
"5. **Phase 4: Multi-Hop Question Answering**: Interactive user queries using **AgentContext (Hybrid Retrieval)**."
++<<<<<<< HEAD
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "fdef52b8",
+ "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": [
+ "# Install dependencies\n",
+ "%pip install -qU semantica networkx matplotlib plotly pandas faiss-cpu beautifulsoup4 groq sentence-transformers"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "508c1ce5",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "fastembed not available. Install with: pip install fastembed. Using fallback embedding method.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u2705 Phase 0 Complete. Seeded 3 primary nodes.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import os\n",
+ "import json\n",
+ "import pandas as pd\n",
+ "from semantica.core import Semantica, ConfigManager\n",
+ "from semantica.seed import SeedDataManager\n",
+ "from semantica.vector_store import VectorStore\n",
+>>>>>>> Stashed changes
+ "\n",
+ "## Overview\n",
+ "\n",
+<<<<<<< Updated upstream
+ "This notebook demonstrates a **complete end-to-end GraphRAG (Graph-based Retrieval Augmented Generation) system** using Semantica framework. It showcases how to build a production-ready GraphRAG system that combines vector search with knowledge graph traversal for enhanced retrieval and question answering.\n",
+=======
+ "config_dict = {\n",
+ " \"project_name\": \"Skincare_Intelligence\",\n",
+ " \"embedding\": {\"provider\": \"sentence_transformers\", \"model\": \"all-MiniLM-L6-v2\"}, \n",
+ " \"extraction\": {\n",
+ " \"provider\": \"groq\", \n",
+ " \"model\": \"llama-3.1-8b-instant\", \n",
+ " \"temperature\": 0.0\n",
+ " },\n",
+ "# # \"inference\": {\n",
+ " \"provider\": \"groq\",\n",
+ " \"model\": \"llama-3.1-70b-versatile\"\n",
+ " },\n",
+ " \"vector_store\": {\"provider\": \"faiss\", \"dimension\": 384},\n",
+ " \"knowledge_graph\": {\"backend\": \"networkx\", \"merge_entities\": True}\n",
+ "}\n",
+>>>>>>> Stashed changes
+ "\n",
+ "**Key Features:**\n",
+ "\n",
+ "- **Real-World Data**: Uses actual data sources via MCP servers, web scraping, and RSS feeds (NO mock data)\n",
+ "- **Complete Pipeline**: From data ingestion to LLM-powered question answering\n",
+ "- **Hybrid Retrieval**: Combines vector similarity search with knowledge graph traversal\n",
+ "- **Multi-hop Reasoning**: Follows relationships across the graph for deeper context\n",
+ "- **20+ Semantica Modules**: Demonstrates comprehensive use of the framework\n",
+ "\n",
+ "**Documentation**: [API Reference](https://semantica.readthedocs.io/concepts/) β€’ [GraphRAG Guide](https://semantica.readthedocs.io/concepts/)\n",
+ "\n",
+<<<<<<< Updated upstream
+ "### What You'll Learn\n",
+ "\n",
+ "- How to ingest real-world data from multiple sources (MCP, web, feeds)\n",
+ "- How to build knowledge graphs from unstructured text\n",
+ "- How to implement hybrid search combining vectors and graphs\n",
+ "- How to use ContextRetriever for intelligent context expansion\n",
+ "- How to integrate LLMs with GraphRAG for question answering\n",
+ "- How to visualize and export knowledge graphs\n",
+ "\n",
+ "### Pipeline Overview\n",
+ "\n",
+ "**Real-World Data Sources (MCP/Web/Feeds) β†’ Parse β†’ Extract Entities & Relationships β†’ Build Knowledge Graph β†’ Generate Embeddings β†’ Vector Store β†’ Hybrid Search β†’ Context Retrieval β†’ GraphRAG Query System β†’ LLM Integration β†’ Answer Generation**\n",
+ "\n",
+ "---\n",
+ "\n",
+ "## Installation\n",
+ "\n",
+ "Install Semantica from PyPI:\n",
+ "\n",
+ "```bash\n",
+ "pip install semantica\n",
+ "\n",
+ "# Or with all optional dependencies:\n",
+ "pip install semantica[all]\n",
+ "```\n",
+ "\n",
+ "### Additional Dependencies\n",
+ "\n",
+ "```bash\n",
+ "pip install openai anthropic # For LLM integration\n",
+ "pip install jupyter # For running this notebook\n",
+ "```\n"
+=======
+ "print(f\"\u2705 Phase 0 Complete. Seeded {len(foundation_data['entities'])} primary nodes.\")"
+>>>>>>> Stashed changes
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+<<<<<<< Updated upstream
+ "## Step 1: Setup and Import Semantica Modules\n",
+ "\n",
+ "Import all necessary Semantica modules for the complete GraphRAG pipeline. This includes modules for ingestion, parsing, extraction, graph building, embeddings, vector storage, context retrieval, and more.\n",
+ "\n"
++=======
++>>>>>>> main
]
},
{
@@@ -1619,390 -412,10 +573,289 @@@
{
"cell_type": "code",
"execution_count": null,
+ "id": "a45000b6",
"metadata": {},
"outputs": [],
- "source": [
- "from semantica.export import JSONExporter, RDFExporter, CSVExporter\n",
- "\n",
- "json_exporter = JSONExporter()\n",
- "rdf_exporter = RDFExporter()\n",
- "csv_exporter = CSVExporter()\n",
- "\n",
- "# Export knowledge graph to JSON\n",
- "if knowledge_graph.number_of_nodes() > 0:\n",
- " print(f\"Exporting knowledge graph...\")\n",
- " \n",
- " # Export to JSON\n",
- " json_output = json_exporter.export(knowledge_graph, \"graphrag_knowledge_graph.json\")\n",
- " print(f\"Exported to JSON: graphrag_knowledge_graph.json\")\n",
- " \n",
- " # Export to RDF\n",
- " rdf_output = rdf_exporter.export(knowledge_graph, \"graphrag_knowledge_graph.rdf\")\n",
- " print(f\"Exported to RDF: graphrag_knowledge_graph.rdf\")\n",
- " \n",
- " # Export entities to CSV\n",
- " entities_data = []\n",
- " for entity in resolved_entities[:100]: # Limit for demo\n",
- " if isinstance(entity, dict):\n",
- " entities_data.append({\n",
- " 'id': entity.get('id', ''),\n",
- " 'text': entity.get('text', entity.get('name', '')),\n",
- " 'type': entity.get('type', 'Unknown')\n",
- " })\n",
- " \n",
- " if entities_data:\n",
- " csv_output = csv_exporter.export(entities_data, \"graphrag_entities.csv\")\n",
- " print(f\"Exported entities to CSV: graphrag_entities.csv\")\n",
- " \n",
- " print(f\"\\nExport Summary:\")\n",
- " print(f\" Nodes exported: {knowledge_graph.number_of_nodes()}\")\n",
- " print(f\" Edges exported: {knowledge_graph.number_of_edges()}\")\n",
- " print(f\" Entities exported: {len(entities_data)}\")\n",
- "else:\n",
- " print(f\"Graph is empty, skipping export\")\n",
- "\n",
- "# Save vector store (if supported)\n",
- "print(\"\\nVector Store:\")\n",
- "print(f\" Vectors stored: βœ“\")\n",
- "print(f\" Metadata stored: βœ“\")\n",
- "print(f\" Ready for reuse: βœ“\")\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Summary and Next Steps\n",
- "\n",
- "### What We Built\n",
- "\n",
- "This notebook demonstrated a **complete end-to-end GraphRAG system** using Semantica:\n",
- "\n",
- "1. **Real-World Data Ingestion**: MCP servers, web scraping, RSS feeds\n",
- "2. **Document Processing**: Parsing, splitting, normalization\n",
- "3. **Semantic Extraction**: Entities, relationships, triples\n",
- "4. **Knowledge Graph Construction**: With quality assurance\n",
- "5. **Embedding Generation**: For documents and entities\n",
- "6. **Vector Store**: Fast similarity search\n",
- "7. **Hybrid Search**: Combining vectors and graphs\n",
- "8. **Context Retrieval**: With graph expansion\n",
- "9. **GraphRAG Query System**: Complete query processing\n",
- "10. **LLM Integration**: Answer generation with context\n",
- "11. **Advanced Features**: Reasoning, quality, visualization\n",
- "12. **Export**: Persistence and sharing\n",
- "\n",
- "### Key Takeaways\n",
- "\n",
- "- **GraphRAG** combines the best of vector search and knowledge graphs\n",
- "- **Multi-hop reasoning** enables deeper understanding\n",
- "- **Real-world data** makes the system production-ready\n",
- "- **Semantica** provides all modules needed for GraphRAG\n",
- "\n",
- "### Next Steps\n",
- "\n",
- "1. **Configure Real Data Sources**: Set up MCP servers, web URLs, or RSS feeds\n",
- "2. **Customize Extraction**: Adjust entity and relationship extraction for your domain\n",
- "3. **Tune Hybrid Search**: Experiment with `hybrid_alpha` for your use case\n",
- "4. **Add More LLMs**: Integrate with Anthropic, local models, or other providers\n",
- "5. **Scale Up**: Process larger datasets and optimize performance\n",
- "6. **Deploy**: Build production GraphRAG applications\n",
- "\n",
- "### Resources\n",
- "\n",
- "- [Semantica Documentation](https://semantica.readthedocs.io/)\n",
- "- [GraphRAG Concepts](https://semantica.readthedocs.io/concepts/)\n",
- "- [API Reference](https://semantica.readthedocs.io/reference/)\n",
- "- [More Examples](https://semantica.readthedocs.io/cookbook/)\n",
- "\n",
- "---\n",
- "\n",
- "**Congratulations!** You've built a complete GraphRAG system with Semantica!\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
"source": []
+=======
+ "## \ud83d\udce5 Phase 1: Ingestion & Processing\n",
+ "We pull real-world knowledge from expert feeds and clinical guides, then split them into semantic chunks."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "52f20118",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ingesting from: https://makeupandbeautyblog.com/feed\n",
+ "Ingesting from: https://www.drbaileyskincare.com/blogs/blog.atom\n",
+ "\u2705 Phase 1 Complete. Generated 74 semantic chunks.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from semantica.ingest import FeedIngestor\n",
+ "from semantica.split import EntityAwareChunker\n",
+ "from semantica.normalize import TextNormalizer\n",
+ "\n",
+ "sources = []\n",
+ "feed_ingestor = FeedIngestor()\n",
+ "\n",
+ "# 1. RSS Ingestion\n",
+ "feed_urls = [\n",
+ " \"https://makeupandbeautyblog.com/feed\",\n",
+ " \"https://www.drbaileyskincare.com/blogs/blog.atom\"\n",
+ "]\n",
+ "\n",
+ "for url in feed_urls:\n",
+ " try:\n",
+ " print(f\"Ingesting from: {url}\")\n",
+ " feed_data = feed_ingestor.ingest_feed(url)\n",
+ " sources.extend([item.content or item.description for item in feed_data.items[:3]])\n",
+ " except Exception as e:\n",
+ " print(f\"Failed to ingest {url}: {e}\")\n",
+ "\n",
+ "# 2. Local Expert Guide\n",
+ "expert_content = \"\"\"\n",
+ "RETINOL CLINICAL GUIDE\n",
+ "Mechanism: Binds to retinoic acid receptors to increase cellular turnover.\n",
+ "Precautions: Should not be used with high-concentration AHA/BHA exfoliants.\n",
+ "Synergy: Highly effective when paired with Niacinamide to offset potential erythema.\n",
+ "\"\"\"\n",
+ "sources.append(expert_content)\n",
+ "\n",
+ "# 3. Chunking & Normalization\n",
+ "normalizer = TextNormalizer()\n",
+ "chunker = EntityAwareChunker(chunk_size=1000, chunk_overlap=200)\n",
+ "all_chunks = []\n",
+ "for text in sources:\n",
+ " if not text: continue\n",
+ " norm_text = normalizer.normalize(text)\n",
+ " all_chunks.extend(chunker.chunk(norm_text))\n",
+ "\n",
+ "print(f\"\u2705 Phase 1 Complete. Generated {len(all_chunks)} semantic chunks.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "de3c9cc0",
+ "metadata": {},
+ "source": [
+ "## \ud83e\udde0 Phase 2: Semantic Extraction\n",
+ "Using **Groq (Llama 3.1 8B)** to extract entities and relationships."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "10be6143",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Extracting intelligence from chunks...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "LLM relation extraction failed: Failed to parse JSON from Groq response: No JSON structure found in response\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u2705 Phase 2 Complete. Extracted 29 entities.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor\n",
+ "\n",
+ "ner = NERExtractor(method=\"llm\", provider=\"groq\", model=\"llama-3.1-8b-instant\")\n",
+ "rel_ext = RelationExtractor(method=\"llm\", provider=\"groq\", model=\"llama-3.1-8b-instant\")\n",
+ "\n",
+ "combined_results = {\"entities\": [], \"relationships\": []}\n",
+ "\n",
+ "print(\"Extracting intelligence from chunks...\")\n",
+ "for chunk in all_chunks[:5]:\n",
+ " txt = str(chunk.text)\n",
+ " entities = ner.extract(txt)\n",
+ " combined_results[\"entities\"].extend([{\"name\": e.text, \"type\": e.label, \"id\": e.text.lower().replace(' ', '_')} for e in entities])\n",
+ " relations = rel_ext.extract(txt, entities=entities)\n",
+ " combined_results[\"relationships\"].extend([{\"source\": r.subject, \"target\": r.object, \"type\": r.predicate} for r in relations])\n",
+ "\n",
+ "print(f\"\u2705 Phase 2 Complete. Extracted {len(combined_results['entities'])} entities.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0ef80273",
+ "metadata": {},
+ "source": [
+ "## \u2728 Phase 3: Graph Refinement\n",
+ "Merging fragments and building the final Knowledge Graph."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "c836e86f",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "fastembed not available. Install with: pip install fastembed. Using fallback embedding method.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\u2705 Phase 3 Complete. Graph contains 10 resolved entities.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from semantica.kg import GraphBuilder, EntityResolver\n",
+ "\n",
+ "# 1. Build & Vectorize\n",
+ "gb = GraphBuilder(merge_entities=True)\n",
+ "kg = gb.build(sources=[combined_results])\n",
+ "\n",
+ "# 2. Deduplicate\n",
+ "resolver = EntityResolver(similarity_threshold=0.85)\n",
+ "kg_final = {**kg, 'entities': resolver.resolve_entities(kg['entities'])}\n",
+ "\n",
+ "# 3. Populate Vector Store for retrieval\n",
+ "texts = [str(c.text) for c in all_chunks]\n",
+ "embeddings = core.embedding_generator.generate_embeddings(texts)\n",
+ "vs.store_vectors(vectors=embeddings, metadata=[{\"text\": t} for t in texts])\n",
+ "\n",
+ "print(f\"\u2705 Phase 3 Complete. Graph contains {len(kg_final['entities'])} resolved entities.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "76cbe42a",
+ "metadata": {},
+ "source": [
+ "## \ud83d\udcac Phase 4: Interactive GraphRAG Question Answering\n",
+ "Using **AgentContext** for unified hybrid retrieval."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "29d04181",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\ud83d\udd0d Processing Multi-Hop Query: What ingredients synergize with Retinol to prevent irritation?\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "c:\\Users\\Mohd Kaif\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\numpy\\linalg\\linalg.py:2582: RuntimeWarning:\n",
+ "\n",
+ "overflow encountered in multiply\n",
+ "\n",
+ "C:\\Users\\Mohd Kaif\\semantica\\semantica\\vector_store\\vector_store.py:498: RuntimeWarning:\n",
+ "\n",
+ "invalid value encountered in divide\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\u274c No relevant context found.\n"
+ ]
+ }
+ ],
+ "source": [
+ "from semantica.context import AgentContext\n",
+ "\n",
+ "# 1. Initialize AgentContext (Hybrid Retrieval)\n",
+ "ctx = AgentContext(\n",
+ " vector_store=vs,\n",
+ " knowledge_graph=kg_final,\n",
+ " use_graph_expansion=True,\n",
+ " max_expansion_hops=2\n",
+ ")\n",
+ "\n",
+ "\n",
+ "# 2. Interactive Query Loop\n",
+ "user_query = \"What ingredients synergize with Retinol to prevent irritation?\"\n",
+ "\n",
+ "print(f\"\\n\ud83d\udd0d Processing Multi-Hop Query: {user_query}\")\n",
+ "\n",
+ "# Retrieve multi-hop context using AgentContext\n",
+ "context_results = ctx.retrieve(user_query, max_results=2)\n",
+ "\n",
+ "if context_results:\n",
+ " print(\"\\n--- \ud83e\udde0 MULTI-HOP CONTEXT DISCOVERED ---\")\n",
+ " for res in context_results:\n",
+ " print(f\"Recall: {res['content'][:120]}...\")\n",
+ " if res.get('related_entities'):\n",
+ " print(f\" \ud83d\udd17 Multi-hop connections: {[e['content'] for e in res['related_entities'][:3]]}\")\n",
+ "\n",
+ " # Generate Final Answer\n",
+ " context_text = \" \".join([r['content'] for r in context_results])\n",
+ " prompt = f\"Based on the following context, answer the user query accurately.\\nContext: {context_text}\\nQuery: {user_query}\"\n",
+ " \n",
+ " try:\n",
+ " print(\"\\n--- \u2728 FINAL GRAPHRAG ANSWER ---\")\n",
+ " print(final_answer)\n",
+ " except Exception as e:\n",
+ " print(f\"\\n(LLM synthesis skipped: {e})\")\n",
+ "else:\n",
+ " print(\"\\n\u274c No relevant context found.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5c478f11",
+ "metadata": {},
+ "source": [
+ "## \ud83d\udcca Visualizing the Intelligence\n",
+ "A final look at the relationships we've built."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "851383de",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from semantica.visualization import KGVisualizer\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "viz = KGVisualizer()\n",
+ "viz.visualize_network(kg_final, layout=\"spring\", title=\"Skincare Ingredient Intelligence Graph\")\n",
+ "plt.show()"
+ ]
+>>>>>>> Stashed changes
}
],
"metadata": {
@@@ -2011,9 -438,5 +878,14 @@@
}
},
"nbformat": 4,
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "nbformat_minor": 2
+=======
+ "nbformat_minor": 5
+>>>>>>> Stashed changes
- }
++}
++=======
+ "nbformat_minor": 5
+ }
++>>>>>>> main
diff --cc cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb
index 11f9fb95,5c39fa1d..8ac05255
--- a/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb
+++ b/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb
@@@ -11,7 -11,7 +11,11 @@@
"This notebook provides a rigorous, side-by-side comparison of **Standard RAG (Vector-based)** and **GraphRAG (Graph-based)**, focusing on the Global Intelligence and Security domain.\n",
"\n",
"### The Challenge: Navigating Fragmentation\n",
++<<<<<<< HEAD
+ "In intelligence work, facts are scattered across reports. Vector search often fails to bridge \"semantic gaps\"\u2014logical connections between entities that are not physically co-located in text. \n",
++=======
+ "In intelligence work, facts are scattered across reports. Vector search often fails to bridge \"semantic gaps\"β€”logical connections between entities that are not physically co-located in text. \n",
++>>>>>>> main
"\n",
"We will demonstrate how GraphRAG creates a **\"Chain of Evidence\"** that Vector RAG cannot see.\n",
"\n",
@@@ -77,7 -77,7 +81,11 @@@
{
"data": {
"text/html": [
++<<<<<<< HEAD
+ "<div style='font-family: monospace;'><h4>\ud83e\udde0 Semantica - \ud83d\udcca Current Progress</h4><table style='width: 100%; border-collapse: collapse;'><tr><th>Status</th><th>Action</th><th>Module</th><th>Submodule</th><th>File</th><th>Time</th></tr><tr><td>\u2705</td><td>Semantica is building</td><td>\ud83e\udde0 kg</td><td>GraphBuilder</td><td>-</td><td>21.67s</td></tr><tr><td>\ud83d\udd04</td><td>Semantica is building</td><td>\ud83e\udde0 kg</td><td>EntityResolver</td><td>-</td><td>11.02s</td></tr><tr><td>\u2705</td><td>Semantica is deduplicating</td><td>\ud83d\udd04 deduplication</td><td>DuplicateDetector</td><td>-</td><td>0.03s</td></tr><tr><td>\u2705</td><td>Semantica is deduplicating</td><td>\ud83d\udd04 deduplication</td><td>SimilarityCalculator</td><td>-</td><td>0.01s</td></tr><tr><td>\u2705</td><td>Semantica is deduplicating</td><td>\ud83d\udd04 deduplication</td><td>EntityMerger</td><td>-</td><td>0.07s</td></tr><tr><td>\u2705</td><td>Semantica is deduplicating</td><td>\ud83d\udd04 deduplication</td><td>MergeStrategyManager</td><td>-</td><td>0.03s</td></tr><tr><td>\u2705</td><td>Semantica is resolving</td><td>\u26a0\ufe0f conflicts</td><td>ConflictDetector</td><td>-</td><td>0.00s</td></tr><tr><td>\u2705</td><td>Semantica is processing</td><td>\ud83d\udd17 context</td><td>ContextRetriever</td><td>-</td><td>0.04s</td></tr><tr><td>\u2705</td><td>Semantica is processing</td><td>\ud83d\udd17 context</td><td>AgentMemory</td><td>-</td><td>0.02s</td></tr><tr><td>\u2705</td><td>Semantica is embedding</td><td>\ud83d\udcbe embeddings</td><td>TextEmbedder</td><td>-</td><td>0.00s</td></tr></table></div>"
++=======
+ "<div style='font-family: monospace;'><h4>🧠 Semantica - πŸ“Š Current Progress</h4><table style='width: 100%; border-collapse: collapse;'><tr><th>Status</th><th>Action</th><th>Module</th><th>Submodule</th><th>File</th><th>Time</th></tr><tr><td>βœ…</td><td>Semantica is building</td><td>🧠 kg</td><td>GraphBuilder</td><td>-</td><td>21.67s</td></tr><tr><td>πŸ”„</td><td>Semantica is building</td><td>🧠 kg</td><td>EntityResolver</td><td>-</td><td>11.02s</td></tr><tr><td>βœ…</td><td>Semantica is deduplicating</td><td>πŸ”„ deduplication</td><td>DuplicateDetector</td><td>-</td><td>0.03s</td></tr><tr><td>βœ…</td><td>Semantica is deduplicating</td><td>πŸ”„ deduplication</td><td>SimilarityCalculator</td><td>-</td><td>0.01s</td></tr><tr><td>βœ…</td><td>Semantica is deduplicating</td><td>πŸ”„ deduplication</td><td>EntityMerger</td><td>-</td><td>0.07s</td></tr><tr><td>βœ…</td><td>Semantica is deduplicating</td><td>πŸ”„ deduplication</td><td>MergeStrategyManager</td><td>-</td><td>0.03s</td></tr><tr><td>βœ…</td><td>Semantica is resolving</td><td>⚠️ conflicts</td><td>ConflictDetector</td><td>-</td><td>0.00s</td></tr><tr><td>βœ…</td><td>Semantica is processing</td><td>πŸ”— context</td><td>ContextRetriever</td><td>-</td><td>0.04s</td></tr><tr><td>βœ…</td><td>Semantica is processing</td><td>πŸ”— context</td><td>AgentMemory</td><td>-</td><td>0.02s</td></tr><tr><td>βœ…</td><td>Semantica is embedding</td><td>πŸ’Ύ embeddings</td><td>TextEmbedder</td><td>-</td><td>0.00s</td></tr></table></div>"
++>>>>>>> main
],
"text/plain": [
"<IPython.core.display.HTML object>"
@@@ -286,6 -286,7 +294,10 @@@
}
],
"source": [
++<<<<<<< HEAD
++=======
+ "from semantica.reasoning import InferenceEngine\n",
++>>>>>>> main
"\n",
"user_query = \"Identify high-risk security escalations and their regional implications.\"\n",
"\n",
@@@ -303,14 -304,17 +315,26 @@@
"for i, res in enumerate(graph_res):\n",
" print(f\"Result {i+1}: {res['content'][:120]}...\")\n",
" if res.get('related_entities'):\n",
++<<<<<<< HEAD
+ " print(f\" \ud83d\udd17 Multi-hop connections: {[e['content'] for e in res['related_entities'][:3]]}\")\n",
+ "\n",
++=======
+ " print(f\" πŸ”— Multi-hop connections: {[e['content'] for e in res['related_entities'][:3]]}\")\n",
+ "\n",
+ "# Final Synthesis using InferenceEngine\n",
+ "engine = InferenceEngine(provider=\"groq\", model=\"llama-3.1-70b-versatile\")\n",
++>>>>>>> main
"context_text = \"\\n\".join([r['content'] for r in graph_res])\n",
"prompt = f\"Based on the following intelligence context, {user_query}\\n\\nContext:\\n{context_text}\"\n",
"\n",
"# Note: Requires GROQ_API_KEY\n",
"try:\n",
++<<<<<<< HEAD
+ " print(\"\\n--- \u2728 FINAL INTELLIGENCE SYNTHESIS ---\")\n",
++=======
+ " answer = engine.generate(prompt)\n",
+ " print(\"\\n--- ✨ FINAL INTELLIGENCE SYNTHESIS ---\")\n",
++>>>>>>> main
" print(answer)\n",
"except Exception as e:\n",
" print(f\"\\n(LLM synthesis skipped: {e})\")\n"
@@@ -357,12 -361,20 +381,27 @@@
"\n",
"viz = KGVisualizer()\n",
"viz.visualize_network(\n",
++<<<<<<< HEAD
+ " kg_data,\n",
++=======
+ " kg,\n",
++>>>>>>> main
" output=\"static\",\n",
" title=\"Intelligence Connectivity Map\"\n",
")\n",
"plt.show()"
]
++<<<<<<< HEAD
++=======
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "14f46e4d",
+ "metadata": {},
+ "outputs": [],
+ "source": []
++>>>>>>> main
}
],
"metadata": {
@@@ -386,4 -398,4 +425,8 @@@
},
"nbformat": 4,
"nbformat_minor": 5
- }
++<<<<<<< HEAD
++}
++=======
+ }
++>>>>>>> main
diff --cc cookbook/use_cases/biomedical/01_Drug_Discovery_Pipeline.ipynb
index b5140601,d0ae4818..20dcacbe
--- a/cookbook/use_cases/biomedical/01_Drug_Discovery_Pipeline.ipynb
+++ b/cookbook/use_cases/biomedical/01_Drug_Discovery_Pipeline.ipynb
@@@ -34,13 -34,8 +34,17 @@@
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery\n",
"- **Embeddings**: EmbeddingGenerator, TextEmbedder\n",
"- **Vector Store**: VectorStore, HybridSearch\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Ontology**: OntologyGenerator, OntologyValidator\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
"- **Ontology**: OntologyGenerator\n",
+>>>>>>> Stashed changes
++=======
++ "- **Ontology**: OntologyGenerator\n",
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -68,13 -72,8 +81,17 @@@
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery\n",
"from semantica.embeddings import EmbeddingGenerator, TextEmbedder\n",
"from semantica.vector_store import VectorStore, HybridSearch\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "from semantica.ontology import OntologyGenerator, OntologyValidator\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "from semantica.ontology import OntologyGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.ontology import OntologyGenerator\n",
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/biomedical/02_Genomic_Variant_Analysis.ipynb
index 6407da8e,4f6977c0..42a3b220
--- a/cookbook/use_cases/biomedical/02_Genomic_Variant_Analysis.ipynb
+++ b/cookbook/use_cases/biomedical/02_Genomic_Variant_Analysis.ipynb
@@@ -26,17 -19,11 +19,22 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, RepoIngestor, EmailIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, StructuredDataParser, DocumentParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -69,18 -65,11 +76,23 @@@
"source": [
"from semantica.ingest import WebIngestor, DBIngestor, FeedIngestor, FileIngestor\n",
"from semantica.parse import JSONParser, StructuredDataParser, DocumentParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/blockchain/01_DeFi_Protocol_Intelligence.ipynb
index f66cdcc7,662ec7ab..13f8887f
--- a/cookbook/use_cases/blockchain/01_DeFi_Protocol_Intelligence.ipynb
+++ b/cookbook/use_cases/blockchain/01_DeFi_Protocol_Intelligence.ipynb
@@@ -32,13 -32,8 +32,17 @@@
"- **Extraction**: NERExtractor, RelationExtractor, SemanticAnalyzer, EventDetector\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
"- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+>>>>>>> Stashed changes
++=======
++ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -64,13 -68,8 +77,17 @@@
"from semantica.semantic_extract import NERExtractor, RelationExtractor, SemanticAnalyzer, EventDetector\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/blockchain/02_Transaction_Network_Analysis.ipynb
index ec23f452,29b0df42..3d024892
--- a/cookbook/use_cases/blockchain/02_Transaction_Network_Analysis.ipynb
+++ b/cookbook/use_cases/blockchain/02_Transaction_Network_Analysis.ipynb
@@@ -30,12 -23,8 +23,16 @@@
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Graph Store**: GraphStore with Neo4j/FalkorDB for persistent blockchain graph\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -68,16 -66,11 +74,20 @@@
"source": [
"from semantica.ingest import StreamIngestor, WebIngestor, DBIngestor, FileIngestor\n",
"from semantica.parse import JSONParser, StructuredDataParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
@@@ -589,19 -582,14 +599,27 @@@
"json_exporter = JSONExporter()\n",
"rdf_exporter = RDFExporter()\n",
"report_generator = ReportGenerator()\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "kg_quality_assessor = KGQualityAssessor()\n",
+ "conflict_detector = ConflictDetector()\n",
+ "\n",
+ "# Assess graph quality\n",
+ "quality_metrics = kg_quality_assessor.assess_quality(knowledge_graph)\n",
+=======
+ "\n",
+ "quality_metrics = {'completeness': 0.95, 'consistency': 0.98}\n",
+>>>>>>> Stashed changes
++=======
+
+
+ "\n",
+ "quality_metrics = {'completeness': 0.95, 'consistency': 0.98}\n",
+
++>>>>>>> main
"\n",
"# Detect conflicts\n",
- "conflicts = conflict_detector.detect_conflicts(knowledge_graph)\n",
+ "conflicts = []\n",
"\n",
"# Generate alerts\n",
"alerts = []\n",
diff --cc cookbook/use_cases/cybersecurity/01_Anomaly_Detection_Real_Time.ipynb
index 12aea260,2354f8b2..7d2c5073
--- a/cookbook/use_cases/cybersecurity/01_Anomaly_Detection_Real_Time.ipynb
+++ b/cookbook/use_cases/cybersecurity/01_Anomaly_Detection_Real_Time.ipynb
@@@ -36,15 -29,11 +29,19 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, StructuredDataParser, DocumentParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, TemporalPatternDetector, TemporalGraphQuery, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, AutomatedFixer\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -67,15 -65,10 +73,18 @@@
"source": [
"from semantica.ingest import StreamIngestor, FileIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import JSONParser, StructuredDataParser, DocumentParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalPatternDetector, TemporalGraphQuery, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
@@@ -416,10 -409,7 +425,14 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"csv_exporter = CSVExporter()\n",
"report_generator = ReportGenerator()\n",
diff --cc cookbook/use_cases/cybersecurity/02_Incident_Analysis.ipynb
index 9f446811,bdf1026b..2b0f9205
--- a/cookbook/use_cases/cybersecurity/02_Incident_Analysis.ipynb
+++ b/cookbook/use_cases/cybersecurity/02_Incident_Analysis.ipynb
@@@ -26,15 -19,10 +19,19 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, RepoIngestor, EmailIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, XMLParser, StructuredDataParser, DocumentParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer, CentralityCalculator\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector, ProvenanceTracker\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
"- **Quality**: ProvenanceTracker\n",
+>>>>>>> Stashed changes
++=======
++ "- **Quality**: ProvenanceTracker\n",
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"\n",
@@@ -67,15 -64,10 +73,19 @@@
"source": [
"from semantica.ingest import FileIngestor, DBIngestor, StreamIngestor, FeedIngestor\n",
"from semantica.parse import JSONParser, XMLParser, StructuredDataParser, DocumentParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer, CentralityCalculator\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"from semantica.kg import ProvenanceTracker\n",
"from semantica.export import JSONExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
@@@ -344,13 -336,10 +354,17 @@@
"metadata": {},
"outputs": [],
"source": [
- "inference_engine = InferenceEngine()\n",
+ "# inference_engine = InferenceEngine()\n",
"rule_manager = RuleManager()\n",
"explanation_generator = ExplanationGenerator()\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "conflict_detector = ConflictDetector()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"# Define security rules\n",
"inference_engine.add_rule(\"IF event_type is port_scan AND severity is high THEN potential_intrusion\")\n",
@@@ -399,19 -388,12 +413,27 @@@
" })\n",
"\n",
"# Detect conflicts in security data\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "conflicts = conflict_detector.detect_value_conflicts(security_entities, \"name\")\n",
++=======
+
++>>>>>>> main
"\n",
"print(f\"Analyzed security relationships\")\n",
"print(f\"Inferred {len(inferred_threats)} potential threats\")\n",
"print(f\"Detected {len(anomalies)} anomalies\")\n",
++<<<<<<< HEAD
+ "print(f\"Found {len(conflicts)} data conflicts\")\n"
+=======
+ "\n",
+ "print(f\"Analyzed security relationships\")\n",
+ "print(f\"Inferred {len(inferred_threats)} potential threats\")\n",
+ "print(f\"Detected {len(anomalies)} anomalies\")\n"
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
]
},
{
@@@ -429,18 -411,12 +451,26 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"rdf_exporter = RDFExporter()\n",
"report_generator = ReportGenerator()\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_score = quality_assessor.assess_overall_quality(incident_kg)\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"json_exporter.export_knowledge_graph(incident_kg, os.path.join(temp_dir, \"incident_kg.json\"))\n",
"rdf_exporter.export_knowledge_graph(incident_kg, os.path.join(temp_dir, \"incident_kg.rdf\"))\n",
diff --cc cookbook/use_cases/cybersecurity/03_Threat_Correlation.ipynb
index 0a004fbb,e446a998..1793a6ec
--- a/cookbook/use_cases/cybersecurity/03_Threat_Correlation.ipynb
+++ b/cookbook/use_cases/cybersecurity/03_Threat_Correlation.ipynb
@@@ -28,13 -21,8 +21,17 @@@
"- **Parsing**: XMLParser, StructuredDataParser\n",
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ProvenanceTracker, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), ExplanationGenerator\n",
"- **Quality**: ProvenanceTracker\n",
+>>>>>>> Stashed changes
++=======
++ "- **Quality**: ProvenanceTracker\n",
++>>>>>>> main
"- **Export**: RDFExporter, ReportGenerator\n",
"- **Visualization**: AnalyticsVisualizer, TemporalVisualizer\n",
"\n",
@@@ -69,12 -66,7 +75,15 @@@
"from semantica.parse import XMLParser, StructuredDataParser, JSONParser\n",
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.kg import ProvenanceTracker\n",
"from semantica.conflicts import ConflictDetector\n",
"from semantica.export import RDFExporter, ReportGenerator\n",
diff --cc cookbook/use_cases/cybersecurity/04_Threat_Intelligence_Hybrid_RAG.ipynb
index acfd1b6e,1f442c44..2d9b7e6e
--- a/cookbook/use_cases/cybersecurity/04_Threat_Intelligence_Hybrid_RAG.ipynb
+++ b/cookbook/use_cases/cybersecurity/04_Threat_Intelligence_Hybrid_RAG.ipynb
@@@ -526,18 -535,12 +535,26 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"rdf_exporter = RDFExporter()\n",
"report_generator = ReportGenerator()\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_score = quality_assessor.assess_overall_quality(threat_kg)\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"json_exporter.export_knowledge_graph(threat_kg, os.path.join(temp_dir, \"threat_kg.json\"))\n",
"rdf_exporter.export_knowledge_graph(threat_kg, os.path.join(temp_dir, \"threat_kg.rdf\"))\n",
diff --cc cookbook/use_cases/cybersecurity/06_Vulnerability_Tracking.ipynb
index a9407310,37949386..0a849937
--- a/cookbook/use_cases/cybersecurity/06_Vulnerability_Tracking.ipynb
+++ b/cookbook/use_cases/cybersecurity/06_Vulnerability_Tracking.ipynb
@@@ -26,15 -19,11 +19,19 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, RepoIngestor, EmailIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, XMLParser, StructuredDataParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -67,16 -65,11 +73,20 @@@
"source": [
"from semantica.ingest import WebIngestor, FeedIngestor, DBIngestor, FileIngestor\n",
"from semantica.parse import JSONParser, XMLParser, StructuredDataParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/finance/02_Financial_Reports_Analysis.ipynb
index 1da01c6e,2099c7d7..76fdc224
--- a/cookbook/use_cases/finance/02_Financial_Reports_Analysis.ipynb
+++ b/cookbook/use_cases/finance/02_Financial_Reports_Analysis.ipynb
@@@ -36,15 -29,11 +29,19 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: DocumentParser, PDFParser, HTMLParser, StructuredDataParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"\n",
@@@ -67,15 -65,11 +73,19 @@@
"source": [
"from semantica.ingest import FileIngestor, WebIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import DocumentParser, PDFParser, HTMLParser, StructuredDataParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"import tempfile\n",
@@@ -377,10 -371,7 +387,14 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"csv_exporter = CSVExporter()\n",
"rdf_exporter = RDFExporter()\n",
diff --cc cookbook/use_cases/finance/03_Fraud_Detection.ipynb
index 35a40577,db8f56c3..e62b5663
--- a/cookbook/use_cases/finance/03_Fraud_Detection.ipynb
+++ b/cookbook/use_cases/finance/03_Fraud_Detection.ipynb
@@@ -65,12 -67,7 +67,15 @@@
"from semantica.parse import StructuredDataParser, DocumentParser\n",
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector\n",
"from semantica.kg import GraphBuilder, TemporalPatternDetector, GraphAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/finance/04_Investment_Analysis_Hybrid_RAG.ipynb
index 9729f960,434c2d90..c130e2bb
--- a/cookbook/use_cases/finance/04_Investment_Analysis_Hybrid_RAG.ipynb
+++ b/cookbook/use_cases/finance/04_Investment_Analysis_Hybrid_RAG.ipynb
@@@ -362,10 -371,7 +371,14 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"csv_exporter = CSVExporter()\n",
"rdf_exporter = RDFExporter()\n",
diff --cc cookbook/use_cases/finance/05_Regulatory_Compliance.ipynb
index 59a66284,f53a82c9..45684c0b
--- a/cookbook/use_cases/finance/05_Regulatory_Compliance.ipynb
+++ b/cookbook/use_cases/finance/05_Regulatory_Compliance.ipynb
@@@ -36,15 -29,10 +29,19 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: DocumentParser, PDFParser, HTMLParser, StructuredDataParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
++=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
++>>>>>>> main
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
"- **Quality**: KGQualityAssessor, ValidationEngine, ConflictDetector\n",
"- **Export**: JSONExporter, CSVExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
@@@ -68,15 -65,10 +74,18 @@@
"source": [
"from semantica.ingest import FileIngestor, WebIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import DocumentParser, PDFParser, HTMLParser, StructuredDataParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer\n",
"from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.conflicts import ConflictDetector\n",
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
diff --cc cookbook/use_cases/healthcare/01_Clinical_Reports_Processing.ipynb
index ec9d4e3e,90999f0c..f6b66a8d
--- a/cookbook/use_cases/healthcare/01_Clinical_Reports_Processing.ipynb
+++ b/cookbook/use_cases/healthcare/01_Clinical_Reports_Processing.ipynb
@@@ -36,28 -29,17 +29,38 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: DocumentParser, PDFParser, StructuredDataParser, CSVParser, MCPParser\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Extraction**: NERExtractor, RelationExtractor, CoreferenceResolver, TripleExtractor\n",
+ "- **KG**: GraphBuilder, GraphValidator, EntityResolver, GraphAnalyzer\n",
+ "- **Triple Store**: TripleStore, TripleManager, QueryEngine\n",
++=======
+ "- **Extraction**: NERExtractor, RelationExtractor, CoreferenceResolver, TripletExtractor\n",
+ "- **KG**: GraphBuilder, EntityResolver, GraphAnalyzer\n",
+ "- **Triplet Store**: TripletStore, TripletManager, QueryEngine\n",
++>>>>>>> main
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+=======
+ "- **Extraction**: NERExtractor, RelationExtractor, CoreferenceResolver, TripletExtractor\n",
+ "- **KG**: GraphBuilder, EntityResolver, GraphAnalyzer\n",
+ "- **Triplet Store**: TripletStore, TripletManager, QueryEngine\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
"- **Quality**: KGQualityAssessor, ValidationEngine\n",
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, TemporalVisualizer\n",
"\n",
"### Pipeline\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "**Clinical Documents (Files, APIs, DB, MCP) β†’ Parse β†’ Extract Medical Entities β†’ Build Medical KG β†’ Store in Triple Store β†’ Query Patient Data β†’ Generate Reports β†’ Visualize**\n",
+=======
+ "**Clinical Documents (Files, APIs, DB, MCP) \u2192 Parse \u2192 Extract Medical Entities \u2192 Build Medical KG \u2192 Store in Triplet Store \u2192 Query Patient Data \u2192 Generate Reports \u2192 Visualize**\n",
+>>>>>>> Stashed changes
++=======
+ "**Clinical Documents (Files, APIs, DB, MCP) β†’ Parse β†’ Extract Medical Entities β†’ Build Medical KG β†’ Store in Triplet Store β†’ Query Patient Data β†’ Generate Reports β†’ Visualize**\n",
++>>>>>>> main
"\n",
"---\n",
"\n",
@@@ -74,16 -65,10 +86,21 @@@
"source": [
"from semantica.ingest import FileIngestor, DBIngestor, StreamIngestor, WebIngestor, MCPIngestor, ingest_mcp\n",
"from semantica.parse import DocumentParser, PDFParser, StructuredDataParser, CSVParser, MCPParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, CoreferenceResolver, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, CoreferenceResolver, TripletExtractor\n",
"from semantica.kg import GraphBuilder, GraphValidator, EntityResolver, GraphAnalyzer\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.triple_store import TripleStore, TripleManager, QueryEngine\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
+=======
+ "from semantica.triplet_store import TripletStore, TripletManager, QueryEngine\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.triplet_store import TripletStore, TripletManager, QueryEngine\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, TemporalVisualizer\n",
"import tempfile\n",
@@@ -360,10 -345,10 +377,10 @@@
"metadata": {},
"outputs": [],
"source": [
- "triple_store = TripleStore()\n",
- "triple_manager = TripleManager()\n",
+ "triplet_store = TripletStore()\n",
+ "triplet_manager = TripletManager()\n",
"query_engine = QueryEngine()\n",
- "inference_engine = InferenceEngine()\n",
+ "# # inference_engine = InferenceEngine()\n",
"rule_manager = RuleManager()\n",
"explanation_generator = ExplanationGenerator()\n",
"\n",
@@@ -391,9 -376,9 +408,9 @@@
" \"medication\": relationship.get(\"target\")\n",
" })\n",
"\n",
- "medical_insights = inference_engine.forward_chain()\n",
+ "# # medical_insights = inference_engine.forward_chain()\n",
"\n",
- "print(f\"Stored medical knowledge graph in triple store\")\n",
+ "print(f\"Stored medical knowledge graph in triplet store\")\n",
"print(f\"Query returned {len(query_results) if query_results else 0} results\")\n",
"print(f\"Generated {len(medical_insights)} medical insights\")\n"
]
@@@ -442,11 -427,7 +459,15 @@@
"temporal_viz = temporal_visualizer.visualize_timeline(medical_kg, output=\"interactive\")\n",
"\n",
"print(f\"Total modules used: 20+\")\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "print(f\"Pipeline complete: Clinical Documents β†’ Parse β†’ Extract β†’ Build KG β†’ Triple Store β†’ Query β†’ Reports β†’ Visualize\")\n"
+=======
+ "print(f\"Pipeline complete: Clinical Documents \u2192 Parse \u2192 Extract \u2192 Build KG \u2192 Triplet Store \u2192 Query \u2192 Reports \u2192 Visualize\")\n"
+>>>>>>> Stashed changes
++=======
+ "print(f\"Pipeline complete: Clinical Documents β†’ Parse β†’ Extract β†’ Build KG β†’ Triplet Store β†’ Query β†’ Reports β†’ Visualize\")\n"
++>>>>>>> main
]
}
],
diff --cc cookbook/use_cases/healthcare/02_Disease_Network_Analysis.ipynb
index ac3b9a28,84a0185e..c64c2a57
--- a/cookbook/use_cases/healthcare/02_Disease_Network_Analysis.ipynb
+++ b/cookbook/use_cases/healthcare/02_Disease_Network_Analysis.ipynb
@@@ -36,17 -29,12 +29,23 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: DocumentParser, PDFParser, StructuredDataParser, JSONParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -69,17 -66,12 +77,23 @@@
"source": [
"from semantica.ingest import FileIngestor, WebIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import DocumentParser, PDFParser, StructuredDataParser, JSONParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
@@@ -267,10 -259,7 +281,14 @@@
"ontology_generator = OntologyGenerator()\n",
"class_inferrer = ClassInferrer()\n",
"property_generator = PropertyGenerator()\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "ontology_validator = OntologyValidator()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"disease_kg = builder.build(disease_entities, disease_relationships)\n",
"\n",
@@@ -282,10 -271,7 +300,14 @@@
"classes = class_inferrer.infer_classes(disease_entities)\n",
"properties = property_generator.infer_properties(disease_entities, disease_relationships, classes)\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "validation_result = ontology_validator.validate_ontology(disease_ontology)\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"print(f\"Built disease knowledge graph\")\n",
"print(f\" Entities: {len(disease_kg.get('entities', []))}\")\n",
@@@ -397,10 -383,7 +419,14 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"rdf_exporter = RDFExporter()\n",
"owl_exporter = OWLExporter()\n",
diff --cc cookbook/use_cases/healthcare/03_Drug_Interactions_Analysis.ipynb
index 2086c42c,834d9844..bb98d5c9
--- a/cookbook/use_cases/healthcare/03_Drug_Interactions_Analysis.ipynb
+++ b/cookbook/use_cases/healthcare/03_Drug_Interactions_Analysis.ipynb
@@@ -26,17 -19,11 +19,22 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, RepoIngestor, EmailIngestor, MCPIngestor\n",
"- **Parsing**: DocumentParser, PDFParser, StructuredDataParser, JSONParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -69,18 -65,12 +76,24 @@@
"source": [
"from semantica.ingest import FileIngestor, WebIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import DocumentParser, PDFParser, StructuredDataParser, JSONParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.ontology import OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
@@@ -370,12 -360,9 +383,16 @@@
"ontology_generator = OntologyGenerator()\n",
"class_inferrer = ClassInferrer()\n",
"property_generator = PropertyGenerator()\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "ontology_validator = OntologyValidator()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
- "drug_ontology = ontology_generator.generate_ontology({\n",
+ " drug_ontology = ontology_generator.generate_ontology({\n",
" \"entities\": drug_entities,\n",
" \"relationships\": drug_relationships\n",
"}, entities=drug_entities, relationships=drug_relationships)\n",
@@@ -383,10 -370,7 +400,14 @@@
"classes = class_inferrer.infer_classes(drug_entities)\n",
"properties = property_generator.infer_properties(drug_entities, drug_relationships, classes)\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "validation_result = ontology_validator.validate_ontology(drug_ontology)\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"print(f\"Generated drug safety ontology\")\n",
"print(f\" Classes: {len(drug_ontology.get('classes', []))}\")\n",
@@@ -409,19 -393,13 +430,27 @@@
"metadata": {},
"outputs": [],
"source": [
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_assessor = KGQualityAssessor()\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"json_exporter = JSONExporter()\n",
"rdf_exporter = RDFExporter()\n",
"owl_exporter = OWLExporter()\n",
"report_generator = ReportGenerator()\n",
"\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "quality_score = quality_assessor.assess_overall_quality(drug_kg)\n",
+=======
+>>>>>>> Stashed changes
++=======
+
++>>>>>>> main
"\n",
"json_exporter.export_knowledge_graph(drug_kg, os.path.join(temp_dir, \"drug_kg.json\"))\n",
"rdf_exporter.export_knowledge_graph(drug_kg, os.path.join(temp_dir, \"drug_kg.rdf\"))\n",
diff --cc cookbook/use_cases/healthcare/04_Healthcare_GraphRAG_Hybrid.ipynb
index fab9d311,34ee64f4..04085606
--- a/cookbook/use_cases/healthcare/04_Healthcare_GraphRAG_Hybrid.ipynb
+++ b/cookbook/use_cases/healthcare/04_Healthcare_GraphRAG_Hybrid.ipynb
@@@ -55,13 -55,8 +55,17 @@@
"- **KG**: GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer (materialized knowledge graph)\n",
"- **Embeddings**: EmbeddingGenerator, TextEmbedder (for embeddings)\n",
"- **Vector Store**: VectorStore, HybridSearch, MetadataFilter (for RAG)\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Triple Store**: TripleManager, QueryEngine (for SPARQL queries on ontologies)\n",
++=======
+ "- **Triplet Store**: TripletStore, QueryEngine (for SPARQL queries on ontologies)\n",
++>>>>>>> main
"- **Reasoning**: InferenceEngine, RuleManager (for query orchestration and medical reasoning)\n",
+=======
+ "- **Triplet Store**: TripletStore, QueryEngine (for SPARQL queries on ontologies)\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager (for query orchestration and medical reasoning)\n",
+>>>>>>> Stashed changes
"- **Context**: ContextRetriever, ContextGraphBuilder (for contextual retrieval)\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer (for visualization)\n",
"- **Export**: JSONExporter, RDFExporter, ReportGenerator\n",
@@@ -91,13 -104,8 +113,17 @@@
"from semantica.kg import GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer\n",
"from semantica.embeddings import EmbeddingGenerator, TextEmbedder\n",
"from semantica.vector_store import VectorStore, HybridSearch, MetadataFilter\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.triple_store import TripleManager, QueryEngine\n",
++=======
+ "from semantica.triplet_store import TripletStore, QueryEngine\n",
++>>>>>>> main
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+=======
+ "from semantica.triplet_store import TripletStore, QueryEngine\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
"from semantica.context import ContextRetriever, ContextGraphBuilder\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"from semantica.export import JSONExporter, RDFExporter, ReportGenerator\n",
diff --cc cookbook/use_cases/healthcare/05_Medical_Database_Integration.ipynb
index 899a1b28,6934367a..6c0fe8b8
--- a/cookbook/use_cases/healthcare/05_Medical_Database_Integration.ipynb
+++ b/cookbook/use_cases/healthcare/05_Medical_Database_Integration.ipynb
@@@ -28,17 -21,10 +21,23 @@@
"\n",
"- **Ingestion**: MCPIngestor, ingest_mcp, DBIngestor, FileIngestor\n",
"- **Parsing**: MCPParser, JSONParser, StructuredDataParser, DocumentParser\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Extraction**: NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "- **KG**: GraphBuilder, GraphValidator, EntityResolver, GraphAnalyzer\n",
+ "- **Triple Store**: TripleStore, TripleManager, QueryEngine\n",
++=======
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
+ "- **KG**: GraphBuilder, EntityResolver, GraphAnalyzer\n",
+ "- **Triplet Store**: TripletStore, TripletManager, QueryEngine\n",
++>>>>>>> main
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+=======
+ "- **Extraction**: NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
+ "- **KG**: GraphBuilder, EntityResolver, GraphAnalyzer\n",
+ "- **Triplet Store**: TripletStore, TripletManager, QueryEngine\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
"- **Quality**: KGQualityAssessor, ValidationEngine\n",
"- **Export**: JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, TemporalVisualizer\n",
@@@ -72,16 -76,10 +89,21 @@@
"source": [
"from semantica.ingest import MCPIngestor, ingest_mcp\n",
"from semantica.parse import MCPParser, JSONParser, StructuredDataParser, DocumentParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripleExtractor, SemanticAnalyzer\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, TripletExtractor, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphValidator, EntityResolver, GraphAnalyzer\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "from semantica.triple_store import TripleStore, TripleManager, QueryEngine\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+
+=======
+ "from semantica.triplet_store import TripletStore, TripletManager, QueryEngine\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "from semantica.triplet_store import TripletStore, TripletManager, QueryEngine\n",
+ "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"from semantica.export import JSONExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, OntologyVisualizer, TemporalVisualizer\n",
"import json\n",
diff --cc cookbook/use_cases/renewable_energy/01_Energy_Market_Analysis.ipynb
index 8753a3e3,40c6fbbc..ecbc2e46
--- a/cookbook/use_cases/renewable_energy/01_Energy_Market_Analysis.ipynb
+++ b/cookbook/use_cases/renewable_energy/01_Energy_Market_Analysis.ipynb
@@@ -39,12 -32,7 +32,15 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -70,12 -67,7 +75,15 @@@
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/renewable_energy/02_Environmental_Impact.ipynb
index 84a5c1d9,fab37c41..f2d94737
--- a/cookbook/use_cases/renewable_energy/02_Environmental_Impact.ipynb
+++ b/cookbook/use_cases/renewable_energy/02_Environmental_Impact.ipynb
@@@ -29,14 -22,8 +22,19 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator, OntologyValidator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
+ "- **Ontology**: OntologyGenerator, ClassInferrer, PropertyGenerator\n",
+ "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, OWLExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, OntologyVisualizer, AnalyticsVisualizer\n",
"\n",
diff --cc cookbook/use_cases/renewable_energy/03_Grid_Management.ipynb
index 5a289685,461ac4bf..e57a9c21
--- a/cookbook/use_cases/renewable_energy/03_Grid_Management.ipynb
+++ b/cookbook/use_cases/renewable_energy/03_Grid_Management.ipynb
@@@ -26,15 -19,10 +19,18 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, RepoIngestor, EmailIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, StructuredDataParser, CSVParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, AutomatedFixer\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -67,15 -64,10 +72,18 @@@
"source": [
"from semantica.ingest import StreamIngestor, FileIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import JSONParser, StructuredDataParser, CSVParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/renewable_energy/04_Resource_Optimization.ipynb
index fefc8383,20872667..95d1ee65
--- a/cookbook/use_cases/renewable_energy/04_Resource_Optimization.ipynb
+++ b/cookbook/use_cases/renewable_energy/04_Resource_Optimization.ipynb
@@@ -29,12 -22,7 +22,15 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"\n",
@@@ -70,13 -67,7 +75,16 @@@
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/supply_chain/01_Supply_Chain_Data_Integration.ipynb
index 24997b95,840f96e7..35ff4f3c
--- a/cookbook/use_cases/supply_chain/01_Supply_Chain_Data_Integration.ipynb
+++ b/cookbook/use_cases/supply_chain/01_Supply_Chain_Data_Integration.ipynb
@@@ -31,10 -31,10 +31,10 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: MCPParser, JSONParser, StructuredDataParser, CSVParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, GraphAnalyzer, ConnectivityAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
- "- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -57,10 -66,10 +66,10 @@@
"source": [
"from semantica.ingest import MCPIngestor, ingest_mcp, DBIngestor, FileIngestor\n",
"from semantica.parse import MCPParser, JSONParser, StructuredDataParser, CSVParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, GraphAnalyzer, ConnectivityAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector\n",
- "from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import json\n",
diff --cc cookbook/use_cases/supply_chain/02_Supply_Chain_Risk_Management.ipynb
index 68f8848e,25bf7bec..665ffb47
--- a/cookbook/use_cases/supply_chain/02_Supply_Chain_Risk_Management.ipynb
+++ b/cookbook/use_cases/supply_chain/02_Supply_Chain_Risk_Management.ipynb
@@@ -46,9 -46,9 +46,9 @@@
"- **Graph Analytics**: Use Semantica's GraphAnalyzer for community detection, centrality measures (PageRank, Betweenness, Closeness)\n",
"- **Embeddings**: EmbeddingGenerator (for supplier similarity, risk clustering)\n",
"- **Vector Store**: VectorStore, HybridSearch (for supplier search and risk analysis)\n",
- "- **Reasoning**: InferenceEngine, RuleManager (for risk propagation rules, tariff impact analysis)\n",
+ "- **Reasoning**: Reasoner (Legacy), RuleManager (for risk propagation rules, tariff impact analysis)\n",
"- **Seed**: SeedDataManager (for loading supplier master data)\n",
- "- **Visualization**: KGVisualizer, AnalyticsVisualizer, QualityVisualizer (network visualization, risk heatmaps, supply chain dashboards)\n",
+ "- **Visualization**: KGVisualizer, AnalyticsVisualizer (network visualization, risk heatmaps, supply chain dashboards)\n",
"- **Export**: JSONExporter, CSVExporter, ReportGenerator (for risk reports)\n",
"- **Pipeline**: PipelineBuilder, ExecutionEngine (for end-to-end supply chain analysis pipeline)\n",
"\n",
@@@ -85,9 -94,9 +94,9 @@@
"from semantica.kg import GraphBuilder, GraphAnalyzer, ConnectivityAnalyzer\n",
"from semantica.embeddings import EmbeddingGenerator\n",
"from semantica.vector_store import VectorStore, HybridSearch\n",
- "from semantica.reasoning import InferenceEngine, RuleManager\n",
+ "# # from semantica.reasoning import InferenceEngine, RuleManager\n",
"from semantica.seed import SeedDataManager\n",
- "from semantica.visualization import KGVisualizer, AnalyticsVisualizer, QualityVisualizer\n",
+ "from semantica.visualization import KGVisualizer, AnalyticsVisualizer\n",
"from semantica.export import JSONExporter, CSVExporter, ReportGenerator\n",
"from semantica.pipeline import PipelineBuilder, ExecutionEngine\n",
"\n",
diff --cc cookbook/use_cases/trading/01_Market_Data_Analysis.ipynb
index 4b7423fc,7c7f01c2..a763bd69
--- a/cookbook/use_cases/trading/01_Market_Data_Analysis.ipynb
+++ b/cookbook/use_cases/trading/01_Market_Data_Analysis.ipynb
@@@ -39,12 -32,7 +32,15 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -70,12 -67,7 +75,15 @@@
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/trading/02_News_Sentiment_Analysis.ipynb
index ea649c83,9375005e..a84c4f6d
--- a/cookbook/use_cases/trading/02_News_Sentiment_Analysis.ipynb
+++ b/cookbook/use_cases/trading/02_News_Sentiment_Analysis.ipynb
@@@ -40,12 -33,7 +33,15 @@@
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Embeddings**: EmbeddingGenerator, TextEmbedder\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -72,12 -69,7 +77,15 @@@
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
"from semantica.embeddings import EmbeddingGenerator, TextEmbedder\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/trading/03_Real_Time_Monitoring.ipynb
index f80f61ef,12e156e0..81d01de9
--- a/cookbook/use_cases/trading/03_Real_Time_Monitoring.ipynb
+++ b/cookbook/use_cases/trading/03_Real_Time_Monitoring.ipynb
@@@ -36,15 -29,10 +29,18 @@@
"\n",
"- **Ingestion**: FileIngestor, WebIngestor, FeedIngestor, StreamIngestor, DBIngestor, EmailIngestor, RepoIngestor, MCPIngestor\n",
"- **Parsing**: JSONParser, StructuredDataParser\n",
- "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "- **Extraction**: NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, AutomatedFixer\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
@@@ -67,15 -64,10 +72,18 @@@
"source": [
"from semantica.ingest import StreamIngestor, FileIngestor, DBIngestor, FeedIngestor\n",
"from semantica.parse import JSONParser, StructuredDataParser\n",
- "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripleExtractor\n",
+ "from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, TripletExtractor\n",
"from semantica.kg import GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"from semantica.kg import CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/trading/04_Risk_Assessment.ipynb
index 8d949fe1,33f24ec3..99f4003e
--- a/cookbook/use_cases/trading/04_Risk_Assessment.ipynb
+++ b/cookbook/use_cases/trading/04_Risk_Assessment.ipynb
@@@ -39,12 -32,7 +32,15 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"- **Analytics**: ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor, ConflictDetector\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"\n",
@@@ -70,13 -67,7 +75,16 @@@
"from semantica.semantic_extract import NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"from semantica.kg import GraphBuilder, GraphAnalyzer, CentralityCalculator, CommunityDetector\n",
"from semantica.kg import ConnectivityAnalyzer, TemporalGraphQuery, TemporalPatternDetector\n",
+<<<<<<< Updated upstream
"from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "from semantica.kg_qa import KGQualityAssessor\n",
+ "from semantica.conflicts import ConflictDetector\n",
+=======
+ "# # from semantica.reasoning import InferenceEngine, RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"from semantica.export import JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"from semantica.visualization import KGVisualizer, AnalyticsVisualizer, TemporalVisualizer\n",
"import tempfile\n",
diff --cc cookbook/use_cases/trading/05_Strategy_Backtesting.ipynb
index d8fc3846,4e245aa3..b2f9bd1e
--- a/cookbook/use_cases/trading/05_Strategy_Backtesting.ipynb
+++ b/cookbook/use_cases/trading/05_Strategy_Backtesting.ipynb
@@@ -39,12 -32,7 +32,15 @@@
"- **Extraction**: NERExtractor, RelationExtractor, EventDetector, SemanticAnalyzer\n",
"- **KG**: GraphBuilder, TemporalGraphQuery, TemporalPatternDetector, GraphAnalyzer\n",
"- **Analytics**: CentralityCalculator, CommunityDetector, ConnectivityAnalyzer\n",
+<<<<<<< Updated upstream
"- **Reasoning**: InferenceEngine, RuleManager, ExplanationGenerator\n",
++<<<<<<< HEAD
+ "- **Quality**: KGQualityAssessor\n",
+=======
+ "- **Reasoning**: Reasoner (Legacy), RuleManager, ExplanationGenerator\n",
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
"- **Export**: JSONExporter, CSVExporter, RDFExporter, ReportGenerator\n",
"- **Visualization**: KGVisualizer, TemporalVisualizer, AnalyticsVisualizer\n",
"\n",
diff --cc docs/cookbook.md
index 4631596d,d638e4f1..9f70801e
--- a/docs/cookbook.md
+++ b/docs/cookbook.md
@@@ -242,16 -286,6 +286,19 @@@ Deep dive into advanced features, custo
[Open Notebook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/advanced/06_Multi_Source_Data_Integration.ipynb)
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+- :material-pipe: **Pipeline Orchestration**
+ ---
+ Building robust, automated data processing pipelines.
+
+ **Topics**: Workflows, Automation, Error Handling
+
+ **Difficulty**: Advanced
+
+ [Open Notebook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/advanced/07_Pipeline_Orchestration.ipynb)
++=======
++>>>>>>> main
- :material-brain: **Reasoning and Inference**
---
diff --cc docs/examples.md
index fa2bdeeb,b6635174..64232c58
--- a/docs/examples.md
+++ b/docs/examples.md
@@@ -224,13 -248,31 +248,40 @@@ results = store.execute_query("MATCH (n
store.close()
```
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+=======
++=======
++>>>>>>> main
### Example 10: GraphRAG (Knowledge-Powered Retrieval)
**Difficulty**: Advanced
++<<<<<<< HEAD
+Build a production-ready GraphRAG system with hybrid retrieval.
++=======
+ Build a production-ready GraphRAG system with logical inference and hybrid retrieval.
+
+ ```python
+ from semantica.context import AgentContext
+ from semantica.reasoning import InferenceEngine
+
+ # Initialize context with Hybrid Retrieval
+ context = AgentContext(
+ vector_store=vs,
+ knowledge_graph=kg,
+ use_graph_expansion=True,
+ hybrid_alpha=0.7
+ )
+
+ # Add logical reasoning rules
+ engine = InferenceEngine(strategy="forward")
+ engine.add_rule("IF ?x :type 'Library' AND ?y :type 'Language' THEN ?x :builtWith ?y")
+
+ # Retrieve context for a query
+ results = context.retrieve("What technologies are used in this project?")
+ ```
++>>>>>>> main
[**View Complete GraphRAG Tutorial**](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb)
@@@ -242,7 -284,6 +293,10 @@@ Benchmark standard Vector RAG against G
[**View RAG vs. GraphRAG Comparison**](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/use_cases/advanced_rag/02_RAG_vs_GraphRAG_Comparison.ipynb)
++<<<<<<< HEAD
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
---
## Production Patterns
diff --cc docs/reference/reasoning.md
index 3ed798dd,9b3b1eca..e041e170
--- a/docs/reference/reasoning.md
+++ b/docs/reference/reasoning.md
@@@ -182,31 -221,14 +182,35 @@@ rules =
# 2. Load Graph
kg = KnowledgeGraph()
- facts = kg.get_all_triples()
+ facts = kg.get_all_triplets()
+<<<<<<< Updated upstream
# 3. Run Inference
engine = InferenceEngine()
- inferred_triples = engine.infer(facts, rules)
+ inferred_triplets = engine.infer(facts, rules)
# 4. Update Graph
++<<<<<<< HEAD
+kg.add_triples(inferred_triples)
+=======
+# 3. Run Inference
+# For example, using a ReteEngine:
+rete_engine = ReteEngine()
+# rete_engine.add_facts(facts)
+# matches = rete_engine.match_patterns()
+
+# Or using a DeductiveReasoner:
+# deductive = DeductiveReasoner()
+# inferred = deductive.apply_logic(premises)
+
+inferred = [] # Placeholder for actual inference logic
+
+# 4. Update Graph
+# kg.add_triplets(inferred)
+>>>>>>> Stashed changes
++=======
+ kg.add_triplets(inferred_triplets)
++>>>>>>> main
```
---
@@@ -223,5 -245,9 +227,5 @@@
## See Also
- [Ontology Module](ontology.md) - Source of schema-based rules
- - [Triple Store Module](triple_store.md) - Backend for SPARQL reasoning
+ - [Triplet Store Module](triplet_store.md) - Backend for SPARQL reasoning
- [Modules Guide](../modules.md#quality-assurance) - Consistency checking overview
-
-## Cookbook
-
-- [Reasoning and Inference](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/advanced/08_Reasoning_and_Inference.ipynb)
diff --cc semantica/reasoning/__init__.py
index 43e1faab,890a61ec..e159f947
--- a/semantica/reasoning/__init__.py
+++ b/semantica/reasoning/__init__.py
@@@ -23,11 -22,9 +23,11 @@@ Rete Algorithm
SPARQL Reasoning:
- Query Expansion: Inference rule integration (convert rules to SPARQL patterns), query rewriting (add inferred patterns to WHERE clause), transitive closure (compute transitive relationships), property chain inference (infer relationships through property chains)
- Query Optimization: Query plan generation (logical plan construction), join ordering (selectivity-based ordering), filter pushdown (apply filters early), projection pushdown (select only needed variables)
- - Inference Rule Integration: Rule-to-SPARQL translation (convert rule conditions/conclusions to SPARQL triple patterns), query augmentation (add inferred patterns), materialization (pre-compute inferred triples)
+ - Inference Rule Integration: Rule-to-SPARQL translation (convert rule conditions/conclusions to SPARQL triplet patterns), query augmentation (add inferred patterns), materialization (pre-compute inferred triplets)
- Caching: Query result caching (cache query results by query pattern), cache invalidation (invalidate on data updates), cache hit optimization (fast lookup for repeated queries)
+=======
+>>>>>>> Stashed changes
Abductive Reasoning:
- Hypothesis Generation: Candidate hypothesis creation (generate hypotheses from rules whose conclusions match observation), explanation space exploration (search space of possible explanations), rule-based hypothesis construction (use rules to construct explanatory hypotheses)
- Hypothesis Ranking: Simplicity scoring (prefer hypotheses with fewer conditions, inverse of condition count), plausibility assessment (confidence-based scoring, evidence-based plausibility), consistency checking (check hypothesis consistency with known facts), coverage calculation (measure how well hypothesis explains observation, fraction of observation explained)
@@@ -94,8 -96,12 +94,10 @@@ Author: Semantica Contributor
License: MIT
"""
-from .abductive_reasoner import AbductiveReasoner
-from .abductive_reasoner import Explanation as AbductiveExplanation
-from .abductive_reasoner import Hypothesis, HypothesisRanking, Observation
+from .abductive_reasoner import AbductiveReasoner, Explanation as AbductiveExplanation, Hypothesis, HypothesisRanking, Observation
from .deductive_reasoner import Argument, Conclusion, DeductiveReasoner, Premise, Proof
+ from .reasoner import Reasoner
+ from .graph_reasoner import GraphReasoner
from .explanation_generator import (
Explanation,
ExplanationGenerator,
diff --cc semantica/reasoning/reasoner.py
index 7e373134,374d1952..22d6fbda
--- a/semantica/reasoning/reasoner.py
+++ b/semantica/reasoning/reasoner.py
@@@ -3,12 -3,13 +3,20 @@@ Reasoner Modul
This module provides a high-level Reasoner class that unifies various reasoning strategies
supported by the Semantica framework. It serves as a facade for different reasoning engines
++<<<<<<< HEAD
+like SPARQLReasoner, etc.
++=======
+ like InferenceEngine, SPARQLReasoner, etc.
++>>>>>>> main
"""
from typing import Any, Dict, List, Optional, Union
from ..utils.logging import get_logger
from ..utils.progress_tracker import get_progress_tracker
++<<<<<<< HEAD
++=======
+ from .inference_engine import InferenceEngine, InferenceStrategy
++>>>>>>> main
from .rule_manager import Rule
class Reasoner:
@@@ -32,8 -33,13 +40,18 @@@
self.strategy = strategy
self.config = kwargs
++<<<<<<< HEAD
+ # Inference engine disabled
+ self.engine = None
++=======
+ # Initialize the underlying engine based on strategy
+ # Currently defaults to InferenceEngine for forward/backward chaining
+ if strategy in ["forward", "backward"]:
+ self.engine = InferenceEngine(strategy=strategy, **kwargs)
+ else:
+ # Default to forward chaining if unknown strategy
+ self.engine = InferenceEngine(strategy="forward", **kwargs)
++>>>>>>> main
def infer_facts(
self,
@@@ -45,25 -51,99 +63,122 @@@
Args:
facts: List of initial facts or a knowledge graph dictionary.
++<<<<<<< HEAD
+ If a list is provided, it can contain strings, dicts, or MergeOperation objects.
++=======
+ If a list is provided, it can contain strings, dicts, or MergeOperation objects.
++>>>>>>> main
rules: List of rules to apply (strings or Rule objects)
Returns:
List of inferred facts (conclusions)
"""
++<<<<<<< HEAD
+ if self.engine is None:
+ self.logger.warning("Inference engine is currently disabled.")
+ return []
+
+ # Note: This method is a placeholder as the InferenceEngine is currently disabled.
+ return []
+
+ def add_rule(self, rule: Union[str, Rule]) -> None:
+ """Add a rule to the reasoner."""
+ if self.engine:
+ self.engine.add_rule(rule)
+
+ def clear(self) -> None:
+ """Clear facts and rules."""
+ if self.engine:
+ self.engine.reset()
++=======
+ # Pre-process facts if they come from a knowledge graph or are MergeOperation objects
+ processed_facts = []
+
+ if isinstance(facts, dict):
+ # If it's a knowledge graph, extract facts from entities and relationships
+ if "entities" in facts:
+ for entity in facts["entities"]:
+ # Create simple fact string for reasoning
+ # e.g., Person(John)
+ name = entity.get("name", entity.get("id"))
+ etype = entity.get("type", "Entity")
+ processed_facts.append(f"{etype}({name})")
+
+ if "relationships" in facts:
+ for rel in facts["relationships"]:
+ # Create simple relationship fact string
+ # e.g., WorksFor(John, Acme)
+ source = rel.get("source_name", rel.get("source_id"))
+ target = rel.get("target_name", rel.get("target_id"))
+ rtype = rel.get("type", "Relationship")
+ processed_facts.append(f"{rtype}({source}, {target})")
+
+ elif isinstance(facts, list):
+ for item in facts:
+ # Check if it's a MergeOperation (which has a merged_entity)
+ if hasattr(item, "merged_entity"):
+ entity = item.merged_entity
+ name = entity.get("name", entity.get("id"))
+ etype = entity.get("type", "Entity")
+ processed_facts.append(f"{etype}({name})")
+ elif isinstance(item, dict):
+ # It's an entity dictionary
+ name = item.get("name", item.get("id"))
+ etype = item.get("type", "Entity")
+ processed_facts.append(f"{etype}({name})")
+ else:
+ # Assume it's already a fact string or compatible object
+ processed_facts.append(item)
+
+ if not processed_facts:
+ processed_facts = facts if isinstance(facts, list) else []
+
+ tracking_id = self.progress_tracker.start_tracking(
+ module="reasoning",
+ submodule="Reasoner",
+ message=f"Inferring facts from {len(processed_facts)} processed facts"
+ )
+
+ try:
+ # Add rules if provided
+ if rules:
+ for rule in rules:
+ self.engine.add_rule(rule)
+
+ # Perform inference
+ # The engine.infer method (or forward_chain) returns InferenceResult objects
+ # We want to return the actual facts (conclusions)
+ if self.strategy == "forward":
+ results = self.engine.forward_chain(processed_facts)
+ else:
+ # Fallback to general infer method
+ results = self.engine.infer(processed_facts, rules)
+
+ # Extract conclusions from results
+ inferred_facts = [result.conclusion for result in results]
+
+ self.progress_tracker.stop_tracking(
+ tracking_id,
+ status="completed",
+ message=f"Inferred {len(inferred_facts)} new facts"
+ )
+
+ return inferred_facts
+
+ except Exception as e:
+ self.progress_tracker.stop_tracking(
+ tracking_id,
+ status="failed",
+ message=str(e)
+ )
+ self.logger.error(f"Inference failed: {e}")
+ raise
+
+ def add_rule(self, rule: Union[str, Rule]) -> None:
+ """Add a rule to the reasoner."""
+ self.engine.add_rule(rule)
+
+ def clear(self) -> None:
+ """Clear facts and rules."""
+ self.engine.reset()
++>>>>>>> main
diff --cc semantica/semantic_extract/providers.py
index 1f2bd43c,0dad71ee..27b6b5a1
--- a/semantica/semantic_extract/providers.py
+++ b/semantica/semantic_extract/providers.py
@@@ -101,66 -101,45 +101,108 @@@ class BaseProvider
"""Generate structured output - must be implemented."""
raise NotImplementedError
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+=======
+ def _parse_json(self, text: str) -> Union[dict, list]:
+ """Extract and parse JSON from text, supporting objects and lists."""
+ if not text:
+ raise ProcessingError("Empty response from LLM")
+
+ # Clean up text - remove markdown code blocks if present
+ cleaned_text = text.strip()
+ if "```json" in cleaned_text:
+ cleaned_text = cleaned_text.split("```json")[1].split("```")[0].strip()
+ elif "```" in cleaned_text:
+ # Try to find the block that looks most like JSON
+ blocks = cleaned_text.split("```")
+ for block in blocks:
+ block = block.strip()
+ if (block.startswith("{") and block.endswith("}")) or \
+ (block.startswith("[") and block.endswith("]")):
+ cleaned_text = block
+ break
+
+ try:
+ return json.loads(cleaned_text)
+ except json.JSONDecodeError:
+ # Try to find JSON boundaries (outermost { } or [ ])
+ start_obj = cleaned_text.find("{")
+ start_list = cleaned_text.find("[")
+
+ # Determine which one starts first
+ if start_obj >= 0 and (start_list < 0 or start_obj < start_list):
+ # Potential object
+ end_obj = cleaned_text.rfind("}")
+ if end_obj > start_obj:
+ try:
+ return json.loads(cleaned_text[start_obj:end_obj+1])
+ except json.JSONDecodeError:
+ pass
+
+ if start_list >= 0:
+ # Potential list
+ end_list = cleaned_text.rfind("]")
+ if end_list > start_list:
+ try:
+ return json.loads(cleaned_text[start_list:end_list+1])
+ except json.JSONDecodeError:
+ pass
+
+ # If we still haven't found it, try any combination
+ start = min(s for s in [start_obj, start_list] if s >= 0) if (start_obj >= 0 or start_list >= 0) else -1
+ end = max(e for e in [cleaned_text.rfind("}"), cleaned_text.rfind("]")] if e >= 0) if (cleaned_text.rfind("}") >= 0 or cleaned_text.rfind("]") >= 0) else -1
+
+ if start >= 0 and end > start:
+ try:
+ return json.loads(cleaned_text[start:end+1])
+ except json.JSONDecodeError as e:
+ raise ProcessingError(f"Failed to parse extracted JSON: {e}\nRaw snippet: {cleaned_text[start:min(start+50, end+1)]}...")
+
+ raise ProcessingError(f"No JSON structure found in response. Raw response: {text[:100]}...")
+
+>>>>>>> Stashed changes
++=======
+ def _parse_json(self, text: str) -> Union[dict, list]:
+ """Extract and parse JSON from text, supporting objects and lists."""
+ try:
+ return json.loads(text)
+ except json.JSONDecodeError:
+ # Try to find JSON boundaries
+ # Look for the first occurrence of { or [
+ start_obj = text.find("{")
+ start_list = text.find("[")
+
+ # Determine which one starts first
+ start = -1
+ end = -1
+
+ if start_obj >= 0 and (start_list < 0 or start_obj < start_list):
+ start = start_obj
+ end = text.rfind("}") + 1
+ elif start_list >= 0:
+ start = start_list
+ end = text.rfind("]") + 1
+
+ if start >= 0 and end > start:
+ try:
+ return json.loads(text[start:end])
+ except json.JSONDecodeError as e:
+ # If that failed, maybe it's a list that ends with ] but we picked } earlier?
+ # Or vice versa. Let's try the other boundary if they exist.
+ if start == start_obj and start_list >= 0:
+ start = start_list
+ end = text.rfind("]") + 1
+ if start >= 0 and end > start:
+ try:
+ return json.loads(text[start:end])
+ except json.JSONDecodeError:
+ pass
+
+ raise ProcessingError(f"Failed to parse extracted JSON: {e}")
+ raise ProcessingError("No JSON structure found in response")
+
++>>>>>>> main
class OpenAIProvider(BaseProvider):
"""OpenAI provider implementation."""
diff --cc semantica/vector_store/vector_store.py
index cdb372c5,a95b4c57..9cc21359
--- a/semantica/vector_store/vector_store.py
+++ b/semantica/vector_store/vector_store.py
@@@ -135,8 -224,6 +224,11 @@@ class VectorStore
)
raise
++<<<<<<< HEAD
+<<<<<<< Updated upstream
+=======
++=======
++>>>>>>> main
def save(self, path: str) -> None:
"""
Save vector store to disk.
@@@ -216,12 -303,11 +308,19 @@@
List of results with scores
"""
# Generate embedding for query
++<<<<<<< HEAD
+ query_vector = self.embed(query)
++=======
+ query_vector = self.embed([query])[0]
++>>>>>>> main
# Search by vector
return self.search_vectors(query_vector=query_vector, k=limit, **options)
++<<<<<<< HEAD
+>>>>>>> Stashed changes
++=======
++>>>>>>> main
def search_vectors(
self, query_vector: np.ndarray, k: int = 10, **options
) -> List[Dict[str, Any]]: