Add optional cycle detection. Use one of the implementations from InQL v4.x or https://github.com/doyensec/inql/pull/82