trustgraph/scripts/graph-show
cybermaggedon a3ea1301d6
Breakout store queries (#8)
- Break out store queries, so not locked into a Milvus/Cassandra backend
- Break out prompting into a separate module, so that prompts can be tailored to other LLMs
- Jsonnet used to generate docker compose templates
- Version to 0.6.0
2024-08-13 17:30:59 +01:00

45 lines
777 B
Python
Executable file

#!/usr/bin/env python3
"""
Connects to the trustgraph graph hosts and dumps all graph edges.
"""
import argparse
import time
from trustgraph.direct.cassandra import TrustGraph
def show_graph(graph_hosts):
t = TrustGraph(hosts=graph_hosts)
rows = t.get_all(limit=100_000_000)
for s, p, o in rows:
print(s, p, o)
def main():
parser = argparse.ArgumentParser(
prog='graph-show',
description=__doc__,
)
parser.add_argument(
'-g', '--graph-hosts',
default="localhost",
help=f'Graph host (default: localhost)',
)
args = parser.parse_args()
try:
show_graph(graph_hosts=args.graph_hosts.split(","))
except Exception as e:
print("Exception:", e, flush=True)
main()