Skip to content

Commit 32ab45b

Browse files
committed
chore: unneeded comments, direction of history triple
1 parent 3d472e4 commit 32ab45b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/strings2things/app/core/rdf_transformer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,28 @@ def transform(self, input_graph: Graph) -> Graph:
2020
output_graph = Graph()
2121

2222
for s, p, o in input_graph:
23-
# Case: object is a string literal
23+
# if string matches object
2424
if isinstance(o, Literal) and isinstance(o.value, str):
2525
label = o.value.strip().lower()
2626
if label in self.label_map:
2727
iri = URIRef(self.label_map[label])
2828

29-
# Retain original triple (development mode)
29+
# Retain original triple (to retain backward compatibility for now)
3030
output_graph.add((s, p, o))
31+
output_graph.add((iri, URIRef("http://wwww.example.org/thingOf"), o))
3132

32-
# Add transformed triple
3333
output_graph.add((s, p, iri))
3434

35-
# Log the transformation
3635
self.log.add_entry(
3736
subject=str(s),
3837
predicate=str(p),
3938
original_value=str(o),
4039
replacement_iri=str(iri),
4140
reason="unambiguous match"
4241
)
43-
continue # move to next triple
42+
continue
4443

45-
# Case: leave untouched
44+
4645
output_graph.add((s, p, o))
4746
self.log.add_entry(
4847
subject=str(s),

0 commit comments

Comments
 (0)