Open rufuspollock opened 8 years ago
For reference (following discussion on IRC):
filters
section in this basicaly gives run-time variables which can be toggled by the user (see here) - but they could also be applied statically. The query spec isn't read by babbage, but by a client app (i.e. offenerhaushalt or cubepress).One question: what is the benefit of having JSON structured queries as opposed to raw SQL. I guess my assumption is one could have both and that JSON structured queries become SQL and are useful because you can create them from a visualization/aggregation editor.
Generating a query is one (important) aspect of that JSON, but not the only one. You also need metadata for the visualisation to know which data to pick, and which fields to apply to which visual aspect in the visualisation.
Beyond that, the filter
are also used to generate distinct value sets so that the resulting web site can have drop-downs.
You can hard-code all of that, but not having a clean model just ends up causing you more work in each specific instance.
Just for fun, check out the site-config
generated from the view spec in OffenerHaushalt. It's a JSON blob in the frozen HTML.
DataFreeze docs: https://dataset.readthedocs.org/en/latest/freezefile.html
Proposal is to make this the primary aggregator library for OpenSpending "next". Basic structure:
More Detail
Example code
example data input layout on disk:
Code snippets
Example command line:
Initial steps
Some links
https://github.com/okfn/dptools/blob/master/bin/load-postgresql.py