...
The FEWS PI-JSON format is following the FEWS PI-XML format as described in httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pi-schemas/.
Since 2017.02 the PI-JSON format is supported for the following GET resources in the PI REST Web Service:
- filters: httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pi-schemas/pi_filters.xsd
- parameters: httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pi-schemas/pi_parameters.xsd
- locations: httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pi-schemas/pi_locations.xsd
- timeSeries: httphttps://fewsfewsdocs.wldelftdeltares.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd
The following conventions have been used to make PI-XML compatible with the JSON format:
- consistent use of camel case. Where some PI-XML elements start with a upperCase, the camelCase convention is used for all JSON objects. For example the timeSeries.xsd of PI-XML defines the root element as TimeSeries. In PI-JSON it is called timeSeries. All JSON properties use the camelCase convention.
- Implicit object names are left out. For example in the timeSeries.xsd of PI-XML timeSeries is defined as a sequence of series elements. In PI-JSON the element "series" is left out.
- Values are always quoted.
- XML attributes are transformed to JSON properties.
Python Example
See FEWS PI-JSON can be easily read using Python. The following example shows how to read PI-JSON timeseries using the requests module. The result contains a dictionary with timeSeries.
...
language | py |
---|
...
REST Examples for some examples on how the PI-JSON format can be used from for example Python or JavaScript.