Skip to content

Commit a0df68b

Browse files
committed
[tools/rdf] Export origin file name to RDF
1 parent 95db028 commit a0df68b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

odml/tools/rdf_converter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def save_element(self, e, node=None):
8888
if isinstance(fmt, Document.__class__):
8989
self.g.add((self.hub_root, odmlns.hasDocument, curr_node))
9090

91+
# If available add the documents filename to the document node
92+
# so we can identify where the data came from.
93+
if hasattr(e, "_origin_file_name"):
94+
self.g.add((curr_node, odmlns.hasFileName, Literal(e._origin_file_name)))
95+
9196
for k in fmt.rdf_map_keys:
9297
if k == 'id':
9398
continue

0 commit comments

Comments
 (0)