The JSON-stat response format is documented and already in use. It is time to define a standard query language for JSON-stat.
These are some of the desirable features of the JSON-stat Query Language (JSTQL):
1) Creation of bundles
JSON-stat responses allow multiple datasets. To minimize the number of requests, JSTQL should provide a way of getting a responses with several datasets.
For example:
api/jsonstat?dataset=cpi,gdp
api/cpi.json+gdp.json
etc.
2) Data selections
A dataset can include many dimensions with many categories. JSTQL should provide a way of getting the categories and dimensions of interests.
For example, to select from a "pop" dataset only dimensions "age" and "sex", and inside "sex" only category "F":
pop/sex/F,pop/age (dataset/dimension/category)
These would affect not only the cells retrieved but also the "dimension" and "category" properties.
3) Properties' selections
For certain use cases, some JSON-stat properties may be unneeded. JSTQL should provide a way of avoiding the retrieval of those unneeded elements without affecting the data.
For example, to retrieve only the information of the "year" dimension (the rest are never updated in this particular dataset) and the "value" array of the full "pop" dataset:
pop/value,pop/dimension/year (property/child)
There should probably exist a simplified way of specifying the same property in different places of the JSON-stat tree (for example, keep all the category indices).
4) Rules of inclusion and exclusion
Previous examples focused on inclusion rules. There should be a way to express exclusion rules too.
For example, include all but category "F" of dimension "sex" in the "pop" dataset:
~pop/sex/F
Do we need more features?
What syntax must we use?
X.