Closed pudo closed 8 years ago
The term field is overloaded between resources and dimensions (both are often used in the same code, I'd guess). Proposing attribute (ref #40).
Thanks @pudo. I made a similar point here in a long discussion about restructuring the dimension object to support hierarchies. A given dimension field
potentially, though not always, maps to multiple source fields
.
@danfowler can we make an issue for e.g. dimension fields as object rather than array?
@rgrp I can, but I think there are actually (at least) two issues here:
name
to be unique.@rgrp I made the issue: https://github.com/openspending/fiscal-data-package/issues/94
There are also more types of phases and directions (the last dataset I added to OHa has directions "revenue", "expenditure", "internal paid", "internal received", "balance").
@pudo would you class these as "directions"?
@danfowler I'm not actually sure, seems hacky to me. The city treasurer of Hildesheim apparently thinks they are directions, though. They live in a multi-dimensional universe.
I think much of this has been addressed. The main thing for me is that now that we use attributes
in the logical model, I think we should support the proposed change @pudo suggests of source
to field
. It fits the semantics of the spec perfectly (example: an attributes maps to a field or a constant).
@pwalsh +1
I see what you're saying and it makes sense.
In the physical model (the resources
array), each resource has a schema
and each schema
has a fields
array. If we make this change, we are mapping/modeling an element of the fields
array to a field
in the mapping/model.
@pwalsh @danfowler can we get a dedicated issue for this as per (developing) standard practice.
@rgrp https://github.com/openspending/fiscal-data-package/issues/114
@pudo can we close this catch-all, or, is there something else worth pulling out to a distinct issue at this stage?
FIXED.
Just for fun, I'm trying to hack up a FDP->babbage->FDP translator based on Dan's code. As some feedback, here's a sort of stream of consciousness of the issues that come up during this implementation effort:
Problems
source
is a weird name for the column thing. It's a really, really overloaded term. Why notfield
?field
is overloaded between resources and dimensions (both are often used in the same code, I'd guess). Proposingattribute
(ref #40).mapping
, when mapping columns is only a small part of what it does? This is a mistake we already made in OpenSpending, now is the time to correct it.primaryKey
on a dimension to be a list seems a bit too flexible to me, what's the use case? How would I stuff that into an aggregation call, or generate a URL?id
andcode
fields. Which of these is better? How do they relate toprimaryKey
?Opinions
phase
anddirection
end up as attributes on the measure? While I agree that source budget data with multiple measures is quite common, I cannot see a clear difference between these two attributes and other dimensions. I want to break them down the same way I would break down a sector or a supplier, rather than by fiddling with multiple measures. (ref #91 - the discussion there confuses the living daylight out of me)