In a relational DB, I could have a table Person
and a table Hobby
. Every person can have zero, one or more hobbies, and I also want to record, say, the priority of those hobbies for every person.
I could create a relationship table with the 2 foreign keys PersonFK
and HobbyFK
, and one plain column Priority
.
In datomic, to model a simple n:m relationship (without the priority), I'd probably create an attribute of type Reference
with cardinality Many
, that I'd use for Person
entities.
But how would I go about qualifying that relation to be able to store the priority? Would it have to be done analogously to the relational case, i.e. by creating a new entity type just for that relation? Or is there any better way? Using some meta data facility or something?