AlgebraicJulia / ACSets.jl

ACSets: Algebraic databases as in-memory data structures
https://algebraicjulia.github.io/ACSets.jl/
MIT License
19 stars 8 forks source link

Use uniform representation of schemas #19

Open olynch opened 2 years ago

olynch commented 2 years ago

There should be a consistent data type for schemas. Right now, we have type-level schemas and value-level schemas. With the upcoming changes to the julia compiler, this should no longer be necessary. A schema should then be something that looks like the following.

(obs = (:E,:V), attrtypes=(:Weight), homs = (src=(:E,:V), tgt=(:E,:V)), attrs = (weight=(:E,:Weight)))

It has to be a namedtuple instead of a struct because then it can be stuck inside a type. There can also be a "dynamic" version, where obs and attrtypes are vectors and homs and attrs are dicts. Then we can get rid of the whole SchemaDesc, SchemaDescType, SchemaDescTypeType garbage.

epatters commented 2 years ago

For reference, this feature will be enabled by PR https://github.com/JuliaLang/julia/pull/46300, which should land in Julia v1.9.