Proposal: declarative mapping to convert complex nested documents into the FTM entities #891
Replies: 2 comments
-
I think it'd be fun to try and prototype a v2 of mappings, with a much richer modelling language. We should definitely maintain the separation of data cleaning and mapping as two separate tasks - mappings should not do any more data re-formatting than they do right now. That, of course, does not need to stop us from building better ways to unroll and project complex data structures to entities. Have you ever worked with JMESPath before? It may also be interesting to look at https://github.com/kindly/libflatterer as a way to spec out the projections.... |
Beta Was this translation helpful? Give feedback.
-
Work on this now has moved to: https://github.com/dchaplinsky/thebeast - where there's a pretty cool mapping syntax for nested data structures. We still should consider back-porting this into ftm main, but that first requires making the mapper work on JSON data. |
Beta Was this translation helpful? Give feedback.
-
Foreword
Aleph already has some tools (including nice UI) to map flat files (like CSV/XLSX) into the FTM entities. Those mappings are yaml based and allow you to version control them and can be read and used by non-programmers. Great success.
Problem
Some input files are not born tables and cannot be converted to tables (without blowing up the data). For example, we have an asset declaration, where person declares his real estate, cars, incomes, bank accounts. That creates bunch of problems:
Usual solution for this kind of the data sources is to write some python code.
Proposal
It would be nice to have an extension (or a separate project/product/tool) to map such data sources into entities.
Here are some principles:
No idea what to do with backreferencing (for example, when you have one section describing relatives and another section, where data refers to those relatives using their internal id)
@pudo, what do you think.
Beta Was this translation helpful? Give feedback.
All reactions