atviriduomenys / vadovas

Lietuvos atvirų duomenų vadovas
https://atviriduomenys.readthedocs.io/
GNU Affero General Public License v3.0
3 stars 1 forks source link

Remove base dimension #5

Open sirex opened 1 year ago

sirex commented 1 year ago

Currently base has its own dimension and can be used like this:

base model property type ref
Location id
id integer
code string
Location code
City id
id integer
code string

The issue is, that model.ref becomes irrelevant, when model has a base, because model.ref must be exactly the same as model.base.ref, so basically we just duplicate same metadata in two places.

To improve that and at the same time simplify manifest structure, base dimension can be removed and base could be specified in model.type instead.

Same example above, could be rewritten like this:

model property type ref
Location id
id integer
code string
City Location code
id integer
code string

Since City has Location as its base, then City's model.ref must point to an identifier from base. Here we get exactly same thing, but in a much simpler way.

Regarding model.level, when model has a base, we can use model.level to specify if it is possible to join model with its base in same way as it is used for ref properties.