From 19a83d9335d6e15543283d682502d434eb302c4d Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Mon, 9 Feb 2026 15:20:38 +0000 Subject: [PATCH] Output the entity term as well as its definition as entity contexts (#630) --- .../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(