Skip to content

Commit 977962e

Browse files
authored
Merge pull request #810 from common-workflow-language/provenance-manifest
Improve Research Object manifest
2 parents 2ba677a + 0afcece commit 977962e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cwltool/provenance.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def close(self):
187187
# FIXME: Convert below block to a ResearchObject method?
188188
if self.rel_path.startswith("data/"):
189189
self.research_object.bagged_size[self.rel_path] = self.tell()
190-
elif self.rel_path.startswith("metadata/"):
191-
pass
192190
else:
193191
self.research_object.tagfiles.add(self.rel_path)
194192

@@ -945,7 +943,7 @@ def guess_mediatype(rel_path):
945943
and extension in prov_conforms_to):
946944
if ".cwlprov" in rel_path:
947945
# Our own!
948-
local_aggregate["conformsTo"] = [prov_conforms_to[extension], __citation__]
946+
local_aggregate["conformsTo"] = [prov_conforms_to[extension], CWLPROV_VERSION]
949947
else:
950948
# Some other PROV
951949
# TODO: Recognize ProvOne etc.
@@ -1022,8 +1020,10 @@ def _ro_annotations(self):
10221020
})
10231021

10241022
# How was it run?
1023+
# FIXME: Only primary*
10251024
prov_files = [posixpath.relpath(p, METADATA) for p in self.tagfiles
1026-
if p.startswith(_posix_path(PROVENANCE))]
1025+
if p.startswith(_posix_path(PROVENANCE))
1026+
and "/primary." in p]
10271027
annotations.append({
10281028
"uri": uuid.uuid4().urn,
10291029
"about": self.workflow_run_uri,
@@ -1035,15 +1035,15 @@ def _ro_annotations(self):
10351035
# Where is the main workflow?
10361036
annotations.append({
10371037
"uri": uuid.uuid4().urn,
1038-
"about": posixpath.join(WORKFLOW, "packed.cwl"),
1038+
"about": posixpath.join("..", WORKFLOW, "packed.cwl"),
10391039
"oa:motivatedBy": {"@id": "oa:highlighting"}
10401040
})
10411041

10421042
annotations.append({
10431043
"uri": uuid.uuid4().urn,
10441044
"about": self.workflow_run_uri,
1045-
"content": [posixpath.join(WORKFLOW, "packed.cwl"),
1046-
posixpath.join(WORKFLOW, "primary-job.json")],
1045+
"content": [posixpath.join("..", WORKFLOW, "packed.cwl"),
1046+
posixpath.join("..", WORKFLOW, "primary-job.json")],
10471047
"oa:motivatedBy": {"@id": "oa:linking"}
10481048
})
10491049

@@ -1080,7 +1080,6 @@ def _write_ro_manifest(self):
10801080
manifest["manifest"] = filename
10811081
manifest.update(self._self_made())
10821082
manifest.update(self._authored_by())
1083-
10841083
manifest["aggregates"] = self._ro_aggregates()
10851084
manifest["annotations"] = self._ro_annotations()
10861085

0 commit comments

Comments
 (0)