Skip to content

Commit 161e4b5

Browse files
committed
fix: make write provenance return a graph and add niiri as default namespace
1 parent 00b2d68 commit 161e4b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nipype/utils/provenance.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
foaf = pm.Namespace("foaf", "http://xmlns.com/foaf/0.1/")
1818
dcterms = pm.Namespace("dcterms", "http://purl.org/dc/terms/")
1919
nipype_ns = pm.Namespace("nipype", "http://nipy.org/nipype/terms/")
20+
niiri = pm.Namespace("niiri", "http://nidm.nidash.org/iri/")
2021

21-
get_id = lambda: nipype_ns[uuid1().hex]
22+
get_id = lambda: niiri[uuid1().hex]
2223

2324
def safe_encode(x):
2425
"""Encodes a python value for prov
@@ -66,7 +67,7 @@ def safe_encode(x):
6667
def write_provenance(results, filename='provenance', format='turtle'):
6768
ps = ProvStore()
6869
ps.add_results(results)
69-
ps.write_provenance(filename=filename, format=format)
70+
return ps.write_provenance(filename=filename, format=format)
7071

7172
class ProvStore(object):
7273

@@ -75,6 +76,7 @@ def __init__(self):
7576
self.g.add_namespace(foaf)
7677
self.g.add_namespace(dcterms)
7778
self.g.add_namespace(nipype_ns)
79+
self.g.add_namespace(niiri)
7880

7981
def add_results(self, results):
8082
if results.provenance:

0 commit comments

Comments
 (0)