Skip to content

Commit

Permalink
more fixes in compliance with updated context
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaumet committed Sep 4, 2023
1 parent 5619add commit 2f9adbc
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bids_prov/afni/afni_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def build_records(commands_bloc: list, agent_id: str, verbose: bool = False):
activity["Used"].append(existing_input["@id"])

for output_path in outputs:
records["prov:Entity"].append(
records["Entities"].append(
{
"@id": f"urn:{get_id()}",
"Label": os.path.split(output_path)[1],
Expand Down
2 changes: 1 addition & 1 deletion bids_prov/fsl/fsl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def fsl_to_bids_prov(filename: str, context_url=CONTEXT_URL, output_file=None,
records = build_records(lines, agent_id)
graph["Records"].update(records)

compute_sha_256_entity(graph["Records"]["prov:Entity"])
compute_sha_256_entity(graph["Records"]["Entities"])

return writing_jsonld(graph, indent, output_file)

Expand Down
4 changes: 2 additions & 2 deletions bids_prov/spm/spm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def find_output_id_from_closest(closest_activity: dict, records: dict) -> str:
else:
output_id = "urn:" + get_id()
# output_id = next(
# (entity["@id"] for entity in records["prov:Entity"]
# (entity["@id"] for entity in records["Entities"]
# if parts[-1] == entity["Label"] and entity["GeneratedBy"] == closest_activity["@id"]
# ), "urn:" + get_id()
# ) # find entity id generated by closest activity, if None new get_id
Expand Down Expand Up @@ -293,7 +293,7 @@ def get_records(task_groups: dict, agent_id: str, verbose=False) -> dict:
Returns
-------
dict[str, list]
records : dict with key "@context", ... "Records":{"prov:Agent": ..."prov:Activity":..."prov:Entity":....}
records : dict with key "@context", ... "Records":{"prov:Agent": ..."prov:Activity":..."Entities":....}
"""

Expand Down
2 changes: 1 addition & 1 deletion bids_prov/tests/samples_test/batch_example_spm.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
}
}
],
"prov:Entity": [
"Entities": [
{
"@id": "urn:4a800646-417a-4105-bc31-99944567ceb1",
"Label": "func_sub-01_task-tonecounting_bold.nii.gz",
Expand Down
2 changes: 1 addition & 1 deletion bids_prov/tests/samples_test/batch_example_spm_ref.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
}
}
],
"prov:Entity": [
"Entities": [
{
"@id": "urn:4a800646-417a-4105-bc31-99944567ceb1",
"Label": "func_sub-01_task-tonecounting_bold.nii.gz",
Expand Down
2 changes: 1 addition & 1 deletion bids_prov/tests/samples_test/partial_conjunction.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
}
}
],
"prov:Entity": [
"Entities": [
{
"@id": "urn:4a800646-417a-4105-bc31-99944567ceb1",
"Label": "func_sub-01_task-tonecounting_bold.nii.gz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
}
}
],
"prov:Entity": [
"Entities": [
{
"@id": "urn:4a800646-417a-4105-bc31-99944567ceb1",
"Label": "func_sub-01_task-tonecounting_bold.nii.gz",
Expand Down
2 changes: 1 addition & 1 deletion bids_prov/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_default_graph(label: str, context_url: str = CONTEXT_URL, soft_ver: str
}
],
"prov:Activity": [],
"prov:Entity": [],
"Entities": [],
},
}, agent_id

Expand Down

0 comments on commit 2f9adbc

Please sign in to comment.