Difference between TimedIntervalRelation<A, B> and TimedIntervalRelation<B, A>


#1

I just learnt about TimedIntervalRelation parametric type.
As per the documentation, such a relation between two existing types called A and B can be defined by

entity type AToBRelation mixes TimedIntervalRelation<A, B> schema name "A_B_RLTN"

Should I worry about the order of Types passed to TimedIntervalRelation ?

In other words, is this definition

entity type AToBRelation mixes TimedIntervalRelation<B, A> schema name "A_B_RLTN"

would define a different relation compared to the definition above ? If yes, what would be the differences ?


#2

The documentation says that the A corresponds to the from of the relation and B corresponds to the to of the relation. So I would suggest entity type AToBRelation mixes TimedIntervalRelation<A, B> schema name “A_B_RLTN” if you are going from A to B.


#3

Thank you for your reply @romain.juban!
My question can actually be rephrased as How do you know if you are going from A to B or from B to A ? I do not really understand the difference between the two (if there is a difference)


#4

@nathan.rouxel The type is symmetric so it isn’t super critical. If there is a clear “owner” in the relation then that should be the “from”. One possible indication of the owner is that if one type is tracking the history (e.g keeping the latests value of the relation) then that would be the owner. An example might be that an account’s service point changes over time and you want to keep track of the history of those changes and the latest service point for an account (you can only do that for one side of the relation), then you should probably make the account be the “from”.


#5

I see! Thank you very much @trothwein for this enlightenment!