mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 08:56:21 +02:00
Feature/knowledge load (#372)
* Switch off retry in Cassandra until we can differentiate retryable errors * Fix config getvalues * Loading knowledge cores works
This commit is contained in:
parent
fdd9a9a9ae
commit
31b7ade44d
13 changed files with 356 additions and 548 deletions
|
|
@ -39,3 +39,29 @@ class Knowledge:
|
|||
|
||||
self.request(request = input)
|
||||
|
||||
def load_kg_core(self, id, user="trustgraph", flow="0000",
|
||||
collection="default"):
|
||||
|
||||
# The input consists of system and prompt strings
|
||||
input = {
|
||||
"operation": "load-kg-core",
|
||||
"user": user,
|
||||
"id": id,
|
||||
"flow": flow,
|
||||
"collection": collection,
|
||||
}
|
||||
|
||||
self.request(request = input)
|
||||
|
||||
def unload_kg_core(self, id, user="trustgraph", flow="0000"):
|
||||
|
||||
# The input consists of system and prompt strings
|
||||
input = {
|
||||
"operation": "unload-kg-core",
|
||||
"user": user,
|
||||
"id": id,
|
||||
"flow": flow,
|
||||
}
|
||||
|
||||
self.request(request = input)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,14 +25,22 @@ from . graph import Triples, GraphEmbeddings
|
|||
class KnowledgeRequest(Record):
|
||||
|
||||
# get-kg-core, delete-kg-core, list-kg-cores, put-kg-core
|
||||
# load-kg-core, unload-kg-core
|
||||
operation = String()
|
||||
|
||||
# list-kg-cores, delete-kg-core, put-kg-core
|
||||
user = String()
|
||||
|
||||
# get-kg-core, list-kg-cores, delete-kg-core, put-kg-core
|
||||
# get-kg-core, list-kg-cores, delete-kg-core, put-kg-core,
|
||||
# load-kg-core, unload-kg-core
|
||||
id = String()
|
||||
|
||||
# load-kg-core
|
||||
flow = String()
|
||||
|
||||
# load-kg-core
|
||||
collection = String()
|
||||
|
||||
# put-kg-core
|
||||
triples = Triples()
|
||||
graph_embeddings = GraphEmbeddings()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue