1 | .. _process-profiles: |
---|
2 | |
---|
3 | Process profiles registry |
---|
4 | ================ |
---|
5 | |
---|
6 | WPS Services belonging to the same Services provider often share the |
---|
7 | same inputs and outputs. In such a case, every :ref:`ZCFG |
---|
8 | <services-zcfg>` file would contain the same metadata information and |
---|
9 | this may be a waste of time to write them all. |
---|
10 | |
---|
11 | :ref:`ZOO-Kernel <kernel_index>` is able to handle metadata inheritance from `rev. 607 <http://www.zoo-project.org/trac/changeset/607>`__, and this solves the issue of writing many ZCFG with same input and output. A registry can be loaded (before any other ZCFG files) and contain a set of Process Profiles organized in hierarchic levels according to the following rules: |
---|
12 | |
---|
13 | * *Concept*: The higher level in the hierarchy. *Concepts* are basic text files containing an abstract description of a WPS Service. |
---|
14 | * *Generic*: A *Generic* profile can make reference to *Concepts*. It defines inputs and outputs without data format or maximum size limitation. |
---|
15 | * *Implementation*: An *Implementation* profile can inherit from a |
---|
16 | generic profile and make reference to concepts. It contains all |
---|
17 | the metadata information about a particular WPS Service (see |
---|
18 | :ref:`ZCFG reference <services-zcfg>` for more information). |
---|
19 | |
---|
20 | Both *Generic* and *Implementation* process profiles are created from :ref:`ZCFG <services-zcfg>` files and stored in the registry sub-directories |
---|
21 | according to their level (*Concept*, *Generic* or *Implementation*). |
---|
22 | |
---|
23 | To activate the registry, you have to add a ``registry`` key to the |
---|
24 | ``[main]`` section of your ``main.cfg`` file, and set its value to the |
---|
25 | directory path used to store the profile ZCFG files. |
---|
26 | |
---|
27 | |
---|
28 | Generic Process Profile |
---|
29 | ----------------------- |
---|
30 | |
---|
31 | A Generic Process Profile is a ZCFG file located in the ``generic`` |
---|
32 | sub-directory, it defines `main metadata information |
---|
33 | <zcfg-reference.html#main-metadata-information>`__, inputs and outputs |
---|
34 | name, basic metadata and multiplicity. It can make reference to a |
---|
35 | concept by defining a ``concept`` key in the `main metadata |
---|
36 | information <zcfg-reference.html#main-metadata-information>`__ part. |
---|
37 | |
---|
38 | You can find below the `GO.zcfg` file, a typical Generic Process |
---|
39 | Profile for Generic Geographic Operation, taking one InputPolygon |
---|
40 | input parameter and returning a result named Result, it make reference |
---|
41 | to the ``GOC`` concept: |
---|
42 | |
---|
43 | .. code-block:: none |
---|
44 | :linenos: |
---|
45 | |
---|
46 | [GO] |
---|
47 | Title = Geographic Operation |
---|
48 | Abstract = Geographic Operation on exactly one input, returning one output |
---|
49 | concept = GOC |
---|
50 | level = generic |
---|
51 | statusSupported = true |
---|
52 | storeSupported = true |
---|
53 | <DataInputs> |
---|
54 | [InputPolygon] |
---|
55 | Title = the geographic data |
---|
56 | Abstract = the geographic data to run geographipc operation |
---|
57 | minOccurs = 1 |
---|
58 | maxOccurs = 1 |
---|
59 | </DataInputs> |
---|
60 | <DataOutputs> |
---|
61 | [Result] |
---|
62 | Title = the resulting data |
---|
63 | Abstract = the resulting data after processing the operation |
---|
64 | </DataOutputs> |
---|
65 | |
---|
66 | |
---|
67 | .. Note:: if you need to reference more than one concept, you should |
---|
68 | separate their names with a comma (ie. concept = GO,GB), |
---|
69 | |
---|
70 | Process Implementation Profile |
---|
71 | ------------------------------ |
---|
72 | |
---|
73 | A Process Implementation Profile is similar to a `ZCFG file |
---|
74 | <zcfg-reference.html>`__ located in the `implementation` |
---|
75 | sub-directory, it defines (or inherit from its parent) all the |
---|
76 | properties of a `Generic Process Profile <#generic-process-profile>`__ |
---|
77 | and specify `Data Format <zcfg-reference.html#type-of-data-nodes>`__ |
---|
78 | for both inputs and outputs. It can make reference to a concept by |
---|
79 | defining a ``concept`` key in the `main metadata information |
---|
80 | <zcfg-reference.html#main-metadata-information>`__ part. |
---|
81 | |
---|
82 | You can find below the `VectorOperation.zcfg` file, a typical Process |
---|
83 | Implementation Profile for Vector Geographic Operation, it inherit |
---|
84 | from the `GP generic profile <#generic-process-profile>`__: |
---|
85 | |
---|
86 | .. code-block:: none |
---|
87 | :linenos: |
---|
88 | |
---|
89 | [VectorOperation] |
---|
90 | Title = Vector Geographic Operation |
---|
91 | Abstract = Apply a Vector Geographic Operation on a features collection and return the resulting features collection |
---|
92 | extend = GO |
---|
93 | level = profile |
---|
94 | <DataInputs> |
---|
95 | [InputPolygon] |
---|
96 | Title = the vector data |
---|
97 | Abstract = the vector data to run geographic operation |
---|
98 | <ComplexData> |
---|
99 | <Default> |
---|
100 | mimeType = text/xml |
---|
101 | encoding = UTF-8 |
---|
102 | schema = http://fooa/gml/3.1.0/polygon.xsd |
---|
103 | </Default> |
---|
104 | <Supported> |
---|
105 | mimeType = application/json |
---|
106 | encoding = UTF-8 |
---|
107 | extension = js |
---|
108 | </Supported> |
---|
109 | </DataInputs> |
---|
110 | <DataOutputs> |
---|
111 | [Result] |
---|
112 | Title = the resulting data |
---|
113 | Abstract = the resulting geographic data after processing the operation |
---|
114 | <ComplexData> |
---|
115 | <Default> |
---|
116 | mimeType = text/xml |
---|
117 | encoding = UTF-8 |
---|
118 | schema = http://fooa/gml/3.1.0/polygon.xsd |
---|
119 | </Default> |
---|
120 | <Supported> |
---|
121 | mimeType = application/json |
---|
122 | encoding = UTF-8 |
---|
123 | extension = js |
---|
124 | </Supported> |
---|
125 | </ComplexData> |
---|
126 | </DataOutputs> |
---|
127 | |
---|
128 | |
---|
129 | ZCFG inheritance |
---|
130 | ---------------------------------- |
---|
131 | |
---|
132 | For the ZCFG files at the service level, you can inherit the metadata |
---|
133 | from a Process Implementation Profile available in the registry. As |
---|
134 | before, you simply need to add a ``extend`` key refering the ZCFG you |
---|
135 | want to inherit from and a ``level`` key taking the `ìmplementation`` |
---|
136 | value to your main metadata informations. |
---|
137 | |
---|
138 | So, for example, the original `ConvexHull.zcfg |
---|
139 | <http://www.zoo-project.org/trac/browser/trunk/zoo-project/zoo-services/ogr/base-vect-ops/cgi-env/ConvexHull.zcfg?rev=491>`__ |
---|
140 | may be rewritten as: |
---|
141 | |
---|
142 | .. code-block:: none |
---|
143 | :linenos: |
---|
144 | |
---|
145 | [ConvexHull] |
---|
146 | Title = Compute convex hull. |
---|
147 | Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection. |
---|
148 | serviceProvider = ogr_service.zo |
---|
149 | serviceType = C |
---|
150 | extend = VectorOperation |
---|
151 | level = implementation |
---|
152 | |
---|
153 | Now, suppose that your service is able to return the result in KML |
---|
154 | format, then you may write the following: |
---|
155 | |
---|
156 | .. code-block:: none |
---|
157 | :linenos: |
---|
158 | |
---|
159 | [ConvexHull] |
---|
160 | Title = Compute convex hull. |
---|
161 | Abstract = Return a feature collection that represents the convex hull of each geometry from the input collection. |
---|
162 | serviceProvider = ogr_service.zo |
---|
163 | serviceType = C |
---|
164 | extend = VectorOperation |
---|
165 | level = implementation |
---|
166 | <DataOutputs> |
---|
167 | [Result] |
---|
168 | <Supported> |
---|
169 | mimeType = application/vnd.google-earth.kml+xml |
---|
170 | encoding = utf-8 |
---|
171 | </Supported> |
---|
172 | </DataOutputs> |
---|