add helper to query ancestors