Resolve "Inter-entry reference resolution in client, cli, and archive reader"
-
add functionality to resolve references to different archives on the same server, using the provided user credentials -
add a simple test which involves references to both the same and a different archive
A few points:
- References to another installation (a remote url such as:
https://his.oasis/uploads/some_upload/archive/some_archive#path/relative/to/entry
) will not be resolved accounting for the fact that there may not be access to that installation, even with the provided user credentials. - All references to another entry are resolved by:
- Retrieve the plain json data from the public API
answer_entry_archive_request
- Apply the same
required
to extract relavent data. At this stage, there is no need to distingush whether another entry is in the same upload or another upload. Usinganswer_entry_archive_request
handles both case uniformly.
- Retrieve the plain json data from the public API
- In the case of references need to be resolved but not in-place, the current implementation adds the same data structure to the result json, this leads to data overlapping for references like
entry_a#/run/0/system/0
andentry_b#/run/0/system/0
. All references to another entry are prefixed by the corresponding entry id to avoid data overlapping. See the example for comparision.
The example archive has a reference to XUlSxqEvec0LvPQbSLWeysB1Ksns
,
{"workflow":[{"calculation_result_ref":"../uploads/examples_template/archive/XUlSxqEvec0LvPQbSLWeysB1Ksns#/run/0/calculation/0"}]}
which further has references to itself.
{"run":[{"calculation":[{"system_ref":"/run/0/system/0","method_ref":"/run/0/method/0","energy":{"total":{"value":-1.5935696296699573e-18},"free":{"value":-1.5936767191492225e-18},"total_t0":{"value":-3.2126683561907e-22}}}]}]}
After resolving all references, it becomes (other associated data is removed here for clearer presentation):
{
"XUlSxqEvec0LvPQbSLWeysB1Ksns":{
"run":[
{
"calculation":[
{
"system_ref":"/XUlSxqEvec0LvPQbSLWeysB1Ksns/run/0/system/0",
"method_ref":"/XUlSxqEvec0LvPQbSLWeysB1Ksns/run/0/method/0",
"energy":{
"total":{
"value":-1.5935696296699573e-18
},
"free":{
"value":-1.5936767191492225e-18
},
"total_t0":{
"value":-3.2126683561907e-22
}
}
}
]
}
]
},
"workflow":[
{
"calculation_result_ref":"/XUlSxqEvec0LvPQbSLWeysB1Ksns/run/0/calculation/0"
}
]
}
Edited by Theodore Chang