From 38630994bcfddb49a21c0910d69c97984ea583f0 Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Mon, 9 Feb 2026 15:18:05 +0000 Subject: [PATCH] Output the entity term as well as its definition as entity contexts (#629) --- .../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 2693e456..8512352b 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=Value(value=v.metadata.id, is_uri=True) )) - 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(