mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-25 23:35:12 +02:00
Use collection field from request when loading a knowledge core
This commit is contained in:
parent
e5b9b4976a
commit
c6b8a4684c
1 changed files with 6 additions and 0 deletions
|
|
@ -248,6 +248,9 @@ class KnowledgeManager:
|
||||||
await ge_pub.start()
|
await ge_pub.start()
|
||||||
|
|
||||||
async def publish_triples(t):
|
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)
|
await t_pub.send(None, t)
|
||||||
|
|
||||||
logger.debug("Publishing triples...")
|
logger.debug("Publishing triples...")
|
||||||
|
|
@ -260,6 +263,9 @@ class KnowledgeManager:
|
||||||
)
|
)
|
||||||
|
|
||||||
async def publish_ge(g):
|
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)
|
await ge_pub.send(None, g)
|
||||||
|
|
||||||
logger.debug("Publishing graph embeddings...")
|
logger.debug("Publishing graph embeddings...")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue