Skip to content

Commit

Permalink
fixed a bug with next() interator in joined rdf creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hanke committed Nov 27, 2023
1 parent ab7ecf9 commit c6271a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ def apply_mapping(
joined_graph.bind("row" + str(data_node).rsplit("-", 1)[-1], row_ns)
# set mapping realtions on each individual row
for property, predicate, object in for_row_to_set:
subject = next(joined_graph.objects(data_node, property))
joined_graph.add((subject, predicate, row_ns[object]))
subject = next(joined_graph.objects(data_node, property),None)
if subject:
joined_graph.add((subject, predicate, row_ns[object]))
for subject, predicate, object in for_copy_to_set:
joined_graph.add((subject, predicate, row_ns[object]))

Expand Down

0 comments on commit c6271a7

Please sign in to comment.