source: trunk/docs/services/process-profiles.rst @ 747

Last change on this file since 747 was 725, checked in by djay, 9 years ago

Fix issue with rst files displayed from Trac. Fix strings to be translated. Always use the same string in all messages.

  • Property svn:keywords set to Date Author
  • Property svn:mime-type set to text/plain
File size: 9.2 KB
Line 
1.. _process-profiles:
2   
3Process profiles registry
4=========================
5
6WPS Services belonging to the same Services provider often share the
7same inputs and outputs. In such a case, every :ref:`ZCFG
8<services-zcfg>` file would contain the same metadata information and
9this may be a waste of time to write them all.
10
11:ref:`ZOO-Kernel <kernel_index>` is able to handle metadata
12inheritance from `rev. 607
13<http://www.zoo-project.org/trac/changeset/607>`__, and this solves
14the issue of writing many ZCFG with same input and output. A registry
15can be loaded by the ZOO-Kernel (before any other ZCFG files) and
16contain a set of Process Profiles organized in hierarchic levels
17according to the following rules:
18
19  * *Concept*: The higher level in the hierarchy. *Concepts* are basic
20    text files containing an abstract description of a WPS Service
21    (see `the OGC definition
22    <http://docs.opengeospatial.org/is/14-065/14-065.html#33>`_ for
23    more details).
24  * *Generic*: A *Generic* profile can make reference to
25    *Concepts*. It defines inputs and outputs without data format or
26    maximum size limitation (see `the OGC definition
27    <http://docs.opengeospatial.org/is/14-065/14-065.html#34>`_ for
28    more details).
29  * *Implementation*: An *Implementation* profile can inherit from a
30    generic profile and make reference to concepts (see `the OGC definition
31    <http://docs.opengeospatial.org/is/14-065/14-065.html#35>`_ for
32    more details). It contains all the metadata information about a
33    particular WPS Service (see :ref:`ZCFG reference <services-zcfg>`
34    for more information).
35
36Both *Generic* and *Implementation* process profiles are created  from
37:ref:`ZCFG <services-zcfg>` files and stored in the registry
38sub-directories according to their level (*Concept*, *Generic* or
39*Implementation*).
40
41To activate the registry, you have to add a ``registry`` key to the
42``[main]`` section of your ``main.cfg`` file, and set its value to the
43directory path used to store the profile ZCFG files. Please see
44:ref:`install_gfr` for more details about the other services and
45parameters required.
46
47.. note::
48    Even if the profile registry was first introduced in WPS 2.0.0, it
49    can be also used in the same way for WPS 1.0.0 Services.
50
51
52
53
54Generic Process Profile
55-----------------------
56
57A Generic Process Profile is a ZCFG file located in the ``generic``
58sub-directory, it defines `main metadata information
59<zcfg-reference.html#main-metadata-information>`__, inputs and outputs
60name, basic metadata and multiplicity. It can make reference to a
61concept by defining a ``concept`` key in the `main metadata
62information <zcfg-reference.html#main-metadata-information>`__ part.
63
64You can find below the `GO.zcfg` file, a typical Generic Process
65Profile for Generic Geographic Operation, taking one InputPolygon
66input parameter and returning a result named Result, it make reference
67to the ``GOC`` concept:
68
69.. code-block:: none
70   :linenos:
71   
72   [GO]
73    Title = Geographic Operation
74    Abstract = Geographic Operation on exactly one input, returning one output
75    concept = GOC
76    level = generic
77    statusSupported = true
78    storeSupported = true
79    <DataInputs>
80     [InputPolygon]
81      Title = the geographic data
82      Abstract = the geographic data to run geographipc operation
83      minOccurs = 1
84      maxOccurs = 1
85    </DataInputs>
86    <DataOutputs>
87     [Result]
88      Title = the resulting data
89      Abstract = the resulting data after processing the operation
90    </DataOutputs> 
91
92
93.. Note:: if you need to reference more than one concept, you should
94    separate their names with a comma (ie. concept = GO,GB),
95
96Process Implementation Profile
97------------------------------
98
99A Process Implementation Profile is similar to a `ZCFG file
100<zcfg-reference.html>`__ located in the `implementation`
101sub-directory, it defines (or inherit from its parent) all the
102properties of a `Generic Process Profile <#generic-process-profile>`__
103and specify `Data Format <zcfg-reference.html#type-of-data-nodes>`__
104for both inputs and outputs. It can make reference to a concept by
105defining a ``concept`` key in the `main metadata information
106<zcfg-reference.html#main-metadata-information>`__ part.
107
108You can find below the `VectorOperation.zcfg` file, a typical Process
109Implementation Profile for Vector Geographic Operation, it inherit
110from the `GP generic profile <#generic-process-profile>`__:
111
112.. code-block:: none
113   :linenos:
114   
115   [VectorOperation]
116    Title = Vector Geographic Operation
117    Abstract = Apply a Vector Geographic Operation on a features collection and return the resulting features collection
118    extend = GO
119    level = profile
120    <DataInputs>
121     [InputPolygon]
122      Title = the vector data
123      Abstract = the vector data to run geographic operation
124      <ComplexData>
125       <Default>
126        mimeType = text/xml
127        encoding = UTF-8
128        schema = http://fooa/gml/3.1.0/polygon.xsd
129       </Default>
130       <Supported>
131        mimeType = application/json
132        encoding = UTF-8
133        extension = js
134       </Supported>
135    </DataInputs>
136    <DataOutputs>
137     [Result]
138      Title = the resulting data
139      Abstract = the resulting geographic data after processing the operation
140      <ComplexData>
141       <Default>
142        mimeType = text/xml
143        encoding = UTF-8
144        schema = http://fooa/gml/3.1.0/polygon.xsd
145       </Default>
146       <Supported>
147        mimeType = application/json
148        encoding = UTF-8
149        extension = js
150       </Supported>
151      </ComplexData>
152    </DataOutputs> 
153
154
155ZCFG inheritance
156----------------------------------
157
158For the ZCFG files at the service level, you can inherit the metadata
159from a Process Implementation Profile available in the registry. As
160before, you simply need to add a ``extend`` key refering the ZCFG you
161want to inherit from and a ``level`` key taking the `ìmplementation``
162value to your main metadata informations.
163
164So, for example, the original `ConvexHull.zcfg
165<http://www.zoo-project.org/trac/browser/trunk/zoo-project/zoo-services/ogr/base-vect-ops/cgi-env/ConvexHull.zcfg?rev=491>`__
166may be rewritten as:
167
168.. code-block:: none
169   :linenos:
170   
171   [ConvexHull]
172    Title = Compute convex hull.
173    Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection.
174    serviceProvider = ogr_service.zo
175    serviceType = C
176    extend = VectorOperation
177    level = implementation
178
179Now, suppose that your service is able to return the result in KML
180format, then you may write the following:
181
182.. code-block:: none
183   :linenos:
184   
185   [ConvexHull]
186    Title = Compute convex hull.
187    Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection.
188    serviceProvider = ogr_service.zo
189    serviceType = C
190    extend = VectorOperation
191    level = implementation
192    <DataOutputs>
193     [Result]
194        <Supported>
195         mimeType = application/vnd.google-earth.kml+xml
196         encoding = utf-8
197        </Supported>
198    </DataOutputs>
199
200.. _install_gfr:
201
202Setup registry browser
203----------------------
204
205In the ``zoo-project/zoo-services/utils/registry``  you can find the
206source code and the ``Makefile`` required to build the Registry Browser
207Services Provider. To build and install this service, use the
208following comands:
209
210.. code::
211
212     cd zoo-project/zoo-services/utils/registry
213     make
214     cp cgi-env/* /usr/lib/cgi-bin
215
216
217To have valid
218``href`` in the metadata children of a ``wps:Process``, you have to
219define the ``registryUrl`` to point to the path to browse the
220registry. For this you have two different options, the first one is to
221install the ``GetFromRegistry`` ZOO-Service and to use a WPS 1.0.0
222Execute request as ``registryUrl`` to dynamically generate `Process
223Concept <http://docs.opengeospatial.org/is/14-065/14-065.html#33>`__,
224`Generic Process Profile
225<http://docs.opengeospatial.org/is/14-065/14-065.html#34>`__ and
226`Process Implementation Profile
227<http://docs.opengeospatial.org/is/14-065/14-065.html#35>`__.
228You also have to add a ``registryUrl`` to the ``[main]`` section to
229inform the ZOO-Kernel that it should use the Registry Browser to
230create the href attribute of Metadata nodes. So by adding the
231following line:
232
233.. code::
234
235    registryUrl = http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=GetFromRegistry&RawDataOutput=Result&DataInputs=id=
236
237The second option is to pre-generate each level of the hierarchy by
238running shell commands then set ``registryUrl`` to the URL to browse
239the generated files. In such a case, you will also have to define the
240``registryExt`` and set it to the file extension you used to generate
241your registry cache.
242
243To generate the cache in ``/opt/zoo/registry/``, use the following command:
244
245.. code::
246
247    cd /usr/lib/cgi-bin
248    mkdir /opt/zoo/regcache/{concept,generic,implementation}
249    for i in $(find /opt/zoo/registry/ -name "*.*") ;
250    do 
251        j=$(echo $i | sed "s:../registry//::g;s:.zcfg::g;s:.txt::g") ;
252       if [ -z "$(echo $j | grep concept)" ];
253       then
254           ext="xml" ;
255       else
256           ext="txt";
257       fi
258        ./zoo_loader.cgi "request=Execute&service=wps&version=1.0.0&Identifier=GetFromRegistry&RawDataOutput=Result&DataInputs=id=$j" | grep "<" > /opt/zoo/regcache/$j.$ext;
259    done
260
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png