mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 16:36:21 +02:00
knowledge service (#367)
* Write knowledge core elements to Cassandra * Store service works, building management service * kg-manager
This commit is contained in:
parent
d0da122bed
commit
807c19fd22
24 changed files with 1196 additions and 243 deletions
|
|
@ -13,4 +13,5 @@ from . lookup import *
|
|||
from . library import *
|
||||
from . config import *
|
||||
from . flows import *
|
||||
from . knowledge import *
|
||||
|
||||
|
|
|
|||
49
trustgraph-base/trustgraph/schema/knowledge.py
Normal file
49
trustgraph-base/trustgraph/schema/knowledge.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
from pulsar.schema import Record, Bytes, String, Array, Long, Boolean
|
||||
from . types import Triple
|
||||
from . topic import topic
|
||||
from . types import Error
|
||||
from . metadata import Metadata
|
||||
from . documents import Document, TextDocument
|
||||
from . graph import Triples, GraphEmbeddings
|
||||
|
||||
# fetch-kg-core
|
||||
# -> (???)
|
||||
# <- ()
|
||||
# <- (error)
|
||||
|
||||
# delete-kg-core
|
||||
# -> (???)
|
||||
# <- ()
|
||||
# <- (error)
|
||||
|
||||
# list-kg-cores
|
||||
# -> (user)
|
||||
# <- ()
|
||||
# <- (error)
|
||||
|
||||
class KnowledgeRequest(Record):
|
||||
|
||||
# fetch-kg-core, delete-kg-core, list-kg-cores
|
||||
operation = String()
|
||||
|
||||
# list-kg-cores, delete-kg-core
|
||||
user = String()
|
||||
|
||||
# fetch-kg-core, list-kg-cores, delete-kg-core
|
||||
id = String()
|
||||
|
||||
class KnowledgeResponse(Record):
|
||||
error = Error()
|
||||
ids = Array(String())
|
||||
eos = Boolean() # Indicates end of knowledge core stream
|
||||
triples = Triples()
|
||||
graph_embeddings = GraphEmbeddings()
|
||||
|
||||
knowledge_request_queue = topic(
|
||||
'knowledge', kind='non-persistent', namespace='request'
|
||||
)
|
||||
knowledge_response_queue = topic(
|
||||
'knowledge', kind='non-persistent', namespace='response',
|
||||
)
|
||||
|
||||
|
|
@ -51,17 +51,6 @@ from . documents import Document, TextDocument
|
|||
# <- (processing_metadata[])
|
||||
# <- (error)
|
||||
|
||||
# OLD:
|
||||
# add(Metadata, Bytes) : error?
|
||||
# copy(id, user, collection)
|
||||
# move(id, user, collection)
|
||||
# delete(id)
|
||||
# get(id) : Bytes
|
||||
# reindex(id)
|
||||
# list(user, collection) : id[]
|
||||
# info(id[]) : DocumentInfo[]
|
||||
# search(<key,op,value>[]) : id[]
|
||||
|
||||
class DocumentMetadata(Record):
|
||||
id = String()
|
||||
time = Long()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue