Skip to content

Commit

Permalink
convert things to urirefs
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Aug 15, 2024
1 parent f089c8d commit 3772047
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions atomrdf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions atomrdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3772047

Please sign in to comment.