feature(core): support for querying based on relationship create time

fixes #2343

TODOs:
 - [ ] Unit tests
 - [ ] RST docs
 - [ ] Support ordering by relationship create time (or argue for including that in a separate PR)