[Zoo-discuss] OGC API - Processing tentative implementation

Gérald Fenoy gerald.fenoy at geolabs.fr
Fri Oct 11 06:44:55 PDT 2019


Hi Pablo,
thanks a lot for your support and your questions.

First of all, I realize that I forgot to provide the link to the GitHub repository for the OGC API - Processes definition [1].

Indeed, as you were able to choose the version of the WPS to use for running a given request, you can now use another way.

With the version 2.0.0 of the WPS standard, there is no more support for GET method when running an Execute request. Hence, in the OGC API - Processes there is no such support either so, you should use POST method for executing a service. 

To illustrate how to request a basic service, I will use HelloPy and, give below requests that can be used from command line using curl or using the SwaggerUI interface [2].

1. Execute service with output by value:

curl -X POST "https://demo.mapmint.com/WPS3/processes/HelloPy/jobs » \
       - H "accept: application/json » \
       -H "Content-Type: application/json » \
       -d @data1.json

Where data1.json file content used as request data is like the following:

{
  "inputs": [
    {
      "id": "a",
      "input": {
        "dataType": {
          "name": "string"
        },
        "value": "Pablo"
      }
    }
  ],
  "outputs": [
    {
      "format": {
        "mimeType": "text/plain",
        "encoding": "utf-8"
      },
      "id": "Result",
      "transmissionMode": "value"
    }
  ]
}

2. Execute service with output by reference: you can use the same curl command as for 1. using a file similar to data1.json with a change of the output « transmissionMode » parameter value from « value » to « reference ».

3. Execute service asynchronously: use the same request and, add the following option to your curl command: -H "Prefer: respond-async". In such a case, the server will simply return a status code 201 in case of success and provide a location response header containing the URL to fetch the current status of the running service. This statusInfo document will contain links (an array of link) that should contain, in case of success, a result at the end of the execution. 

For this last point, the idea to use this Prefer request header was discussed here [3] and has been implemented this way cause no other solution were available at that time and it looked reasonable. Nevertheless, since the implementation has been made, some modifications have been done on the model. Especially, the execute definition [4] where we can now find both the « mode » and « response » parameters that can be used to specify the execution mode (sync or async) and the response type (corresponding to the ResponseDocument and RawDataOutput). This option are not yet supported by the current implementation as they were not available.

I hope it illustrate how to execute your services using the ZOO-Project implementation of the OGC API - Processes.

Best regards,


[1] https://github.com/opengeospatial/wps-rest-binding
[2] https://demo.mapmint.com/swagger-ui/dist/
[3] https://github.com/opengeospatial/wps-rest-binding/issues/30
[4] https://github.com/opengeospatial/wps-rest-binding/blob/master/core/openapi/schemas/execute.yaml

Gerald Fenoy
gerald.fenoy at geolabs.fr



> Le 8 oct. 2019 à 23:03, Pablo J. Zader <pzader at gmail.com> a écrit :
> 
> Hi Gerald
> 
> Great job! Congratulations!
> 
> To better understand the incorporation of the API, instead of invoking the processes through the traditional way, now we can do it using the API?
> For example,
> 
> If I have a service which is executed in this way: ( myprocess: x -> y)
> 
> http://localhost/cgi-bin/zoo_proyect?service=wps&request=execute&identifier=myprocess..%DataInputs=x=...; output=y...
> 
> using the API, how should I invoke it?
> 
> Regards
> 
> Pablo
> 
> 
> 
> 
> El vie., 6 sept. 2019 a las 7:49, Gérald Fenoy (<gerald.fenoy at geolabs.fr>) escribió:
> Dear all,
> I would like to let you know that yesterday I have finally committed in r949 [1] the first tentative implementation of the ongoing « OGC API - Processing » (which I should probably name wps-rest-binding by now, or WPS 3 when it will be accepted) which was discussed during the OGC Hackathon in London late June this year.
> 
> After coming back from the Hackathon, I have published this very small report [2] presenting how to use the OGC API for processing with ZOO-Project.
> 
> From my testing it is working properly but with some limitations:
>   * inputs are not validated yet, meaning that in case the request did not contain a value for an input, your service will still be invoked (note that this feature can be activated again by modifying the validation function),
>   * no MapServer output support for OGC API - Processing cause I suppose that we should wait for OGC API - Features support in MapServer (I was thinking that outputting WMS, WFS and WCS from previous standard versions do not make sens as we use the new processing api), note that there should not be any issue in activating this support again.
> 
> The documentation has been updated to provide informations about the new oas.cfg file used for OpenAPI Specification [3] and the configuration options to activate this support [4].
> 
> I hope you will have great time testing this new WPS REST Binding.
> 
> Best regards,
> 
> [1] http://www.zoo-project.org/trac/changeset/949 
> [2] http://www.zoo-project.org/trac/wiki/OGC_Hackathon_2019
> [3] http://www.zoo-project.org/docs/kernel/configuration.html#openapi-specification-configuration-file
> [4] http://www.zoo-project.org/docs/install/installation.html#ogc-api-processing-support-optional
> 
> Gerald Fenoy
> gerald.fenoy at geolabs.fr
> 
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/zoo-discuss
> 
> 
> -- 
> Pablo J. Zader
> Lic. en Cs. de la Computación + MSc. en Aplicaciones Espaciales de Alerta y Respuesta Temprana a Emergencias
> pablo.zader at gmail.com 
> 
> Universidad Nacional de Córdoba
> Av. Valpáraíso s/n Ciudad Universitaria
> 
>    
> "Los Grandes Hombres hablan sobre ideas...  Los Hombres Promedio hablan sobre cosas...  Los Hombres Pequeños hablan.. de otros Hombres.
> del libro Matemática estas ahí? A. Paenza "



More information about the Zoo-discuss mailing list