From 3772047feb6ded8c4f866d2127082f1f827327f7 Mon Sep 17 00:00:00 2001 From: Sarath Date: Thu, 15 Aug 2024 13:30:28 +0200 Subject: [PATCH] convert things to urirefs --- atomrdf/graph.py | 4 ++-- atomrdf/structure.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atomrdf/graph.py b/atomrdf/graph.py index 2871a3d..675fb1c 100644 --- a/atomrdf/graph.py +++ b/atomrdf/graph.py @@ -1266,9 +1266,9 @@ def iterate_and_rename_triples(self, item): for triple in triples: if triple[0].toPython() in uri_dict.keys(): - triples[0] = uri_dict[triple[0].toPython()] + triples[0] = URIRef(uri_dict[triple[0].toPython()]) if triple[2].toPython() in uri_dict.keys(): - triples[2] = uri_dict[triple[2].toPython()] + triples[2] = URIRef(uri_dict[triple[2].toPython()]) return URIRef(uri_dict[item.toPython()]), triples diff --git a/atomrdf/structure.py b/atomrdf/structure.py index 74791ab..b497d8b 100644 --- a/atomrdf/structure.py +++ b/atomrdf/structure.py @@ -2562,10 +2562,10 @@ def copy_defects(self, parent_sample): if parent_sample is None: return - parent_material = list([k[2] for k in self.kg.triples((parent_sample, CMSO.hasMaterial, None))])[0] - parent_defects = list([x[2] for x in self.kg.triples((parent_material, CMSO.hasDefect, None))]) + parent_material = list([k[2] for k in self.graph.triples((parent_sample, CMSO.hasMaterial, None))])[0] + parent_defects = list([x[2] for x in self.graph.triples((parent_material, CMSO.hasDefect, None))]) - material = list([k[2] for k in self.kg.triples((self.sample, CMSO.hasMaterial, None))])[0] + material = list([k[2] for k in self.graph.triples((self.sample, CMSO.hasMaterial, None))])[0] for defect in parent_defects: new_defect, defect_triples = self.graph.iterate_and_rename_triples(defect)