Producing world
class leaders...
Open for Business...

Agriculture API URI Schema

 

Table

Column

Crops

-        FarmerId

-        PropertyId

-        Parish

-        Extension

-        District

-        Farm (?)

-        FarmSize* (micro, small, medium, medium-large, )

-        FarmerAge

-        Group

-        Crop group

-        Group type

-        CropArea

-        CropCount

-        CropDate

-        PropertySize

-        xCoord

-        yCoord

Farms

-        FarmerSize*

-        FarmerAge

-        Firstname

-        Lastname

-        FarmerId

-        PropertyId

-        Parish

-        Extension

-        district

-        Farm (?)

-        PropertySize

-        xCoord

-        yCoord

Prices

-        Parish

-        cropType

-        price

-        priceMonth

 

 

 

URI Root: http://data/org.jm/api/...

URI

Description

Example

This Documentation: http://data.org.jm/documentation.html

Queries

/crops

Returns the hierarchy of values for CropGroups / CropTypes and production summary

 

/crops/parishes

Returns the hierarchy of values for Parishes / CropTypes (i.e. available croptype data by Parish)

 

/farms

OR

/farms/parishes

Returns a tabular (xml) summary of Farms in the database by Parish; includes counts and total PropertySize

 

/farms/parishes/extensions

/farms/parishes/extensions/districts

Returns a tabular (xml) summary of Farms in the database by Parish/Extension/District; includes counts and total PropertySize

 

/prices

OR

/prices/parishes

Returns the average values of Prices for Parish / CropTypes (i.e. croptypes for which there is pricing information per Parish)

 

 

Parameters/Arguments

 

In addition to the basic URI schema above, data can be selected using Argument based Queries

/?([col_ident] [delim] [$var]

In cases where Arguments are presented with the URL, all data column values are returned for rows satisfying the specified Queries

Date Parameters

Date arguments are specified by indicating startdate and/or enddate parameters. A range is indicated using both parameters

eg. 2009 is &startdate=2009-01-01&enddate=2009-12-31

eg. After Aug2009 is &startdate=2009-08-01

eg. Jan09 Aug10 is &startdate=2009-01-01&enddate=2010-08-30

 

Paging

Queries are limited to returning a maximum of 1,000 records at a time. In order to manipulate a large result-set, developers can use the following Paging parameters:

per_page number of results per page, for pagination of the result-set. Default setting is 50

page utility parameter for paging through a large result-set. Indicates the page number requested from the recordset.
eg. /farms/?parish=stcatherine&per_page=100&page=2

 

 

Aggregates

 

In cases where developers need to aggregate data across large (or the entire) data-set, Aggregate parameters may be used. Eg. To find the largest tomato farmer in St. Catherine. The following Aggregate parameters will be Available: Count, Sum, Max, Top

Count

eg. # of Farms in St. Catherine:

/farms/?parish=stcatherine&count

Sum=[col_ident]

Eg. Total Acreage of Banana production in Portland last year: /crops/?parish=portland&cropdate=2009&Sum=CropArea

Max=[col_ident]

Eg. Largest yam production Farm in Trelawny:

/crops/?parish=trelawny&Max=CropArea

Top=[col_ident]

i.e. Top20%

There are cases where it is more useful to find the Top 20%, rather than a single Maximum..

Eg. Largest Cassava producers islandwide, last year

/crops/? &Top=CropArea&cropdate=2009

Not sure how easy this is to implement

NB> Developers could accomplish these results using standard queries, paging parameters and local processing, however this will be more efficient

 

Use Case Scenarios

Use Case

Query

Crops planted in St Elizabeth

/crops/?parish=st.elizabeth

Carrots planted across the island

/crops/?croptype=carrot

Carrots planted over time period Jan09 Aug10

/crops/?croptype=carrot&startdate=2009-01-01&enddate= 2010-08-30

Credit proxy by microfinance institution

Farmer products over last year

/crops/?FarmerID=90410367&startdate=2009-01-01&enddate=2009-12-31

Number and size of properties

farms/?FarmerID=90410367&count &Sum=PropertySize

Price of crops planted

/crops/?FarmerID=90410367&startdate=2009-01-01

/prices/?croptype=Pumpkin

Number / Area of other farms planting same crops

/crops/?croptype=xxxxxxx&count&Sum=CropArea

Farmers

Crops of other farms growing in an area

/crops/?parish=st.elizabeth&district=junction

Highest producing crop last year

/crops&startdate=2009-01-01&enddate=2009-12-31&Max=CropArea

Price of a particular crop

/prices/?croptype=Green Banana

Best place to sell a crop

/prices/?croptype=cassava&Top=PriceAvg

Supermarket/Retailers/Agro-producers

Largest producers of a crop

 

Best places to buy a crop

 

Properties near a particular plant

 

RADA / Government Agency / Min Of Agriculture

Most efficient farmer

 

Highest growing extension, district, parish

 

Which farmer sizes are most efficient

 

Farmer sizes or properties that are under performing