Add relationships to the query system