Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove BaseKnowledgeGraph #4953

Merged
merged 3 commits into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 0 additions & 107 deletions e2e/document_stores/test_knowledge_graph.py

This file was deleted.

6 changes: 1 addition & 5 deletions haystack/document_stores/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from haystack.utils.import_utils import safe_import
from haystack.document_stores.base import BaseDocumentStore, BaseKnowledgeGraph, KeywordDocumentStore
from haystack.document_stores.base import BaseDocumentStore, KeywordDocumentStore

from haystack.document_stores.memory import InMemoryDocumentStore
from haystack.document_stores.deepsetcloud import DeepsetCloudDocumentStore
Expand All @@ -20,7 +20,3 @@
PineconeDocumentStore = safe_import("haystack.document_stores.pinecone", "PineconeDocumentStore", "pinecone")
MilvusDocumentStore = safe_import("haystack.document_stores.milvus", "MilvusDocumentStore", "milvus")
WeaviateDocumentStore = safe_import("haystack.document_stores.weaviate", "WeaviateDocumentStore", "weaviate")
GraphDBKnowledgeGraph = safe_import("haystack.document_stores.graphdb", "GraphDBKnowledgeGraph", "graphdb")
InMemoryKnowledgeGraph = safe_import(
"haystack.document_stores.memory_knowledgegraph", "InMemoryKnowledgeGraph", "inmemorygraph"
)
30 changes: 0 additions & 30 deletions haystack/document_stores/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from typing import Generator, Optional, Dict, List, Set, Union, Any

import warnings
import logging
import collections
from pathlib import Path
Expand Down Expand Up @@ -32,35 +31,6 @@ def njit(f):
return f


class BaseKnowledgeGraph(BaseComponent):
"""
Base class for implementing Knowledge Graphs.

The BaseKnowledgeGraph component is deprecated and will be removed in future versions.
"""

def __init__(self):
warnings.warn(
"The BaseKnowledgeGraph component is deprecated and will be removed in future versions.",
category=DeprecationWarning,
)
super().__init__()

outgoing_edges = 1

def run(self, sparql_query: str, index: Optional[str] = None, headers: Optional[Dict[str, str]] = None): # type: ignore
result = self.query(sparql_query=sparql_query, index=index, headers=headers)
output = {"sparql_result": result}
return output, "output_1"

def run_batch(self):
raise NotImplementedError("run_batch is not implemented for KnowledgeGraphs.")

@abstractmethod
def query(self, sparql_query: str, index: Optional[str] = None, headers: Optional[Dict[str, str]] = None):
raise NotImplementedError


class BaseDocumentStore(BaseComponent):
"""
Base class for implementing Document Stores.
Expand Down
206 changes: 0 additions & 206 deletions haystack/document_stores/graphdb.py

This file was deleted.

Loading