agroJSON is a JSON schema designed to simplify client-server communication along the agricultural production and supply chain. It closely follows the specifications made by agroXML, however introduces some simplifications geared towards (client side) web use.
XML and JSON both have their benefits. However, XML shines with features like
attributes
, namespacing
, and well established schema validation. This makes it
especially suitable for the heterogenous requirements present in the agricultural
production and supply chain. In server-to-server, Java and many other environments, agroXML should therefore remain the preferred way of communication.
With the establishment and uptake of modern web frameworks such as Angular, React and Vue, feature-rich client applications are becoming more and more popular. In most cases, these client applications directly leverage RESTful API's in order to provide content to their users. Since these client applications are largely written in JavaScript, and JSON (JavaScript Object Notation) being natively supported to be parsed by JavaScript, using JSON has become a de-facto standard for exchanging data between web services and clients. agroJSON aims to be a drop-in replacement for agroXML in client-server scenarios where JSON would be preferred over XML.
In agroXML, spatial data is written in a subset (profile) of Geography Markup Language (GML), being an XML grammar. As agroJSON builds on the JSON format, GeoJSON is used to describe spatial data instead. An advantage of using GeoJSON as the default spatial data format is that all of the popular JavaScript mapping libraries, e.g. Leaflet, Mapbox, OpenLayers, as well as Google Maps, support GeoJSON out of the box. In order to maximize compatibility with these mapping services, coordinates are represented using the Web Mercator Projection (WGS 84, EPSG:3857) instead of the ETRS89/EPSG:25832 projection commonly used in Europe.
Contribution is highly appreciated!
Current ToDo's involve the following
- Get example agroXML files for the different modules described on the official website: http://195.37.233.20/documentation/agroxml.html
- Further cleanup of the JSON schema (due to automatic conversion from the agroXML XSDs)
- Conversion tool between agroXML <-> agroJSON
If you are interested in helping out, please open an issue, pull request or drop a mail at fruchtfolge@uni-bonn.de!
Make sure to npm test
before creating a pull request.
MIT