The vast majority of the data collected and processed in the Mo.Re.Farming project is freely accessible through a set of public RESTful APIs.
Please read below to discover how these APIs can be used. Full documentation will be published soon.
Link: http://semantic.csr.unibo.it/morefarming/api/data-lake
This layer of APIs exposes the contents of the Data Lake, lying in an 11-node Hadoop cluster. Use this API to download the following contents.
Unfortunately, due to license regulation, rural land and crop data are not available for download at this time.
Link: http://semantic.csr.unibo.it/morefarming/api/ods
This layer of APIs is linked to the Operational Data Store (ODS) of the Mo.Re.Farming platform, which lies on a PostGIS DBMS. These APIs let you gather punctual information on a specific geo-referenced point in the Emilia-Romagna region, comprising values for the following indexes: NDVI, NDRE, NDWI, and MTCI (i.e., the information that is shown by the dashboard).
Usage of these APIs is fairly straightforward. Just issue a GET request to the provided link stating the following parameters:Example: http://semantic.csr.unibo.it/morefarming/api/ods?latitude=4910820&longitude=753335&date=2016-08-17
Link: http://semantic.csr.unibo.it/morefarming/api/ods
This layer of APIs is linked to the Spatial Cube of the Mo.Re.Farming platform, which lies on a PostGIS DBMS. The Saiku interface has already been deployed in order to expose the cube to OLAP queries. Since Saiku already comes with its own set of APIs, we can reuse them to execute OLAP queries on the spatial cube in a RESTful way.
Saiku API docs: https://community.meteorite.bi/docs/#home
Access point: http://semantic.csr.unibo.it:8082/saiku/rest/saiku/morefarming
Examples:
Queries must be written in the MDX language, which requires you to know the names of dimensions and measures in the cube (see GET requests above). An example of MDX query on the Mo.Re.Farming cube is the following:
WITH SET [~FILTER] AS {[Crop].[Crop].[IRRIGUO].[POMODORO]} SET [~COLUMNS] AS {[Date].[Date (by month)].[Month].Members} SET [~ROWS] AS {[Rural land].[Rural land].[Province].Members} SELECT NON EMPTY CrossJoin([~COLUMNS], {[Measures].[NDVI (avg)]}) ON COLUMNS, NON EMPTY [~ROWS] ON ROWS FROM [Indices] WHERE [~FILTER]
This returns the average NDVI for fields of tomato in every province and in every month. The complete POST request (which must be preceeded by authentication via POST) would require the following parameters: