Fork me on GitHub
#datomic
<
2016-04-17
>
francoiswirion23:04:01

What are people's approaches to modeling sum (aka union) types in datomic? In clojure you can have a single key map, with the key as type. For datomic I thought of the following way: Have attributes :my-sumtype/string and :my-sumtype/int. To know which one it is, test the attribute for existence (this might be a problem if the type changed over time from e.g. int to string, both will exist, maybe use retraction?) Attach this sum entity to other entities via a ref. Are there better ways?