From a2ef2b8659bd25baa6b2027000cb5a10169e8a47 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 9 Feb 2026 15:16:14 +0000 Subject: [PATCH] Output the entity term as well as its definition as entity contexts --- .../trustgraph/extract/kg/definitions/extract.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/trustgraph-flow/trustgraph/extract/kg/definitions/extract.py b/trustgraph-flow/trustgraph/extract/kg/definitions/extract.py index 9cf87e9a..9d289e2d 100755 --- a/trustgraph-flow/trustgraph/extract/kg/definitions/extract.py +++ b/trustgraph-flow/trustgraph/extract/kg/definitions/extract.py @@ -161,12 +161,17 @@ class Processor(FlowProcessor): o=Term(type=IRI, iri=v.metadata.id) )) - ec = EntityContext( + # Output entity name as context for direct name matching + entities.append(EntityContext( + entity=s_value, + context=s, + )) + + # Output definition as context for semantic matching + entities.append(EntityContext( entity=s_value, context=defn["definition"], - ) - - entities.append(ec) + )) if triples: await self.emit_triples(