zeginis / JSON-QB-REST-API

0 stars 0 forks source link

Updating json response format to match visualization needs #8

Closed mohadelrezk closed 7 years ago

mohadelrezk commented 7 years ago

our visualization tools expects the following json response (result) format:

path: cubeQueryingAPI/LqbMeta? dsuri=http%3A%2F%2Fogi.eu%2F%23RPBYmunicipality_ds&limit=500)

results:

[{"name":"3","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#municipality","type":"http://purl.org/linked-data/cube#dimension"},{"name":"6","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#county","type":"http://purl.org/linked-data/cube#dimension"},{"name":"5","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#counrty","type":"http://purl.org/linked-data/cube#dimension"},{"name":"4","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#sex","type":"http://purl.org/linked-data/cube#dimension"},{"name":"1","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#time_period","type":"http://purl.org/linked-data/cube#dimension"},{"name":"1","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#resident_population_at_the_beginning_of_the_year_persons","type":"http://purl.org/linked-data/cube#measure"},{"name":"2","type":"http://purl.org/linked-data/cube#order"},{"name":"http://ogi.eu/#age","type":"http://purl.org/linked-data/cube#dimension"}]

path:

cubeQueryingAPI/listdataofLqb?dsuri=http%3A%2F%2Fogi.eu%2F%23IWaveBNetwork30Min_ds&limit=500

results:

[{"SeaTemperature":"","latitude":"54.233932","MeanCurDirTo":"","Time":"2016-08-29T11:00:00Z","PeakPeriod_qc":"0.0","SignificantWaveHeight":"","TimebyYear":"2016","Hmax_qc":"0.0","longitude":"-10.1429","UpcrossPeriod":"","station_id":"Belmullet Wave Buoy Berth B","PeakPeriod":"","UpcrossPeriod_qc":"0.0","SeaTemperature_qc":"0.0","TimebyMonth":"2016-08","THmax":"4.2","THmax_qc":"0.0","PeakDirection":"","TimebyDay":"2016-08-29","MeanCurSpeed":"","SignificantWaveHeight_qc":"0.0","MeanCurSpeed_qc":"0.0","PeakDirection_qc":"0.0","MeanCurDirTo_qc":"0.0","Hmax":"174.0"},{"SeaTemperature":"16.5","latitude":"53.227","MeanCurDirTo":"","Time":"2016-08-30T13:25:00Z","PeakPeriod_qc":"0.0","SignificantWaveHeight":"","TimebyYear":"2016","Hmax_qc":"0.0","longitude":"-9.271","UpcrossPeriod":"","station_id":"Galway Bay Wave Buoy","PeakPeriod":"","UpcrossPeriod_qc":"0.0","SeaTemperature_qc":"0.0","TimebyMonth":"2016-08","THmax":"","THmax_qc":"0.0","PeakDirection":"","TimebyDay":"2016-08-30","MeanCurSpeed":"","SignificantWaveHeight_qc":"0.0","MeanCurSpeed_qc":"0.0","PeakDirection_qc":"0.0","MeanCurDirTo_qc":"0.0","Hmax":""},{"SeaTemperature":"16.55","latitude":"53.227","MeanCurDirTo":"","Time":"2016-08-25T01:45:00Z","PeakPeriod_qc":"0.0","SignificantWaveHeight":"","TimebyYear":"2016","Hmax_qc":"0.0","longitude":"-9.271","UpcrossPeriod":"","station_id":"Galway Bay Wave Buoy","PeakPeriod":"","UpcrossPeriod_qc":"0.0","SeaTemperature_qc":"0.0","TimebyMonth":"2016-08","THmax":"","THmax_qc":"0.0","PeakDirection":"","TimebyDay":"2016-08-25","MeanCurSpeed":"","SignificantWaveHeight_qc":"0.0","MeanCurSpeed_qc":"0.0","PeakDirection_qc":"0.0","MeanCurDirTo_qc":"0.0","Hmax":""}, .....

Example draft for adapting the API to visualization requirements: https://github.com/mohadelrezk/ogi-drafts/blob/master/adaptingJSONAPI.py

mohadelrezk commented 7 years ago

This issue was moved to OpenGovIntelligence/json-qb-api-implementation#7