mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 01:16:22 +02:00
Use collection field from request when loading a knowledge core (#472)
* Use collection field from request when loading a knowledge core * Test core collection
This commit is contained in:
parent
e5b9b4976a
commit
3e5d6ed3e4
3 changed files with 401 additions and 0 deletions
|
|
@ -248,6 +248,9 @@ class KnowledgeManager:
|
|||
await ge_pub.start()
|
||||
|
||||
async def publish_triples(t):
|
||||
# Override collection with request collection
|
||||
if hasattr(t, 'metadata') and hasattr(t.metadata, 'collection'):
|
||||
t.metadata.collection = request.collection or "default"
|
||||
await t_pub.send(None, t)
|
||||
|
||||
logger.debug("Publishing triples...")
|
||||
|
|
@ -260,6 +263,9 @@ class KnowledgeManager:
|
|||
)
|
||||
|
||||
async def publish_ge(g):
|
||||
# Override collection with request collection
|
||||
if hasattr(g, 'metadata') and hasattr(g.metadata, 'collection'):
|
||||
g.metadata.collection = request.collection or "default"
|
||||
await ge_pub.send(None, g)
|
||||
|
||||
logger.debug("Publishing graph embeddings...")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue