re-organize the toAql function in order to first output all nodes and then the joins (otherwise the join references are unknown)
re-enable test