Difference between revisions of "Advanced Input"
From Gcube Wiki
(→Coordinate Systems, Location and Zoom) |
(→Basic Type) |
||
(34 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
:This page explains how to use advanced input definitions when developing an algorithm. These indications are valid for algorithms developed using both the [[Statistical Algorithms Importer|Statistical Algorithms Importer (SAI)]] and [[DataMiner Manager|DataMiner]]. | :This page explains how to use advanced input definitions when developing an algorithm. These indications are valid for algorithms developed using both the [[Statistical Algorithms Importer|Statistical Algorithms Importer (SAI)]] and [[DataMiner Manager|DataMiner]]. | ||
+ | |||
+ | ==Basic Type== | ||
+ | :The basic types already supported by the [[Statistical Algorithms Importer|Statistical Algorithms Importer (SAI)]] interface are those shown here: | ||
+ | |||
+ | [[Image:DataMinerManager_BasicType1.png|thumb|center|100px|Basic Type, DataMiner]] | ||
==Spatial Data== | ==Spatial Data== | ||
Line 100: | Line 105: | ||
===Coordinate Systems, Location and Zoom=== | ===Coordinate Systems, Location and Zoom=== | ||
− | :Is possible to add further information by COORDS tag | + | :Is possible to add further information by COORDS tag which allows to define the coordinate system, the location in terms of longitude and latitude, and the zoom level: |
:<span style="font-weight:bold;">[COORDS_{System}_{Longitude}_{Latitude}_{Zoom}]</span> | :<span style="font-weight:bold;">[COORDS_{System}_{Longitude}_{Latitude}_{Zoom}]</span> | ||
:Possible values for <span style="font-weight:bold;">{System}</span> are: | :Possible values for <span style="font-weight:bold;">{System}</span> are: | ||
Line 107: | Line 112: | ||
:Possible values for <span style="font-weight:bold;">{Zoom}</span> are integer from 0 to 20. | :Possible values for <span style="font-weight:bold;">{Zoom}</span> are integer from 0 to 20. | ||
− | : | + | :For example, therefore it is possible to specify in SAI in the case of points: |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 217: | Line 222: | ||
:After info icon button is pressed: | :After info icon button is pressed: | ||
[[Image:DataMinerManager_NetCDF3.png|thumb|center|700px|NetCDF Preview, DataMiner]] | [[Image:DataMinerManager_NetCDF3.png|thumb|center|700px|NetCDF Preview, DataMiner]] | ||
+ | |||
+ | ==List Of Strings== | ||
+ | ===List Of Strings in SAI=== | ||
+ | :For List of strings we can use the [a sequence of values separated by # ] tag: | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name | ||
+ | ! Description | ||
+ | ! Type | ||
+ | ! Default | ||
+ | ! I/O | ||
+ | |- | ||
+ | | values | ||
+ | | Values <span style="color:red">[a sequence of values separated by # ]</span> | ||
+ | | String | ||
+ | | hello | ||
+ | | Input | ||
+ | |} | ||
+ | |||
+ | ===List Of Strings in DataMiner=== | ||
+ | |||
+ | :In the following, what is shown in DataMiner (Example: [https://services.d4science.org/group/rprototypinglab/data-miner?OperatorId=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SEQUENCE_OF_VALUES_EXAMPLE SEQUENCE_OF_VALUES_EXAMPLE]) : | ||
+ | : | ||
+ | [[Image:DataMinerManager_SequenceOfStringExample.png|thumb|center|700px|Sequence Of Values selection, DataMiner]] | ||
+ | |||
+ | |||
+ | ==Workspace Interaction by Item Id== | ||
+ | ===Item Id in SAI=== | ||
+ | :SAI and DataMiner allows support and interaction with the workspace and therefore with the [[StorageHub_REST_API|StorageHub]] service through the definition of input of type ItemId. An item can be a file or a folder of the workspace. The ItemId represents the identifier of that item within the [[StorageHub_REST_API|StorageHub]] service. | ||
+ | :To define an ItemId type parameter just add the following tag in the parameter description: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name | ||
+ | ! Description | ||
+ | ! Type | ||
+ | ! Default | ||
+ | ! I/O | ||
+ | |- | ||
+ | | itemId | ||
+ | | Item Id <span style="color:red">[ITEMID]</span> | ||
+ | | String | ||
+ | | item0 | ||
+ | | Input | ||
+ | |} | ||
+ | |||
+ | :Once the ItemId has been recovered, it can be used within the algorithm by invoking the Rest API of the [[StorageHub_REST_API|StorageHub]] service, see the related documentation. | ||
+ | |||
+ | ===Item Id in DataMiner=== | ||
+ | :This is the interface shown in DataMiner Manager: | ||
+ | [[Image:DataMinerManager_ItemId.png|thumb|center|700px|Item selection, DataMiner]] | ||
==Other Inputs== | ==Other Inputs== | ||
Line 222: | Line 278: | ||
* '''File Input:''' [a http link to a file] (Example: [https://i-marine.d4science.org/group/biodiversitylab/data-miner?OperatorId=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.FEED_FORWARD_A_N_N_DISTRIBUTION FEED_FORWARD_A_N_N_DISTRIBUTION]) | * '''File Input:''' [a http link to a file] (Example: [https://i-marine.d4science.org/group/biodiversitylab/data-miner?OperatorId=org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.FEED_FORWARD_A_N_N_DISTRIBUTION FEED_FORWARD_A_N_N_DISTRIBUTION]) | ||
− | |||
− | |||
Supported only by Java APIs(no SAI) see [https://gcube.wiki.gcube-system.org/gcube/How-to_Implement_Algorithms_for_DataMiner How-to Implement Algorithms for DataMiner]: | Supported only by Java APIs(no SAI) see [https://gcube.wiki.gcube-system.org/gcube/How-to_Implement_Algorithms_for_DataMiner How-to Implement Algorithms for DataMiner]: |
Latest revision as of 12:02, 16 September 2021
- This page explains how to use advanced input definitions when developing an algorithm. These indications are valid for algorithms developed using both the Statistical Algorithms Importer (SAI) and DataMiner.
Basic Type
- The basic types already supported by the Statistical Algorithms Importer (SAI) interface are those shown here:
Spatial Data
Defining Spatial Data
- Spatial Data input are passed to an algorithm using Well-Known Text format (WKT), i.e. a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems.[1]
- When an algorithm input is defined, a WKT input can be indicated by using proper annotations in the input descriptions. In particular, the annotations highlighted in red in the following table correspond to different geometries. For example a description for an input point could be "Location of an occurrence record [WKT_POINT]".
The currently produced CRS is EPSG:4326 (Examples are still in EPSG:3857).
Name | Description | Type | Default | I/O |
---|---|---|---|---|
wktPoint | wktPoint [WKT_POINT] | String | POINT(-12993071.816027395 7729312.300197024) | Input |
wktLineString | wktLineString [WKT_LINESTRING] | String | LINESTRING(-16476154.320926309 7161843.802207875,-14617205.79303082 7514065.628545967,-12777825.14437634 6790054.096628778,-12601714.231207293 8081534.126535116,-11271098.442818945 7416226.232340941,-11329802.08054196 6261721.357121639) | Input |
wktPolygon | wktPolygon [WKT_POLYGON] | String | POLYGON((-15967389.460660174 7377090.473858931,-14264983.966692729 8257645.039704162,-12895232.41982237 7416226.232340941,-13423565.159329507 5811660.134578522,-13932330.019595642 7181411.681448881,-16123932.494588215 6750918.338146768,-15967389.460660174 7377090.473858931)) | Input |
wktTriangle | wktTriangle [WKT_TRIANGLE] | String | POLYGON((-16495722.200167313 7259683.198412901,-15855087.594353283 8572650.25102042,-17312467.71915039 8470972.56789504,-16495722.200167313 7259683.198412901)) | Input |
wktSquare | wktSquare [WKT_SQUARE] | String | POLYGON((-16495722.200167313 7259683.198412901,-15855087.594353283 8572650.25102042,-17312467.71915039 8470972.56789504,-16495722.200167313 7259683.198412901)) | Input |
wktPentagon | wktPentagon [WKT_PENTAGON] | String | POLYGON((-14284551.845933735 6437832.270290686,-13783375.299284551 7626538.339655062,-14759029.882416394 8470515.936910307,-15863194.122720666 7803416.7083931435,-15569950.56925907 6547149.114045457,-14284551.845933735 6437832.270290686)) | Input |
wktHexagon | wktHexagon [WKT_HEXAGON] | String | POLYGON((-11995109.97473614 8492459.590596221,-11950593.230512831 9941648.908612307,-13183369.622696154 10704796.199011508,-14460662.759102784 10018754.171394624,-14505179.503326092 8569564.853378538,-13272403.11114277 7806417.562979337,-11995109.97473614 8492459.590596221)) | Input |
wktBox | wktBox [WKT_BOX] | String | POLYGON((-11995109.97473614 8492459.590596221,-11950593.230512831 9941648.908612307,-13183369.622696154 10704796.199011508,-14460662.759102784 10018754.171394624,-14505179.503326092 8569564.853378538,-13272403.11114277 7806417.562979337,-11995109.97473614 8492459.590596221)) | Input |
wktCircle | wktCircle [WKT_CIRCLE] | String | POLYGON((-12582146.351966292 8101102.005776119,-12437487.643413674 8354330.862998396,-12345011.010682397 8630915.512769304,-12308270.27890683 8920226.962108605,-12328677.373804664 9211147.13426592,-12405448.062163413 9492496.130175157,-12535632.089482944 9753461.865705855,-12714226.55660141 9984015.573992845,-12934368.178304384 10175297.205322662,-13187597.035526661 10319955.91387528,-13464181.68529757 10412432.546606557,-13753493.13463687 10449173.278382126,-14044413.306794185 10428766.18348429,-14325762.302703422 10351995.495125541,-14586728.03823412 10221811.467806011,-14817281.74652111 10043217.000687543,-15008563.377850927 9823075.37898457,-15153222.086403545 9569846.521762293,-15245698.719134822 9293261.871991385,-15282439.45091039 9003950.422652084,-15262032.356012555 8713030.250494769,-15185261.667653807 8431681.254585532,-15055077.640334276 8170715.519054834,-14876483.173215808 7940161.810767845,-14656341.551512836 7748880.179438027,-14403112.694290558 7604221.470885409,-14126528.04451965 7511744.838154132,-13837216.59518035 7475004.106378564,-13546296.423023034 7495411.2012764,-13264947.427113798 7572181.8896351475,-13003981.691583099 7702365.9169546785,-12773427.983296111 7880960.384073146,-12582146.351966292 8101102.005776119)) | Input |
Spatial Data on the DataMiner Interface
- By using a specific widget, DataMiner is able to build a selection interface suited for the WKT input. This process is done by reading the annotation in the input description. The widget allows to easily select the area of interest and reports the WKT selected in a text area. In the end, the WKT string is passed to the algorithm:
Coordinate Systems, Location and Zoom
- Is possible to add further information by COORDS tag which allows to define the coordinate system, the location in terms of longitude and latitude, and the zoom level:
- [COORDS_{System}_{Longitude}_{Latitude}_{Zoom}]
- Possible values for {System} are:
- EPSG:4326
- EPSG:3857
- Possible values for {Zoom} are integer from 0 to 20.
- For example, therefore it is possible to specify in SAI in the case of points:
Name | Description | Type | Default | I/O |
---|---|---|---|---|
wktPoint | wktPoint [WKT_POINT][COORDS_EPSG:4326_10.4036000_43.7085300_10] | String | POINT(10.4036000 43.7085300) | Input |
wktPoint | wktPoint [WKT_POINT][COORDS_EPSG:3857_1157959.13_5421707.03_10] | String | POINT(1157959.13 5421707.03) | Input |
- Results in DataMiner interface:
Temporal Data
Temporal Data
- Temporal Data are automatically interpreted using specific tags in the description of the inputs. The tags highlighted in red in the following table should be used to indicate the kind of temporal information to associate to the input. Currently, dates and time stamps are supported. For example a description for an input date could be "Date of the occurrence record [DATE]".
Name | Description | Type | Default | I/O |
---|---|---|---|---|
dateParameter | dateParameter [DATE] | String | 2016-04-01 | Input |
timeParameter | timeParameter [TIME] | String | 15:22:01 | Input |
Temporal Data on DataMiner
- A widget on DataMiner is able to transform the annotations into a selection panel. In the following, two examples are reported:
Long strings and TextArea
TextArea in SAI
- DataMiner for string parameters uses a TextField widget as default. There are cases where it is more useful to use a TextArea widget. To enable TextArea, just add the [TEXTAREA] tag to the description of the parameter in SAI.
Name | Description | Type | Default | I/O |
---|---|---|---|---|
PInput1 | Long string parameter [TEXTAREA] | String | long string... | Input |
TextArea in DataMiner
- In the following, what is shown in DataMiner:
NetCDF
NetCDF in SAI
- NetCDF (.nc) file information view is supported. There are cases where it is useful to see the information contained in the NetCDF files. To enable the NetCDF Preview, just add the [NETCDF] tag to the description of the parameter in SAI.
Name | Description | Type | Default | I/O |
---|---|---|---|---|
netCDFFile | NetCDF file [NETCDF] | File | netcdffile.nc | Input |
NetCDF in DataMiner
- In the following, what is shown in DataMiner:
- After NetCDF file is selected:
- After info icon button is pressed:
List Of Strings
List Of Strings in SAI
- For List of strings we can use the [a sequence of values separated by # ] tag:
Name | Description | Type | Default | I/O |
---|---|---|---|---|
values | Values [a sequence of values separated by # ] | String | hello | Input |
List Of Strings in DataMiner
- In the following, what is shown in DataMiner (Example: SEQUENCE_OF_VALUES_EXAMPLE) :
Workspace Interaction by Item Id
Item Id in SAI
- SAI and DataMiner allows support and interaction with the workspace and therefore with the StorageHub service through the definition of input of type ItemId. An item can be a file or a folder of the workspace. The ItemId represents the identifier of that item within the StorageHub service.
- To define an ItemId type parameter just add the following tag in the parameter description:
Name | Description | Type | Default | I/O |
---|---|---|---|---|
itemId | Item Id [ITEMID] | String | item0 | Input |
- Once the ItemId has been recovered, it can be used within the algorithm by invoking the Rest API of the StorageHub service, see the related documentation.
Item Id in DataMiner
- This is the interface shown in DataMiner Manager:
Other Inputs
Supported by SAI:
- File Input: [a http link to a file] (Example: FEED_FORWARD_A_N_N_DISTRIBUTION)
Supported only by Java APIs(no SAI) see How-to Implement Algorithms for DataMiner:
- Table Input: [a http link to a table ] (Example: DBSCAN)
- List of Tables: [a sequence of http links separated by | , each indicating a table ] (Example BIOCLIMATE_HCAF)
- List of columns from a table: [a sequence of names of columns from <NameOfTheTableParameter> separated by | ] (Example: FEED_FORWARD_A_N_N_DISTRIBUTION)
- Column name from a table: [the name of a column from <NameOfTheTableParameter> ] (Example: OCCURRENCE_ENRICHMENT)