mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-18 03:45:12 +02:00
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
This commit is contained in:
parent
a9a0e28f49
commit
a3ea1301d6
70 changed files with 4286 additions and 2394 deletions
70
tests/test-triples
Executable file
70
tests/test-triples
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import pulsar
|
||||
from trustgraph.triples_query_client import TriplesQueryClient
|
||||
|
||||
tq = TriplesQueryClient(pulsar_host="pulsar://localhost:6650")
|
||||
|
||||
e = "http://trustgraph.ai/e/shuttle"
|
||||
|
||||
limit=3
|
||||
|
||||
def dump(resp):
|
||||
print("Response...")
|
||||
for t in resp:
|
||||
print(t.s.value, t.p.value, t.o.value)
|
||||
|
||||
print("-- * ---------------------------")
|
||||
|
||||
resp = tq.request(None, None, None, limit)
|
||||
dump(resp)
|
||||
|
||||
print("-- s ---------------------------")
|
||||
|
||||
resp = tq.request("http://trustgraph.ai/e/shuttle", None, None, limit)
|
||||
dump(resp)
|
||||
|
||||
print("-- p ---------------------------")
|
||||
|
||||
resp = tq.request(None, "http://trustgraph.ai/e/landed", None, limit)
|
||||
dump(resp)
|
||||
|
||||
print("-- p ---------------------------")
|
||||
|
||||
resp = tq.request(None, None, "President", limit)
|
||||
dump(resp)
|
||||
|
||||
print("-- sp ---------------------------")
|
||||
|
||||
resp = tq.request(
|
||||
"http://trustgraph.ai/e/shuttle", "http://trustgraph.ai/e/landed", None,
|
||||
limit
|
||||
)
|
||||
dump(resp)
|
||||
|
||||
print("-- so ---------------------------")
|
||||
|
||||
resp = tq.request(
|
||||
"http://trustgraph.ai/e/shuttle", None, "the tower",
|
||||
limit
|
||||
)
|
||||
dump(resp)
|
||||
|
||||
print("-- po ---------------------------")
|
||||
|
||||
resp = tq.request(
|
||||
"http://trustgraph.ai/e/shuttle", "http://trustgraph.ai/e/landed",
|
||||
None,
|
||||
limit
|
||||
)
|
||||
dump(resp)
|
||||
|
||||
print("-- spo ---------------------------")
|
||||
|
||||
resp = tq.request(
|
||||
"http://trustgraph.ai/e/shuttle", "http://trustgraph.ai/e/landed",
|
||||
"on the concrete runway at Kennedy Space Center",
|
||||
limit
|
||||
)
|
||||
dump(resp)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue