2023-12-11 21:53:30 +00:00
|
|
|
"""**Graphs** provide a natural language interface to graph databases."""
|
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
import importlib
|
2024-04-10 17:01:19 +00:00
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from langchain_community.graphs.arangodb_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ArangoGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.falkordb_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
FalkorDBGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.gremlin_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GremlinGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.hugegraph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
HugeGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.kuzu_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
KuzuGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.memgraph_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MemgraphGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.nebula_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NebulaGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.neo4j_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
Neo4jGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.neptune_graph import (
|
2024-05-22 17:19:00 +00:00
|
|
|
BaseNeptuneGraph,
|
|
|
|
NeptuneAnalyticsGraph,
|
2024-04-30 17:13:48 +00:00
|
|
|
NeptuneGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.neptune_rdf_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NeptuneRdfGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.networkx_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NetworkxEntityGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.ontotext_graphdb_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OntotextGraphDBGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.rdf_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
RdfGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.graphs.tigergraph_graph import (
|
2024-04-30 17:13:48 +00:00
|
|
|
TigerGraph,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"ArangoGraph",
|
|
|
|
"FalkorDBGraph",
|
|
|
|
"GremlinGraph",
|
|
|
|
"HugeGraph",
|
|
|
|
"KuzuGraph",
|
2024-05-22 17:19:00 +00:00
|
|
|
"BaseNeptuneGraph",
|
2024-04-10 17:01:19 +00:00
|
|
|
"MemgraphGraph",
|
|
|
|
"NebulaGraph",
|
|
|
|
"Neo4jGraph",
|
|
|
|
"NeptuneGraph",
|
|
|
|
"NeptuneRdfGraph",
|
2024-05-22 17:19:00 +00:00
|
|
|
"NeptuneAnalyticsGraph",
|
2024-04-10 17:01:19 +00:00
|
|
|
"NetworkxEntityGraph",
|
|
|
|
"OntotextGraphDBGraph",
|
|
|
|
"RdfGraph",
|
|
|
|
"TigerGraph",
|
|
|
|
]
|
2023-12-11 21:53:30 +00:00
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
_module_lookup = {
|
|
|
|
"ArangoGraph": "langchain_community.graphs.arangodb_graph",
|
|
|
|
"FalkorDBGraph": "langchain_community.graphs.falkordb_graph",
|
|
|
|
"GremlinGraph": "langchain_community.graphs.gremlin_graph",
|
|
|
|
"HugeGraph": "langchain_community.graphs.hugegraph",
|
|
|
|
"KuzuGraph": "langchain_community.graphs.kuzu_graph",
|
|
|
|
"MemgraphGraph": "langchain_community.graphs.memgraph_graph",
|
|
|
|
"NebulaGraph": "langchain_community.graphs.nebula_graph",
|
|
|
|
"Neo4jGraph": "langchain_community.graphs.neo4j_graph",
|
2024-04-09 14:20:59 +00:00
|
|
|
"BaseNeptuneGraph": "langchain_community.graphs.neptune_graph",
|
|
|
|
"NeptuneAnalyticsGraph": "langchain_community.graphs.neptune_graph",
|
2024-03-12 22:18:54 +00:00
|
|
|
"NeptuneGraph": "langchain_community.graphs.neptune_graph",
|
|
|
|
"NeptuneRdfGraph": "langchain_community.graphs.neptune_rdf_graph",
|
|
|
|
"NetworkxEntityGraph": "langchain_community.graphs.networkx_graph",
|
|
|
|
"OntotextGraphDBGraph": "langchain_community.graphs.ontotext_graphdb_graph",
|
|
|
|
"RdfGraph": "langchain_community.graphs.rdf_graph",
|
|
|
|
"TigerGraph": "langchain_community.graphs.tigergraph_graph",
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
|
|
if name in _module_lookup:
|
|
|
|
module = importlib.import_module(_module_lookup[name])
|
|
|
|
return getattr(module, name)
|
|
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|