Add support for the /jobs/{jobId}/results/{outputID}/{N} path.#596
Conversation
|
As discussed in SWG meeting 22-JUL-2026, merging so that we can hand off the document of OGC for RFC. |
fmigneault
left a comment
There was a problem hiding this comment.
@pvretano
Comments placed inline in the PR since it is easier to keep the context this way. I'll create an RFC review issue linking to them.
| [.component,class=part] | ||
| -- | ||
| In the response headers, the server SHALL include an HTTP header named `OGC-Output-Values-Count` indicating how many processing values are retrievable for this output. | ||
| -- |
There was a problem hiding this comment.
This header should probably be prefixed by a X- since it is standard-specific.
| identifier:: /req/core/job-results-async-one-multi-valued | ||
|
|
||
| [.component,class=conditions] | ||
| -- | ||
| . The <<sc_execution_mode,negotiated execution mode>> is asynchronous. | ||
| . The number of requested (whether <<implicit-process-output,implicitly>> or <<explicit-process-output,explicitly>>) outputs in the <<execute-request-body,execute request>> is 1. |
There was a problem hiding this comment.
For this case (and same for sync case), it seems like the "number of requested outputs" should not matter (or at least, be >=1) since the /jobs/{jobID}/results/{outputID} endpoint applies to multi-output executions as well, as long as the corresponding results are multi-occurence.
| [%metadata] | ||
| identifier:: /req/core/job-result-op-0th | ||
|
|
||
| For each output, with output identifier `outputID`, defined in the <<sc_process_description,description of a process>> and requested (whether <<implicit-process-output,implicitly>> or <<explicit-process-output,explicitly>>) in an <<execute-request-body,execute request>>, the server SHALL support the HTTP GET operation at the path `/jobs/{jobID}/results/{outputID}/0`. |
There was a problem hiding this comment.
{outputID} (with brackets) for consistency with other definitions
| . The output with output identifier `outputID` is defined in the <<sc_process_description,process description>> as having `maxOccurs>1`. | ||
| . The output with output identifier `outputID` is <<implicit-process-output,implicitly>> or <<explicit-process-output,explicitly>> requested in an <<execute-request-body,execute request>>. |
There was a problem hiding this comment.
{outputID} (with brackets) for consistency with other definitions
| -- | ||
| . The <<sc_execution_mode,negotiated execution mode>> is asynchronous, | ||
| . The number of requested (whether <<implicit-process-output,implicitly>> or <<explicit-process-output,explicitly>>) outputs in the <<execute-request-body,execute request>> is 1. | ||
| . The requested output with identifier `outputID` is defined in the <<sc_process_description,process description>> as having `maxOccurs>1`. |
There was a problem hiding this comment.
{outputID} (with brackets) for consistency with other definitions
| NOTE: Unless the definition of an output sets `maxOccurs>1`, the value of the `OGC-Output-Values-Count` HTTP header will usually be 1. | ||
|
|
||
| NOTE: If the requested output is multi-valued (i.e. `maxOccurs>1` in the <<sc_process_description,process description>>), then the negotiated response will need to be some type of container for the array of values generated by the process for this output. For example, this could be a JSON response where the array of values is encoded as a JSON array or a multi-part response where each part contains one value from the array or some archive (e.g. ZIP or tar) where each array value is stored in an individual file. |
There was a problem hiding this comment.
It might be worth moving this out (and the corresponding part about it above) into a dedicated /req. That requirement should clarify the 1 value expected when maxOccurs=1, since technically the result value in this case will NOT need to be represented in an array. Is it even erroneous to return OGC-Output-Values-Count in this case?
I am worried that an actual JSON "array-like value" might be incorrectly accessed at index 0 if a client relies on OGC-Output-Values-Count: 1 when no actual "occurence array" is employed for that result (i.e., when the structure of /jobs/{jobID}/results/{outputID} and /jobs/{jobID}/results/{outputID}/0 are identical and N>1 is an error).
This concern is partially discussed in the 'The "0-th" result' section, but it might be a bit far from where this requirement is included to be interpreted properly.
| -- | ||
| . The <<sc_execution_mode,negotiated execution mode>> is synchronous. | ||
| . The number of requested (whether <<implicit-explicit-outputs,implicitly or explicitly>>) outputs in the <<execute-request-body,execute request>> is 1. | ||
| - In its <<sc_process_description,process description>> the requested output is defined as having `maxOccurs>1`. |
There was a problem hiding this comment.
Not sure if this - is a . typo or not.
|
|
||
| include::../requirements/core/REQ_job-result-op-Nth.adoc[] | ||
|
|
||
| NOTE: The size of the value may be determined without actually transmitting the entire result by using the <<rec_core_http-head,HTTP HEAD>> method to retrieve the <<rec_core_content-length,`Content-Length`>> header. |
There was a problem hiding this comment.
Define a /rec ? It uses "may" term.
|
|
||
| include::../requirements/core/REQ_job-result-op-0th.adoc[] | ||
|
|
||
| In other words, regardless of the defined cardinality of an output, the first result (i.e. at index value 0) is always accessible. If, however, the cardinality of the output is 1 (i.e. `maxOccurs=1`) then attempting to retrieve an output value using any index value other than _0_ will result in an HTTP 404 exception. Also, if the cardinality of the output is greater than one (i.e. `maxOccurs>1`) then other non-zero index values may be used to retrieve output values. However, out-of-bounds index values will results in an HTTP 404 exception (see requirement: <<req_core_process-execute-success-async-outputs-Nth,/req/core/process-execute-success-async-outputs-Nth>>). |
There was a problem hiding this comment.
Consider a cross-ref to Cardinality (section 9) here on first mention of the term.
| [[req_core_job-results-async-one-multi-valued]] | ||
| [requirement] | ||
| ==== | ||
| [%metadata] | ||
| identifier:: /req/core/job-results-async-one-multi-valued |
There was a problem hiding this comment.
This applies to all requriements about "N".
Is it necessary to make them async-specific? Technically, a server is still allowed to create a job in sync to preserve traceability (/per/core/process-execute-sync-job). It could request a Prefer: return=minimal sync response, and then access the respective ../{N} results one by one on-demand.
No description provided.