From e1ced377ebd3dcd8f5f0b27a17df062d59f7df32 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 21 Jul 2025 14:01:28 +0100 Subject: [PATCH] Tweaked metadata to reduce unnecessary --- .../trustgraph/extract/kg/agent/extract.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/trustgraph-flow/trustgraph/extract/kg/agent/extract.py b/trustgraph-flow/trustgraph/extract/kg/agent/extract.py index 98b7e988..9b15b44c 100644 --- a/trustgraph-flow/trustgraph/extract/kg/agent/extract.py +++ b/trustgraph-flow/trustgraph/extract/kg/agent/extract.py @@ -97,16 +97,28 @@ class Processor(FlowProcessor): return TRUSTGRAPH_ENTITIES + urllib.parse.quote(text) async def emit_triples(self, pub, metadata, triples): - tpls = Triples() - tpls.metadata = metadata - tpls.triples = triples + tpls = Triples( + metadata = Metadata( + id = metadata.id, + metadata = [], + user = metadata.user, + collection = metadata.collection, + ), + triples = triples, + ) await pub.send(tpls) async def emit_entity_contexts(self, pub, metadata, entity_contexts): - ecs = EntityContexts() - ecs.metadata = metadata - ecs.entities = entity_contexts + ecs = EntityContexts( + metadata = Metadata( + id = metadata.id, + metadata = [], + user = metadata.user, + collection = metadata.collection, + ), + entities = entity_contexts, + ) await pub.send(ecs)