@khardenstine thought experiment about pulling into derived refs (relation-as-ref) – Niko replied –https://gist.github.com/dustingetz/cfd6882e2acae6e8b48759ec24c4de0a
https://www.nikolasgoebel.com/2018/06/26/a-query-language.html
http://www.nikolasgoebel.com/2018/03/25/derived-attributes-datascript.html