atviriduomenys / spinta

Spinta is a framework to describe, extract and publish data (a DEP Framework).
MIT License
10 stars 4 forks source link

Add @ for text type in tabular output #581

Closed sirex closed 3 months ago

sirex commented 3 months ago

Currently tabular formats uses flatter function, which uses . or [] separators based on value type.

For text type we need to use @ separator and for that flatten function must also get tree of types in order to choose correct separator depending on type.

For example if we have a manifest table:

d | r | b | m | property | type    | ref     | access  | level | uri
example/ascii/text/lang  |         |         |         |       | 
  |   |   | Country      |         | name    |         |       | 
  |   |   |   | id       | integer |         |         |       |
  |   |   |   | name     | text    |         | open    | 3     |
  |   |   |   | name@en  | string  |         | open    |       |
  |   |   |   | name@lt  | string  |         | open    |       |

Then query like this:

GET /example/ascii/text/lang/Country/:format/ascii?lang(*)&select(id,name)

Should return:

--  ------  ---------  -------
id  name@C  name@en    name@lt
0   LT      Lithuania  Lietuva
1   UK      England    Anglija
--  ------  ---------  -------

Related