[OpenSpending-discuss] Help with the mapping file - views

David Cabo david at calibea.com
Mon Nov 28 21:11:36 UTC 2011


 Hi,

 I was just picking up the import of Spanish budget data [1] into
OpenSpending (after many months away), and I ran into a problem with the
views definition, maybe it's related to Michal's issue:

 I had a classifier and a taxonomy both named 'programme_group' (with an
underscore), and a view associated to them like this:

    {
      "entity": "classifier",
      "label": "Breakdown by programme",
      "name": "default",
      "dimension": "programme_group",
      "breakdown": "programme",
      "filters": {"taxonomy": "programme_group"}
    }

 Other views worked fine, but this one wasn't: I was just getting the list
of entries, but not the tree view. I then noticed that the url was
displaying a hyphen, not an underscore, for example
http://sandbox.openspending.org/classifier/programme-group/453 I've just
changed the model definition to use a hyphen in the dimension name, and now
it all seems to be working.

 Regards,

/david

[1]: http://thedatahub.org/dataset/spain-national-budget-2008-2011

On 28 November 2011 19:29, Friedrich Lindenberg <
friedrich.lindenberg at okfn.org> wrote:

> Hi,
>
> I've looked at the model file a bit but couldn't immediately find the
> error. Maybe you could try the latest version of OpenSpending, where
> we can edit this together. This requires some editing of the model,
> but there's a utility to help you with it:
> https://github.com/okfn/osvalidate. After doing that, you can sign up
> on openspending.org and then using the "Create a dataset..." option in
> the "Datasets" dropdown. There, you can link in data references and
> copy & paste the mapping and views sections of the model file. This
> should give you much better error messages and you can edit the views
> without reloading the data.
>
> - Friedrich
>
> On Mon, Nov 28, 2011 at 5:40 PM, M.Skop KohoVolit.eu
> <michal.skop at kohovolit.eu> wrote:
> > I would like to ask you for help with the mapping file - views. I
> probably
> > still cannot get the idea of drilldowns/taxonomies/cuts/filters right. I
> > have tried many settings, reading the wiki and some mapping files, but no
> > success with following:
> >
> > I have a datafile
> > http://sandbox.openspending.org/dataset/cz_2006-2010_os_2
> > which has 7 different categories (levels)
> > 1:budget - 2:chapter(=group of organizations) - 3:organization - 4:group
> of
> > entries (e.g. 'salaries') - 5:subgroup of entries - 6:subsubgroup of
> entries
> > - 7:entry(account number) -> amount
> > e.g.
> > 1:budget - 2:Chapter 311 - 3:Organization X - 4:group 4_1 - 5:subgroup
> 5_1 -
> > 6:subsubgroup 6_1 - 7:entry 5111
> > or
> > 1:budget - 2:Chapter 311 - 3:Organization Y - 4:group 4_1 - 5:subgroup
> 5_1 -
> > 6:subsubgroup 6_1 - 7:entry 5111
> >
> > (mind that spending groups at level 4 till 7 are the same for all the
> > organizations)
> >
> > I want to be able to drilldown (with appropriate filters) _using the
> > tree-chart_ (and api)
> > A) 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 (and get the final amount in given
> year
> > and organization and entry=account)
> > and/or
> > B) 1 -> 4 -> 5 -> 6 -> 7 -> 2 -> 3 (or similarly 1 -> 4 -> 2 -> 3 ... )
> >
> > How shall I specify the mapping file?
> >
> > Thanks a lot for your help,
> > Michal
> > p.s.: It works in desirable manner down to level 3/4 at the
> > http://sandbox.openspending.org/dataset/cz_2006-2010_os_2, but I cannot
> get
> > it work well further down to level 6/7
> >
> > --
> > Mgr. Michal Škop, Ph.D.
> > KohoVolit.eu
> > michal.skop at kohovolit.eu
> > +420 775 187 021 / +420 721 484 915
> >
> >
> > _______________________________________________
> > openspending mailing list
> > openspending at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/openspending
> >
>
> _______________________________________________
> openspending mailing list
> openspending at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/openspending
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending/attachments/20111128/d192a511/attachment.html>


More information about the openspending mailing list