From 86ca3edbfcff457ec43a7c06ebf470363cd54be5 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Thu, 5 Mar 2026 21:38:12 +0000 Subject: [PATCH] Fixed quotaed triples --- trustgraph-base/trustgraph/api/flow.py | 3 ++- trustgraph-base/trustgraph/api/knowledge.py | 3 ++- trustgraph-base/trustgraph/api/library.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/trustgraph-base/trustgraph/api/flow.py b/trustgraph-base/trustgraph/api/flow.py index 7c5d5c9c..7bbd7f60 100644 --- a/trustgraph-base/trustgraph/api/flow.py +++ b/trustgraph-base/trustgraph/api/flow.py @@ -23,7 +23,8 @@ def to_value(x): return Literal(x.get("v", "")) elif x.get("t") == TRIPLE: # Parse the nested triple from JSON or structured data - triple_data = x.get("v", "") + # Wire format uses "tr" key for nested triple dict + triple_data = x.get("tr") or x.get("v", "") if isinstance(triple_data, str): import json try: diff --git a/trustgraph-base/trustgraph/api/knowledge.py b/trustgraph-base/trustgraph/api/knowledge.py index 84f83d21..c5e1f424 100644 --- a/trustgraph-base/trustgraph/api/knowledge.py +++ b/trustgraph-base/trustgraph/api/knowledge.py @@ -22,7 +22,8 @@ def to_value(x): return Literal(x.get("v", "")) elif x.get("t") == TRIPLE: # Parse the nested triple from JSON or structured data - triple_data = x.get("v", "") + # Wire format uses "tr" key for nested triple dict + triple_data = x.get("tr") or x.get("v", "") if isinstance(triple_data, str): import json try: diff --git a/trustgraph-base/trustgraph/api/library.py b/trustgraph-base/trustgraph/api/library.py index 5c31ef4a..63ec32b0 100644 --- a/trustgraph-base/trustgraph/api/library.py +++ b/trustgraph-base/trustgraph/api/library.py @@ -34,7 +34,8 @@ def to_value(x): return Literal(x.get("v", "")) elif x.get("t") == TRIPLE: # Parse the nested triple from JSON or structured data - triple_data = x.get("v", "") + # Wire format uses "tr" key for nested triple dict + triple_data = x.get("tr") or x.get("v", "") if isinstance(triple_data, str): import json try: